Skip to content

Well Estimator + Constraint Selector #3735

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 35 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
08b90eb
Prototype well estimator solve 1) Setup dofManager and Jacobian syste…
tjb-ltk May 13, 2025
ca3b825
test wellsolver NLS
tjb-ltk May 14, 2025
9e81bdf
more well estimator prototyping
tjb-ltk May 16, 2025
347bfa3
fix well est matrix rhs to incl perf in/out flows, est applied every …
tjb-ltk May 19, 2025
99a0676
rel mode fixes
tjb-ltk May 21, 2025
8ef7db5
missing file
tjb-ltk May 23, 2025
2c59944
add missing dperf ders, still need to fix thermal case
tjb-ltk May 23, 2025
ea6e8de
add BC per flow ders for thermal
tjb-ltk May 27, 2025
155e857
hack access to current newton iter
tjb-ltk May 29, 2025
8603bc9
...
tjb-ltk Jun 5, 2025
18b82ee
1) uncrustify, 2) enable parallel soln update for estimator
tjb-ltk Jun 6, 2025
6a219bb
1) make well open/close state available when time not in arg list, 2)…
tjb-ltk Jun 9, 2025
5f0c032
1) force 0.5 day dt when thermal well opens, 2) add line search to we…
tjb-ltk Jun 9, 2025
65ffa2f
fix use of well open/close state
tjb-ltk Jun 10, 2025
5ce0a42
1) create fluid model for each well constraint , 2) restructure well…
tjb-ltk Jun 23, 2025
a29a138
1) add schema and classes for well constraints, 2) uncrustify
tjb-ltk Jun 27, 2025
0a57d7d
well constraint prototyping
tjb-ltk Jul 1, 2025
2317a6b
refactor constraint classes , add constraint evaluation w/option for …
tjb-ltk Jul 11, 2025
207490e
prototype well constraint selector
tjb-ltk Jul 14, 2025
5621e98
add selector for inj cons
tjb-ltk Jul 15, 2025
a3816f0
save pointer to limcon for use in jacgen, temp workaround for constra…
tjb-ltk Jul 15, 2025
3723b89
1) updateSeparator included in updateState, 2) build out limcon selec…
tjb-ltk Jul 18, 2025
f873b68
fixes so constraint_switch.xml runs, rel mode fixes, cleanup
tjb-ltk Jul 21, 2025
859fad4
1) constraint selector reorg to support w/wout estimator in same code…
tjb-ltk Jul 29, 2025
3890979
WHP constraint classes
tjb-ltk Jul 29, 2025
5f344ff
1) specialization of multivariabletablefunction for flow tables, 2) w…
tjb-ltk Jul 30, 2025
e111d93
make wrapper def and input consistent
tjb-ltk Jul 30, 2025
25be038
devs for unequally spaced table coordinates
tjb-ltk Aug 5, 2025
96c299d
setup flow table function from user input
tjb-ltk Aug 8, 2025
6bc1a63
whp dev
tjb-ltk Aug 14, 2025
e787976
whp dev
tjb-ltk Aug 14, 2025
3a3299c
tweak flow table and well inputs to test whp=Finv(xyz)
tjb-ltk Aug 15, 2025
6772df8
whp constraint dev
tjb-ltk Aug 18, 2025
1fab9ff
get phase index from fluild model
tjb-ltk Aug 19, 2025
7b4b493
1) more whp, 2) test for max liq prod constraint
tjb-ltk Aug 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
295 changes: 295 additions & 0 deletions inputFiles/compositionalMultiphaseWell/cst1_lrc_we0.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,295 @@
<?xml version="1.0" ?>

<Problem>
<Solvers>
<CompositionalMultiphaseReservoir
name="reservoirSystem"
flowSolverName="compositionalMultiphaseFlow"
wellSolverName="compositionalMultiphaseWell"
logLevel="1"
targetRegions="{ Region1, wellRegion1, wellRegion2 }">
<NonlinearSolverParameters
newtonTol="1.0e-8"
lineSearchAction="None"
newtonMaxIter="40"/>
<LinearSolverParameters
directParallel="0"/>
</CompositionalMultiphaseReservoir>

