Skip to content
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

feat: Add immiscible multiphase flow package #3251

Open
wants to merge 87 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 69 commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
bf8c1c2
Add ImmiscibleMultiphaseFlow physics package.
CusiniM Jul 26, 2024
22aed17
catalog name, register and cmakelist.
CusiniM Jul 26, 2024
fd51d91
fix fields.
CusiniM Jul 29, 2024
c90724a
removed all compositional references.
CusiniM Jul 29, 2024
e4a9df0
Merge remote-tracking branch 'origin/develop' into feature/immiscible…
CusiniM Jul 30, 2024
446e401
Compiles and links.
CusiniM Jul 30, 2024
0d159ae
update input file so it runs
Aug 1, 2024
7783a15
adding skeleton for setupDofs
Aug 1, 2024
5fcd5d8
testing
rpiazza87 Aug 1, 2024
8e132b9
fluid model
rpiazza87 Aug 2, 2024
c21d047
rock-fluid model
rpiazza87 Aug 2, 2024
d59fa4e
new kernel file
rpiazza87 Aug 7, 2024
1fe6570
updated kernel functions
rpiazza87 Aug 12, 2024
1b190a8
x
rpiazza87 Aug 12, 2024
33c6c0f
x
rpiazza87 Aug 12, 2024
cc35e59
add temperature to input file
Ammara-14 Aug 2, 2024
297669c
Initial implementation of assembleAccumulationTerm
Ammara-14 Aug 8, 2024
dc73aa2
Few fixes in the accumulation term assumbly and added fields for the …
Ammara-14 Aug 14, 2024
f6d14dc
update datalayout
rpiazza87 Aug 19, 2024
477d87e
updated solver files
rpiazza87 Aug 19, 2024
0526164
update kernel
rpiazza87 Aug 19, 2024
40e191a
added phase mobility kernel
rpiazza87 Aug 20, 2024
cb15c30
updated kernels, apply BC and setupDOF
rpiazza87 Aug 20, 2024
2d4f897
made minor fixes to make the code compile in release mode - thanks to…
Ammara-14 Aug 22, 2024
3ecbf3d
Added first version of a simplified two phase fluid model
Sep 17, 2024
549629d
Started modifications to use twoPhaseFluid model in the flow solver.
Sep 17, 2024
02287f7
changes from commit that was removed
rrsettgast Sep 17, 2024
3d2339f
Merge remote-tracking branch 'origin/develop' into feature/immiscible…
CusiniM Sep 17, 2024
dcd2c54
Fixed fluid initialization in flow solver, updated xml input file.
Sep 19, 2024
7ab6cba
Removed density and viscosity from fields, took these from fluid mode…
Sep 19, 2024
bb4092d
Fixed loop bounds in phaseMobilityKernel.
Sep 20, 2024
6e3e41b
Fixed copyright info.
Sep 20, 2024
3b9a8f5
Merge remote-tracking branch 'origin/develop' into feature/immiscible…
Sep 20, 2024
ea17e7d
Fixed TwoPhaseFluid test to pass CI with clang.
Sep 20, 2024
f4aa73b
Made unit test initialization lighter (does not require whole Geos in…
Sep 20, 2024
75745ff
removed the SinglePhaseBaseKernels references in the ImmiscibleMultip…
Ammara-14 Sep 25, 2024
8deed6f
Fixed shape of m_dens and its derivative to match fluid model.
Sep 25, 2024
f7b5d23
Added check for density monotonicity.
Sep 26, 2024
6575af5
Implemented calculateResidual
Ammara-14 Oct 2, 2024
f331113
Fixed missing initialization of saturation and phaseMass.
Oct 3, 2024
98e2c14
Applied uncrustify formatting.
Oct 3, 2024
6a43303
Added applySystemSolution and phaseVolumeFractions boundary conditions
Ammara-14 Oct 8, 2024
c854b70
this version runs a simple test case with no convergence issues
Ammara-14 Oct 16, 2024
f4be6ef
Fixed relative permeability calculation
Ammara-14 Oct 17, 2024
2acd7c9
Clean up and formatting.
Oct 17, 2024
7089df7
Fixed GPU compilation.
Oct 18, 2024
4418aaa
Minor formatting to pass the CI uncrustify test
Oct 18, 2024
61c6169
Fixed reset function for saturations
Oct 23, 2024
b8eafc3
Added a unit test to numerically check the Jacobian.
Oct 24, 2024
fc01af3
added applySourceFlux
Ammara-14 Oct 24, 2024
da993f6
minor fix on applySourceFluxBC
Ammara-14 Oct 24, 2024
9f0c7c5
included iterative solvers
rpiazza87 Oct 24, 2024
645748d
Fooled compiler to prevent an unusedlambdacapture error
Oct 25, 2024
cb81cf9
Merge remote-tracking branch 'origin/develop' into feature/immiscible…
Oct 25, 2024
6c8eefa
Added input files for BuckleyLeverett, CapillaryPressure and Gravity …
Oct 28, 2024
05f0287
Fixed xml format.
Oct 28, 2024
83086d0
Updated unit test for better coverage.
Oct 28, 2024
a99d949
Added SPE10_layer84 test case.
Oct 29, 2024
3e698b8
Created an ats test from the gravitySegration example.
Oct 30, 2024
98cbe14
Updated integrated test ID after first dry run.
Oct 31, 2024
90e8db3
Added more ats.
Oct 31, 2024
fd702fc
Added more ats, part2.
Oct 31, 2024
41c19e1
Fixed capillaryPressure test.
Nov 5, 2024
ff37803
Removed unused function.
Nov 6, 2024
4453d20
Added documentation for the two-phase fluid model.
Nov 8, 2024
316b4b7
Fixed doc.
Nov 8, 2024
389bfb0
included total mass formulation
rpiazza87 Nov 12, 2024
90924db
Merged with develop.
Nov 14, 2024
73dc82f
updated the assembleAccumulationTerm kernel and added documentation f…
Ammara-14 Nov 18, 2024
fa42877
fixed code style and added a dedicated Kernel selector switch
Ammara-14 Nov 21, 2024
83783e6
Fixed doc references.
Nov 22, 2024
84673ee
Used pre-existing Geos readTable function.
Nov 22, 2024
b23c33d
Addressed Pavel's comments.
Dec 6, 2024
557b179
code style
Dec 7, 2024
cf32759
Merge remote-tracking branch 'origin/develop' into feature/immiscible…
Dec 9, 2024
3cef9ab
Used the newly introduced initializeState from FlowSolverBase.
Dec 10, 2024
8bb5ba6
Fixed style.
Dec 10, 2024
e8698c0
Merge remote-tracking branch 'origin/develop' into feature/immiscible…
Dec 10, 2024
3ddd347
Changed Total S.A.
Dec 10, 2024
8d0cd41
Made density averaging optional (need gpu validation).
Dec 10, 2024
434c435
Merge remote-tracking branch 'origin/develop' into feature/immiscible…
Dec 12, 2024
f39620c
Added schema.
Dec 12, 2024
16715ce
Fixed doc.
Dec 12, 2024
9e32fe5
Added rebaseline infos.
Dec 12, 2024
3395073
Added back HYPRE_BoomerAMGSetAggNumLevels.
Dec 17, 2024
fab919e
Merge remote-tracking branch 'origin/develop' into feature/immiscible…
Dec 18, 2024
84613c5
Removed ubuntu config file.
Dec 18, 2024
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
44 changes: 44 additions & 0 deletions host-configs/Stanford/ubuntu22.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# file: your-platform.cmake

# detect host and name the configuration file
site_name(HOST_NAME)
set(CONFIG_NAME "ubuntu22" CACHE PATH "")
message("CONFIG_NAME = ${CONFIG_NAME}")

# set paths to C, C++, and Fortran compilers. Note that while GEOS does not contain any Fortran code,
# some of the third-party libraries do contain Fortran code. Thus a Fortran compiler must be specified.
set(CMAKE_C_COMPILER "/usr/bin/gcc" CACHE PATH "")
set(CMAKE_CXX_COMPILER "/usr/bin/g++" CACHE PATH "")
set(CMAKE_Fortran_COMPILER "/usr/bin/gfortran" CACHE PATH "")
set(ENABLE_FORTRAN OFF CACHE BOOL "" FORCE)

# enable MPI and set paths to compilers and executable.
# Note that the MPI compilers are wrappers around standard serial compilers.
# Therefore, the MPI compilers must wrap the appropriate serial compilers specified
# in CMAKE_C_COMPILER, CMAKE_CXX_COMPILER, and CMAKE_Fortran_COMPILER.
set(ENABLE_MPI ON CACHE BOOL "")
set(MPI_C_COMPILER "/usr/bin/mpicc" CACHE PATH "")
set(MPI_CXX_COMPILER "/usr/bin/mpicxx" CACHE PATH "")
set(MPI_Fortran_COMPILER "/usr/bin/mpifort" CACHE PATH "")
set(MPIEXEC "/usr/bin/mpirun" CACHE PATH "")

# define the path to blas and lapack
#set( BLAS_LIBRARIES /home/rpiazza/lib/lapack-3.11.0-linux-x86_64/libblas.so CACHE PATH "" FORCE )
#set( LAPACK_LIBRARIES /home/rpiazza/lib/lapack-3.11.0-linux-x86_64/liblapack.so CACHE PATH "" FORCE )

# disable CUDA and OpenMP
set(ENABLE_CUDA OFF CACHE BOOL "" FORCE)
set(ENABLE_OPENMP OFF CACHE BOOL "" FORCE)

# enable PVTPackage
set(ENABLE_PVTPackage ON CACHE BOOL "" FORCE)

# enable tests
set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "" FORCE )

