-
Notifications
You must be signed in to change notification settings - Fork 89
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
refactor: Add component selector for fluid models #3213
Merged
rrsettgast
merged 18 commits into
develop
from
refactor/dkachuma/fluid-component-combinations
Jul 24, 2024
Merged
Changes from 12 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
0c89869
Add component selector
dkachuma a3e9d85
Use in kernels
dkachuma ed5e6de
Add test cases
dkachuma f2e559f
Rename select -> expand
dkachuma 180bece
Further changes
dkachuma 11e249b
Fix integrated tests
dkachuma d9c9081
Fix integrated tests
dkachuma 17bc38d
Remove thermal test
dkachuma 8736c9d
Merge branch 'develop' into refactor/dkachuma/fluid-component-combina…
dkachuma 0349ae8
Rebaseline
dkachuma 0928d39
Use integer sequence generator
dkachuma 8ce4376
Merge branch 'develop' into refactor/dkachuma/fluid-component-combina…
dkachuma f259c4e
Use constexpr if
dkachuma 5c2c0bf
Merge branch 'develop' into refactor/dkachuma/fluid-component-combina…
dkachuma d31835e
Rebaseline
dkachuma 1d74597
thermal -> isThermalType
dkachuma 4a45843
Merge branch 'develop' into refactor/dkachuma/fluid-component-combina…
dkachuma cb97a03
Merge branch 'develop' into refactor/dkachuma/fluid-component-combina…
dkachuma File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
227 changes: 227 additions & 0 deletions
227
inputFiles/compositionalMultiphaseFlow/co2_flux_dirichlet.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,227 @@ | ||
<?xml version="1.0" ?> | ||
|
||
<Problem> | ||
<Solvers> | ||
<CompositionalMultiphaseFVM | ||
name="compflow" | ||
logLevel="1" | ||
discretization="fluidTPFA" | ||
temperature="368.15" | ||
useMass="1" | ||
targetRegions="{ region }"> | ||
<NonlinearSolverParameters | ||
newtonTol="1.0e-4" | ||
newtonMaxIter="100" | ||
maxTimeStepCuts="5" | ||
lineSearchAction="None"/> | ||
<LinearSolverParameters | ||
solverType="fgmres" | ||
preconditionerType="mgr" | ||
krylovTol="1.0e-5"/> | ||
</CompositionalMultiphaseFVM> | ||
</Solvers> | ||
|
||
<Mesh> | ||
<InternalMesh | ||
name="mesh" | ||
elementTypes="{ C3D8 }" | ||
xCoords="{ 0, 50.0 }" | ||
yCoords="{ -0.5, 0.5 }" | ||
zCoords="{ 0, 15.0 }" | ||
nx="{ 50 }" | ||
ny="{ 1 }" | ||
nz="{ 15 }" | ||
cellBlockNames="{ cellBlock }"/> | ||
</Mesh> | ||
|
||
<Geometry> | ||
<Box | ||
name="source" | ||
xMin="{ -0.01, -0.51, 6.99 }" | ||
xMax="{ 1.01, 0.51, 8.01 }"/> | ||
|
||
<Box | ||
name="rightEnd" | ||
xMin="{ 49.99, -0.51, -0.01 }" | ||
xMax="{ 50.01, 0.51, 15.01 }"/> | ||
</Geometry> | ||
|
||
<Events | ||
maxTime="1e6"> | ||
<PeriodicEvent | ||
name="solverApplications" | ||
maxEventDt="5e4" | ||
target="/Solvers/compflow" /> | ||
|
||
<PeriodicEvent | ||
name="statistics" | ||
timeFrequency="1e5" | ||
targetExactTimestep="1" | ||
target="/Tasks/compflowStatistics" /> | ||
|
||
<PeriodicEvent | ||
name="outputs" | ||
timeFrequency="1e5" | ||
targetExactTimestep="1" | ||
target="/Outputs/vtkOutput" /> | ||
|
||
<PeriodicEvent | ||
name="restarts" | ||
timeFrequency="5e5" | ||
targetExactTimestep="0" | ||
target="/Outputs/sidreRestart"/> | ||
</Events> | ||
|
||
<NumericalMethods> | ||
<FiniteVolume> | ||
<TwoPointFluxApproximation | ||
name="fluidTPFA"/> | ||
</FiniteVolume> | ||
</NumericalMethods> | ||
|
||
<ElementRegions> | ||
<CellElementRegion | ||
name="region" | ||
cellBlocks="{ cellBlock }" | ||
materialList="{ fluid, rock, relperm }"/> | ||
</ElementRegions> | ||
|
||
<Constitutive> | ||
<CO2BrinePhillipsFluid | ||
name="fluid" | ||
logLevel="1" | ||
phaseNames="{ gas, water }" | ||
componentNames="{ co2, water }" | ||
componentMolarWeight="{ 44e-3, 18e-3 }" | ||
phasePVTParaFiles="{ pvtgas.txt, pvtliquid.txt }" | ||
flashModelParaFile="co2flash.txt"/> | ||
|
||
<CompressibleSolidConstantPermeability | ||
name="rock" | ||
solidModelName="nullSolid" | ||
porosityModelName="rockPorosity" | ||
permeabilityModelName="rockPerm"/> | ||
<NullModel | ||
name="nullSolid"/> | ||
<PressurePorosity | ||
name="rockPorosity" | ||
defaultReferencePorosity="0.2" | ||
referencePressure="1.1e7" | ||
compressibility="1.0e-9" /> | ||
<ConstantPermeability | ||
name="rockPerm" | ||
permeabilityComponents="{ 1.0e-13, 1.0e-13, 1.0e-14 }"/> | ||
|
||
<TableRelativePermeability | ||
name="relperm" | ||
phaseNames="{ gas, water }" | ||
wettingNonWettingRelPermTableNames="{ waterRelativePermeabilityTable, | ||
gasRelativePermeabilityTable }"/> | ||
</Constitutive> | ||
|
||
<FieldSpecifications> | ||
<!-- Initial conditions --> | ||
<FieldSpecification | ||
name="initial_pressure" | ||
setNames="{ all }" | ||
objectPath="ElementRegions/region" | ||
fieldName="pressure" | ||
initialCondition="1" | ||
logLevel="2" | ||
scale="1.1e6" /> | ||
<FieldSpecification | ||
name="initial_temperature" | ||
setNames="{ all }" | ||
objectPath="ElementRegions/region" | ||
fieldName="temperature" | ||
initialCondition="1" | ||
scale="368.15" /> | ||
<FieldSpecification | ||
name="initial_co2" | ||
setNames="{ all }" | ||
objectPath="ElementRegions/region" | ||
fieldName="globalCompFraction" | ||
initialCondition="1" | ||
component="0" | ||
scale="0.0" /> | ||
<FieldSpecification | ||
name="initial_h2o" | ||
setNames="{ all }" | ||
objectPath="ElementRegions/region" | ||
fieldName="globalCompFraction" | ||
initialCondition="1" | ||
component="1" | ||
scale="1.0" /> | ||
|
||
<!-- Injection rate: 0.002 kg/s --> | ||
<SourceFlux | ||
name="sourceTerm" | ||
objectPath="ElementRegions/region/cellBlock" | ||
component="0" | ||
scale="-0.002" | ||
setNames="{ source }"/> | ||
|
||
<!-- Boundary conditions at right end --> | ||
<FieldSpecification | ||
name="sinkTerm_pressure" | ||
setNames="{ rightEnd }" | ||
objectPath="faceManager" | ||
fieldName="pressure" | ||
scale="1.1e6" /> | ||
<FieldSpecification | ||
name="sinkTerm_temperature" | ||
setNames="{ rightEnd }" | ||
objectPath="faceManager" | ||
fieldName="temperature" | ||
scale="368.15" /> | ||
<FieldSpecification | ||
name="sinkTerm_co2" | ||
setNames="{ rightEnd }" | ||
objectPath="faceManager" | ||
fieldName="globalCompFraction" | ||
component="0" | ||
scale="0.0" /> | ||
<FieldSpecification | ||
name="sinkTerm_h2o" | ||
setNames="{ rightEnd }" | ||
objectPath="faceManager" | ||
fieldName="globalCompFraction" | ||
component="1" | ||
scale="1.0" /> | ||
|
||
</FieldSpecifications> | ||
|
||
<Tasks> | ||
|
||
<CompositionalMultiphaseStatistics | ||
name="compflowStatistics" | ||
flowSolverName="compflow" | ||
logLevel="1" | ||
writeCSV="1" | ||
computeCFLNumbers="1" | ||
computeRegionStatistics="1"/> | ||
|
||
</Tasks> | ||
|
||
<Functions> | ||
<TableFunction | ||
name="waterRelativePermeabilityTable" | ||
coordinateFiles="{ phaseVolFraction_water.txt }" | ||
voxelFile="relPerm_water.txt"/> | ||
|
||
<TableFunction | ||
name="gasRelativePermeabilityTable" | ||
coordinateFiles="{ phaseVolFraction_gas.txt }" | ||
voxelFile="relPerm_gas.txt"/> | ||
</Functions> | ||
|
||
<Outputs> | ||
<VTK | ||
name="vtkOutput" | ||
plotFileRoot="co2_flux_dirichlet"/> | ||
|
||
<Restart | ||
name="sidreRestart"/> | ||
</Outputs> | ||
|
||
</Problem> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice! We did have something like this already.