<CompositionalMultiphaseFVM
name="compositionalMultiphaseFlow"
logLevel="1"
discretization="fluidTPFA"
targetRegions="{ Region1 }"
temperature="297.15"/>

<CompositionalMultiphaseWell
name="compositionalMultiphaseWell"
logLevel="1"
writeCSV="1"
writeSegDebug="0"
useNewCode="1"
targetRegions="{ wellRegion1, wellRegion2 }">
<WellControls
estimateWellSolution="0"
name="wellControls1"
type="producer"
control="phaseVolRate"
useSurfaceConditions="0"
referenceElevation="2"
targetBHP="3e6"
targetPhaseRate="2e-6"
targetPhaseName="oil">
<MinimumBHPConstraint
name="minBHP"
referenceElevation="2"
targetBHP="3e6"/>
<LiquidProductionConstraint
name="maxOil"
phaseNamse="{oil}"
phaseRate="2e-6"/>
</WellControls>
<WellControls
estimateWellSolution="0"
name="wellControls2"
type="injector"
control="totalVolRate"
referenceElevation="2"
targetBHP="1e7"
targetTotalRate="28e-7"
useSurfaceConditions="0"
injectionTemperature="297.15"
injectionStream="{ 0.1, 0.1, 0.1, 0.7 }">
<MaximumBHPConstraint
name="maxBHP"
referenceElevation="2"
targetBHP="1e7"/>
<VolumeInjectionConstraint
name="maxVol"
volumeRate="28e-7"
injectionTemperature="297.15"
injectionStream="{ 0.1, 0.1, 0.1, 0.7 }"/>
</WellControls>

</CompositionalMultiphaseWell>
</Solvers>

<Mesh>
<InternalMesh
name="mesh1"
elementTypes="{ C3D8 }"
xCoords="{ 0, 5 }"
yCoords="{ 0, 1 }"
zCoords="{ 0, 1 }"
nx="{ 5 }"
ny="{ 1 }"
nz="{ 1 }"
cellBlockNames="{ cb1 }">

<InternalWell
name="well_producer1"
wellRegionName="wellRegion1"
wellControlsName="wellControls1"
polylineNodeCoords="{ { 4.5, 0, 2 },
{ 4.5, 0, 0.5 } }"
polylineSegmentConn="{ { 0, 1 } }"
radius="0.1"
numElementsPerSegment="2">
<Perforation
name="producer1_perf1"
distanceFromHead="1.45"/>
</InternalWell>

<InternalWell
name="well_injector1"
wellRegionName="wellRegion2"
wellControlsName="wellControls2"
polylineNodeCoords="{ { 0.5, 0, 2 },
{ 0.5, 0, 0.5 } }"
polylineSegmentConn="{ { 0, 1 } }"
radius="0.1"
numElementsPerSegment="3">
<Perforation
name="injector1_perf1"
distanceFromHead="1.45"/>
</InternalWell>
</InternalMesh>
</Mesh>

<Geometry>
<Box
name="monitoredCell"
xMin="{ 4.5, 0, 2 }"
xMax="{ 4.5, 0, 0.5 }" />
</Geometry>

<Events
maxTime="2.5e4">
<PeriodicEvent
name="solverApplications"
forceDt="2.5e3"
target="/Solvers/reservoirSystem"/>

<PeriodicEvent
name="outputs"
timeFrequency="2.5e3"
target="/Outputs/vtkOutput"/>


<PeriodicEvent
name="timeHistoryOutput1"
timeFrequency="1.0e3"
target="/Outputs/timeHistoryOutput1"/>
<PeriodicEvent
name="timeHistoryOutput2"
timeFrequency="1.0e3"
target="/Outputs/timeHistoryOutput2"/>

<PeriodicEvent
name="restarts"
timeFrequency="1.25e4"
targetExactTimestep="0"
target="/Outputs/restartOutput"/>
</Events>