# define the path to your compiled installation directory
set(GEOS_TPL_DIR "/home/rpiazza/two-phase/thirdPartyLibs/install-ubuntu22-debug" CACHE PATH "")
#set(GEOSX_TPL_DIR "${GEOSX_TPL_DIR}" CACHE PATH "" FORCE)
# let GEOS define some third party libraries information for you
#include(${CMAKE_CURRENT_LIST_DIR}/tpls.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/../tpls.cmake)
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
<?xml version="1.0" ?>

<Problem>
<!-- SPHINX_SOLVER -->
<Solvers>
<ImmiscibleMultiphaseFlow
name="FlowSolver"
logLevel="4"
discretization="TPFA"
temperature="300"
initialDt="0.001"
targetRegions="{ region }">
<NonlinearSolverParameters
newtonTol="1.0e-6"
newtonMaxIter="50"
maxTimeStepCuts="2"/>
<LinearSolverParameters
solverType="direct"
directParallel="0"
logLevel="0"/>
</ImmiscibleMultiphaseFlow>
</Solvers>
<!-- SPHINX_SOLVER_END -->

<!-- SPHINX_NUMERICAL -->
<NumericalMethods>
<FiniteVolume>
<TwoPointFluxApproximation
name="TPFA"/>
</FiniteVolume>
</NumericalMethods>
<!-- SPHINX_NUMERICAL_END -->

<!-- SPHINX_ELEMENTREGIONS -->
<ElementRegions>
<CellElementRegion
name="region"
cellBlocks="{ cellBlock }"
materialList="{ fluid, rock, relperm }"/>
</ElementRegions>
<!-- SPHINX_ELEMENTREGIONS_END -->

<!-- SPHINX_MATERIAL -->
<Functions>
<TableFunction
name="densityTablePhase1"
coordinates="{ 0.0}"
values="{ 280 }" />
<TableFunction
name="densityTablePhase2"
coordinates="{ 0.0 }"
values="{ 992 }" />
<TableFunction
name="viscosityTablePhase1"
coordinates="{ 0.0}"
values="{ 0.000023 }" />
<TableFunction
name="viscosityTablePhase2"
coordinates="{ 0.0 }"
values="{ 0.00055 }" />
</Functions>

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

<NullModel
name="nullSolid"/>

<PressurePorosity
name="rockPorosity"
defaultReferencePorosity="0.2"
referencePressure="1e7"
compressibility="1.0e-15"/>

<ConstantPermeability
name="rockPerm"
permeabilityComponents="{ 9.0e-13, 9.0e-13, 9.0e-13}"/>

<BrooksCoreyRelativePermeability
name="relperm"
phaseNames="{ gas, water }"
phaseMinVolumeFraction="{ 0.0, 0.0 }"
phaseRelPermExponent="{ 3.5, 3.5 }"
phaseRelPermMaxValue="{ 1.0, 1.0 }"/>