<Tasks>
<PackCollection
name="wellRateCollection1"
objectPath="ElementRegions/wellRegion1/wellRegion1UniqueSubRegion"
fieldName="wellElementMixtureConnectionRate"/>
<PackCollection
name="wellPhaseVolumeFraction"
objectPath="ElementRegions/wellRegion1/wellRegion1UniqueSubRegion"
fieldName="phaseVolumeFraction"/>
</Tasks>

<NumericalMethods>
<FiniteVolume>
<TwoPointFluxApproximation
name="fluidTPFA"
/>
</FiniteVolume>
</NumericalMethods>

<ElementRegions>
<CellElementRegion
name="Region1"
cellBlocks="{ * }"
materialList="{ fluid1, rock, relperm }"/>

<WellElementRegion
name="wellRegion1"
materialList="{ fluid1 }"/>

<WellElementRegion
name="wellRegion2"
materialList="{ fluid1 }"/>
</ElementRegions>

<Constitutive>
<CompositionalMultiphaseFluid
name="fluid1"
phaseNames="{ oil, gas }"
equationsOfState="{ PR, PR }"
componentNames="{ N2, C10, C20, H2O }"
componentCriticalPressure="{ 34e5, 25.3e5, 14.6e5, 220.5e5 }"
componentCriticalTemperature="{ 126.2, 622.0, 782.0, 647.0 }"
componentAcentricFactor="{ 0.04, 0.443, 0.816, 0.344 }"
componentMolarWeight="{ 28e-3, 134e-3, 275e-3, 18e-3 }"
componentVolumeShift="{ 0, 0, 0, 0 }"
componentBinaryCoeff="{ { 0, 0, 0, 0 },
{ 0, 0, 0, 0 },
{ 0, 0, 0, 0 },
{ 0, 0, 0, 0 } }"/>

<CompressibleSolidConstantPermeability
name="rock"
solidModelName="nullSolid"
porosityModelName="rockPorosity"
permeabilityModelName="rockPerm"/>

<NullModel
name="nullSolid"/>

<PressurePorosity
name="rockPorosity"
defaultReferencePorosity="0.05"
referencePressure="0.0"
compressibility="1.0e-9"/>

<BrooksCoreyRelativePermeability
name="relperm"
phaseNames="{ oil, gas }"
phaseMinVolumeFraction="{ 0.1, 0.15 }"
phaseRelPermExponent="{ 2.0, 2.0 }"
phaseRelPermMaxValue="{ 0.8, 0.9 }"/>

<ConstantPermeability
name="rockPerm"
permeabilityComponents="{ 2.0e-16, 2.0e-16, 2.0e-16 }"/>
</Constitutive>

<FieldSpecifications>
<!-- Initial pressure: ~5 bar -->
<FieldSpecification
name="initialPressure"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions/Region1/cb1"
fieldName="pressure"
scale="5e6"/>

<!-- Initial composition: no water, only heavy hydrocarbon components and N2 -->
<FieldSpecification
name="initialComposition_N2"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions/Region1/cb1"
fieldName="globalCompFraction"
component="0"
scale="0.099"/>

<FieldSpecification
name="initialComposition_C10"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions/Region1/cb1"
fieldName="globalCompFraction"
component="1"
scale="0.3"/>

<FieldSpecification
name="initialComposition_C20"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions/Region1/cb1"
fieldName="globalCompFraction"
component="2"
scale="0.6"/>

<FieldSpecification
name="initialComposition_H20"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions/Region1/cb1"
fieldName="globalCompFraction"
component="3"
scale="0.001"/>
</FieldSpecifications>

<Outputs>
<VTK
name="vtkOutput"/>
<TimeHistory
name="timeHistoryOutput1"
sources="{ /Tasks/wellRateCollection1 }"
filename="wellRateHistory1"/>
<TimeHistory
name="timeHistoryOutput2"
sources="{ /Tasks/wellPhaseVolumeFraction }"
filename="wellpvf"/>

<Restart
name="restartOutput"/>
</Outputs>
</Problem>
Loading