<TwoPhaseFluid
name="fluid"
phaseNames="{gas, water}"
densityTableNames="{densityTablePhase1, densityTablePhase2}"
viscosityTableNames="{viscosityTablePhase1, viscosityTablePhase2}" />
</Constitutive>
<!-- SPHINX_MATERIAL_END -->

<!-- SPHINX_BC -->
<FieldSpecifications>
<FieldSpecification
name="initialPressure"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions"
fieldName="pressure"
scale="1e7"/>

<FieldSpecification
name="initialSaturation_gas"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions"
fieldName="phaseVolumeFraction"
component="0"
scale="0.0"/>

<FieldSpecification
name="initialSaturation_water"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions"
fieldName="phaseVolumeFraction"
component="1"
scale="1.0"/>

<SourceFlux
name="sourceTerm"
objectPath="ElementRegions"
scale="-0.00007"
component="0"
setNames="{ source }"/>

<FieldSpecification
name="sinkTermPressure"
objectPath="ElementRegions"
fieldName="pressure"
scale="1e7"
setNames="{ sink }"/>

<FieldSpecification
name="sinkTermSaturation_gas"
setNames="{ sink }"
objectPath="ElementRegions"
fieldName="phaseVolumeFraction"
component="0"
scale="0.0"/>

<FieldSpecification
name="sinkTermComposition_water"
setNames="{ sink }"
objectPath="ElementRegions"
fieldName="phaseVolumeFraction"
component="1"
scale="1.0"/>
</FieldSpecifications>
<!-- SPHINX_BC_END -->

<!-- SPHINX_OUTPUT -->
<Outputs>
<VTK
name="vtkOutput"/>

<TimeHistory
name="timeHistoryOutput"
sources="{/Tasks/phaseVolumeFractionCollection}"
filename="saturationHistory" />

<Restart
name="restartOutput"/>
</Outputs>
<!-- SPHINX_OUTPUT_END -->

<!-- SPHINX_TASKS -->
<Tasks>
<PackCollection
name="phaseVolumeFractionCollection"
objectPath="ElementRegions/region/cellBlock"
fieldName="phaseVolumeFraction"/>
</Tasks>
<!-- SPHINX_TASKS_END -->
</Problem>
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?xml version="1.0" ?>

<Problem>
<Included>
<File name="./buckleyLeverett_base.xml"/>
</Included>

<!-- SPHINX_MESH -->
<Mesh>
<InternalMesh
name="mesh"
elementTypes="{ C3D8 }"
xCoords="{ 0, 0.1 }"
yCoords="{ 0, 0.00202683 }"
zCoords="{ 0, 1 }"
nx="{ 1000 }"
ny="{ 1 }"
nz="{ 1 }"
cellBlockNames="{ cellBlock }"/>
</Mesh>
<!-- SPHINX_MESH_END -->

<Geometry>
<Box
name="source"
xMin="{-0.00001, -0.00001, -0.00001}"
xMax="{ 0.00011, 1.00001, 1.00001}"/>

<Box
name="sink"
xMin="{ .09989, -0.00001, -0.00001}"
xMax="{ 0.10001, 1.00001, 1.00001}"/>
</Geometry>

<Events
maxTime="70.1">

<PeriodicEvent
name="outputs"
timeFrequency="1"
targetExactTimestep="1"
target="/Outputs/vtkOutput"/>

<PeriodicEvent
name="timeHistoryOutput"
timeFrequency="10"
targetExactTimestep="1"
target="/Outputs/timeHistoryOutput" />

<PeriodicEvent
name="timeHistoryCollection"
timeFrequency="10"
targetExactTimestep="1"
target="/Tasks/phaseVolumeFractionCollection" />

<PeriodicEvent
name="solverApplications"
maxEventDt="0.01"
target="/Solvers/FlowSolver"/>
</Events>
</Problem>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from geos.ats.test_builder import TestDeck, RestartcheckParameters, generate_geos_tests

restartcheck_params = {}
restartcheck_params['atol'] = 1.0E-8
restartcheck_params['rtol'] = 1.0E-8

decks = [
TestDeck(
name="immiscibleTwoPhase_CapillaryPressure",
description=
'Test 2 fluids can mix based on capillary pressure.',
partitions=((1, 1, 1), ),
restart_step=0,
check_step=68,
restartcheck_params=RestartcheckParameters(**restartcheck_params))
]

generate_geos_tests(decks)
Loading
Loading