Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
abfd5fe
Initial commit
Nov 4, 2020
e747d60
thermalKernels
CusiniM Nov 6, 2020
74010fa
Assembly up to accumulation is done.
CusiniM Dec 17, 2020
35b57b2
Merge branch 'develop' into feature/addEnergyBalance
CusiniM Dec 17, 2020
4818635
Added all views. Modified input for FluxKernels.
CusiniM Dec 18, 2020
fe9f916
done kernels and solver.
CusiniM Dec 19, 2020
e68e82a
FluidModels: added enthalpy and internalEnergy
CusiniM Dec 19, 2020
b26299e
Enthalpy and Internal energy functions
CusiniM Dec 21, 2020
e664d8f
dummy functions and derivatives for enthalpy and internalEnergy.
CusiniM Dec 21, 2020
f673df4
fixed comp errors for const. model.
CusiniM Dec 22, 2020
104e987
Fixed some errors.
CusiniM Dec 22, 2020
2d4d860
missing only intEnergy for solid material.
CusiniM Dec 23, 2020
7529364
down to 1 linking error.
CusiniM Dec 24, 2020
86d6599
Finally builds.
CusiniM Dec 26, 2020
c845d52
bug fix.
CusiniM Dec 28, 2020
97c6daa
xml file
CusiniM Dec 28, 2020
fcc4890
added CO2 and brine enthalpy functions
yue-2018 Jan 12, 2021
8ab80ab
Merge remote-tracking branch 'upstream/develop' into feature/addEnerg…
CusiniM Jan 13, 2021
9781d2a
Merge remote-tracking branch 'upstream/develop' into feature/addEnerg…
CusiniM Feb 22, 2021
e259158
Post merge fixes. Mainly fixing the strings.
CusiniM Feb 23, 2021
afafbe6
Merge branch 'develop' into feature/addEnergyBalance
francoishamon Oct 13, 2021
628cdd0
removed old files not compiled
francoishamon Oct 14, 2021
74c66cd
additional fix
francoishamon Oct 14, 2021
c833866
Merge branch 'develop' into feature/addEnergyBalance
francoishamon Oct 16, 2021
e518cb6
Merge branch 'develop' into feature/addEnergyBalance
francoishamon Oct 25, 2021
9289225
Merge branch 'develop' into feature/addEnergyBalance
francoishamon Dec 1, 2021
6af1845
added thermal accumulation and volume balance in the new style
francoishamon Dec 2, 2021
f5e969a
Merge branch 'develop' into feature/addEnergyBalance
francoishamon Dec 23, 2021
581a125
Merge branch 'develop' into feature/addEnergyBalance
francoishamon Dec 23, 2021
1514ba7
Merge branch 'develop' into feature/addEnergyBalance
francoishamon Jan 8, 2022
59b5959
implemented thermal flux kernel in the new style
francoishamon Jan 10, 2022
d33a78f
some cleanup in the kernels
francoishamon Jan 10, 2022
68cddc0
Merge branch 'develop' into feature/addEnergyBalance
francoishamon Jan 26, 2022
faeb418
added conduction term
francoishamon Jan 26, 2022
0749d24
Merge branch 'develop' into feature/addEnergyBalance
francoishamon Jan 31, 2022
ee8e38e
Merge branch 'develop' into feature/addEnergyBalance
francoishamon Feb 26, 2022
01b2478
implemented temperature BC
francoishamon Feb 27, 2022
2e694fd
removed unused variable
francoishamon Feb 28, 2022
d609aff
various fixes
francoishamon Mar 2, 2022
d263562
Merge branch 'develop' into feature/addEnergyBalance
francoishamon Mar 2, 2022
f0d3e9a
first working version
francoishamon Mar 3, 2022
c697f85
added integrated test; made ready for review
francoishamon Mar 6, 2022
b719ba8
Merge branch 'develop' into feature/addEnergyBalance
francoishamon Mar 7, 2022
3481c7f
passing unit test for thermal compositional
francoishamon Mar 10, 2022
320f685
start addressing Matteo's comments
francoishamon Mar 10, 2022
ab98b35
Merge branch 'develop' into feature/addEnergyBalance
francoishamon Mar 16, 2022
f2d59f9
Merge branch 'develop' into feature/addEnergyBalance
francoishamon Mar 17, 2022
444cbfa
Merge branch 'develop' into feature/addEnergyBalance
francoishamon Mar 18, 2022
d5ce276
passing all integrated tests
francoishamon Mar 19, 2022
2edbe72
Merge branch 'develop' into feature/addEnergyBalance
francoishamon Mar 25, 2022
e15a028
Merge branch 'develop' into feature/addEnergyBalance
francoishamon Mar 30, 2022
ba77f5b
removed enum string in CO2-brine fluid
francoishamon Mar 30, 2022
90d4dcc
Merge branch 'develop' into feature/addEnergyBalance
francoishamon Apr 8, 2022
7abf516
addressed Sergey's comments
francoishamon Apr 9, 2022
6a49e3f
Merge branch 'develop' into feature/addEnergyBalance
francoishamon Apr 10, 2022
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
223 changes: 223 additions & 0 deletions inputFiles/thermalMultiphaseFlow/co2_thermal_2d.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
<?xml version="1.0" ?>

<Problem>
<Solvers>
<CompositionalMultiphaseFVM
name="compflow"
logLevel="1"
discretization="fluidTPFA"
temperature="368.15"
useMass="1"
isThermal="1"
initialDt="1e3"
maxCompFractionChange="0.5"
targetRegions="{ region }">
<NonlinearSolverParameters
newtonTol="1.0e-6"
newtonMaxIter="100"
lineSearchAction="None"
maxTimeStepCuts="5"/>
<LinearSolverParameters
directParallel="0"/>
</CompositionalMultiphaseFVM>
</Solvers>

<Mesh>
<InternalMesh
name="mesh1"
elementTypes="{ C3D8 }"
xCoords="{ 0, 100 }"
yCoords="{ 0, 100 }"
zCoords="{ 0, 1 }"
nx="{ 10 }"
ny="{ 10 }"
nz="{ 1 }"
cellBlockNames="{ cb }"/>
</Mesh>

<Geometry>
<Box
name="sink"
xMin="{ 89.99, 89.99, -0.01 }"
xMax="{ 101.01, 101.01, 1.01 }"/>

<Box
name="source"
xMin="{ -0.01, -0.01, -0.01 }"
xMax="{ 10.01, 10.01, 1.01 }"/>
</Geometry>

<Events
maxTime="1.5e5">
<PeriodicEvent
name="outputs"
timeFrequency="2.5e4"
target="/Outputs/vtkOutput"/>

<PeriodicEvent
name="solverApplications"
maxEventDt="2.5e4"
target="/Solvers/compflow"/>

<PeriodicEvent
name="restarts"
timeFrequency="7.5e4"
target="/Outputs/sidreRestart"/>
</Events>

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

<ElementRegions>
<CellElementRegion
name="region"
cellBlocks="{ cb }"
materialList="{ fluid, rock, relperm, thermalCond }"/>
</ElementRegions>

<Constitutive>

<CompressibleSolidConstantPermeability
name="rock"
solidModelName="nullSolid"
porosityModelName="rockPorosity"
permeabilityModelName="rockPerm"
solidInternalEnergyModelName="rockInternalEnergy"/>
<NullModel
name="nullSolid"/>
<PressurePorosity
name="rockPorosity"
defaultReferencePorosity="0.2"
referencePressure="0.0"
compressibility="1.0e-9"/>
<SolidInternalEnergy
name="rockInternalEnergy"
volumetricHeatCapacity="1.95e6"
referenceTemperature="368.15"
referenceInternalEnergy="0"/>
<ConstantPermeability
name="rockPerm"
permeabilityComponents="{ 1.0e-13, 1.0e-13, 1.0e-13 }"/>

<CO2BrinePhillipsThermalFluid
name="fluid"
phaseNames="{ gas, water }"
componentNames="{ co2, water }"
componentMolarWeight="{ 44e-3, 18e-3 }"
phasePVTParaFiles="{ pvtgas.txt, pvtliquid.txt }"
flashModelParaFile="co2flash.txt"/>

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

<ConstantThermalConductivity
name="thermalCond"
phaseNames="{ gas, water }"
thermalConductivityComponents="{ 0.6, 0.6, 0.6 }"/>

</Constitutive>

<FieldSpecifications>

<FieldSpecification
name="initialPressure"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions/region/cb"
fieldName="pressure"
scale="9e6"/>
<FieldSpecification
name="initialTemperature"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions/region/cb"
fieldName="temperature"
scale="368.15"/>
<FieldSpecification
name="initialComposition_co2"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions/region/cb"
fieldName="globalCompFraction"
component="0"
scale="0.005"/>
<FieldSpecification
name="initialComposition_water"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions/region/cb"
fieldName="globalCompFraction"
component="1"
scale="0.995"/>

<FieldSpecification
name="sinkPressure"
setNames="{ sink }"
objectPath="ElementRegions/region/cb"
fieldName="pressure"
scale="7e6"/>
<FieldSpecification
name="sinkTemperature"
setNames="{ sink }"
objectPath="ElementRegions/region/cb"
fieldName="temperature"
scale="368.15"/>
<FieldSpecification
name="sinkTermComposition_co2"
setNames="{ sink }"
objectPath="ElementRegions/region/cb"
fieldName="globalCompFraction"
component="0"
scale="0.005"/>
<FieldSpecification
name="sinkTermComposition_water"
setNames="{ sink }"
objectPath="ElementRegions/region/cb"
fieldName="globalCompFraction"
component="1"
scale="0.995"/>

<FieldSpecification
name="sourcePressure"
setNames="{ source }"
objectPath="ElementRegions/region/cb"
fieldName="pressure"
scale="1.45e7"/>
<FieldSpecification
name="sourceTemperature"
setNames="{ source }"
objectPath="ElementRegions/region/cb"
fieldName="temperature"
scale="300.15"/>
<FieldSpecification
name="sourceTermComposition_co2"
setNames="{ source }"
objectPath="ElementRegions/region/cb"
fieldName="globalCompFraction"
component="0"
scale="0.995"/>
<FieldSpecification
name="sourceTermComposition_water"
setNames="{ source }"
objectPath="ElementRegions/region/cb"
fieldName="globalCompFraction"
component="1"
scale="0.005"/>
</FieldSpecifications>

<Outputs>
<VTK
name="vtkOutput"/>

<Restart
name="sidreRestart"/>
</Outputs>
</Problem>
1 change: 1 addition & 0 deletions inputFiles/thermalMultiphaseFlow/co2flash.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FlashModel CO2Solubility 1e6 7.5e7 5e5 299.15 369.15 10 0
3 changes: 3 additions & 0 deletions inputFiles/thermalMultiphaseFlow/pvtgas.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DensityFun SpanWagnerCO2Density 1e6 7.5e7 5e5 299.15 369.15 10
ViscosityFun FenghourCO2Viscosity 1e6 7.5e7 5e5 299.15 369.15 10
EnthalpyFun CO2Enthalpy 1e6 7.5e7 5e5 299.15 369.15 10
3 changes: 3 additions & 0 deletions inputFiles/thermalMultiphaseFlow/pvtliquid.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DensityFun PhillipsBrineDensity 1e6 7.5e7 5e5 299.15 369.15 10 0
ViscosityFun PhillipsBrineViscosity 0
EnthalpyFun BrineEnthalpy 1e6 7.5e7 5e5 299.15 369.15 10 0
2 changes: 1 addition & 1 deletion integratedTests
6 changes: 3 additions & 3 deletions src/coreComponents/constitutive/fluid/CO2BrineFluid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ void CO2BrineFluid< PHASE1, PHASE2, FLASH >::createPVTModels()
{
string_array const strs = stringutilities::tokenize( str, " " );

if( strs[0] == toString( SubModelInputNames::DENSITY ) )
if( strs[0] == "DensityFun" )
{
if( strs[1] == PHASE1::Density::catalogName() )
{
Expand All @@ -196,7 +196,7 @@ void CO2BrineFluid< PHASE1, PHASE2, FLASH >::createPVTModels()
phase2InputParams[PHASE2::InputParamOrder::DENSITY] = strs;
}
}
else if( strs[0] == toString( SubModelInputNames::VISCOSITY ) )
else if( strs[0] == "ViscosityFun" )
{
if( strs[1] == PHASE1::Viscosity::catalogName() )
{
Expand All @@ -207,7 +207,7 @@ void CO2BrineFluid< PHASE1, PHASE2, FLASH >::createPVTModels()
phase2InputParams[PHASE2::InputParamOrder::VISCOSITY] = strs;
}
}
else if( strs[0] == toString( SubModelInputNames::ENTHALPY ) )
else if( strs[0] == "EnthalpyFun" )
{
if( strs[1] == PHASE1::Enthalpy::catalogName() )
{
Expand Down
19 changes: 0 additions & 19 deletions src/coreComponents/constitutive/fluid/CO2BrineFluid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -569,25 +569,6 @@ CO2BrineFluid< PHASE1, PHASE2, FLASH >::KernelWrapper::
m_totalDensity( k, q ) );
}

/// Declare strings associated with enumeration values
/// Needed for now, because we don't use the catalogNames for input (yet)
ENUM_STRINGS( CO2BrinePhillipsFluid::SubModelInputNames,
"DensityFun",
"ViscosityFun",
"EnthalpyFun" );
ENUM_STRINGS( CO2BrinePhillipsThermalFluid::SubModelInputNames,
"DensityFun",
"ViscosityFun",
"EnthalpyFun" );
ENUM_STRINGS( CO2BrineEzrokhiFluid::SubModelInputNames,
"DensityFun",
"ViscosityFun",
"EnthalpyFun" );
ENUM_STRINGS( CO2BrineEzrokhiThermalFluid::SubModelInputNames,
"DensityFun",
"ViscosityFun",
"EnthalpyFun" );


} // namespace constitutive

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ EXTRINSIC_MESH_DATA_TRAIT( dPhaseInternalEnergy,
0,
NOPLOT,
NO_WRITE,
"Derivative of phase internal energy with respect to pressure, temperature, and global component fraction" );
"Derivative of phase internal energy with respect to pressure, temperature, and global component fractions" );

EXTRINSIC_MESH_DATA_TRAIT( phaseCompFraction,
"phaseCompFraction",
Expand Down
10 changes: 8 additions & 2 deletions src/coreComponents/constitutive/fluid/multiFluidSelector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ void constitutiveUpdatePassThru( MultiFluidBase const & fluid,
CompositionalMultiphaseFluid,
#endif
CO2BrinePhillipsFluid,
CO2BrineEzrokhiFluid >::execute( fluid, std::forward< LAMBDA >( lambda ) );
CO2BrineEzrokhiFluid,
CO2BrinePhillipsThermalFluid /*, // if I uncomment the two models at the same time, the compiler segfaults on
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this still happening?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I really don't understand what is going on there:

  • If I add only CO2BrinePhillipsThermalFluid, the code compiles and works
  • If I add only CO2BrineEzrokhiThermalFluid, the code compiles and works
  • If I add both, I get the following error:
[ 61%] Building CUDA object coreComponents/physicsSolvers/CMakeFiles/physicsSolvers.dir/fluidFlow/CompositionalMultiphaseBase.cpp.o                                                      
[ 63%] Building CUDA object coreComponents/physicsSolvers/CMakeFiles/physicsSolvers.dir/fluidFlow/wells/CompositionalMultiphaseWell.cpp.o                                                
[ 63%] Building CUDA object coreComponents/constitutive/CMakeFiles/constitutive.dir/fluid/PVTDriver.cpp.o                                                                                
[ 88%] Built target constitutive                                                                                                                                                         
nvcc error   : 'ptxas' died due to signal 11 (Invalid memory reference)                                                                                                                  
make[3]: *** [coreComponents/physicsSolvers/CMakeFiles/physicsSolvers.dir/build.make:115: coreComponents/physicsSolvers/CMakeFiles/physicsSolvers.dir/fluidFlow/CompositionalMultiphaseBase.cpp.o] Error 11 

This is not a blocking problem for me, but I don't understand why it does not compile with the two models activated.

Lassen!
CO2BrineEzrokhiThermalFluid*/>::execute( fluid, std::forward< LAMBDA >( lambda ) );
}

template< typename LAMBDA >
Expand All @@ -57,7 +60,10 @@ void constitutiveUpdatePassThru( MultiFluidBase & fluid,
CompositionalMultiphaseFluid,
#endif
CO2BrinePhillipsFluid,
CO2BrineEzrokhiFluid >::execute( fluid, std::forward< LAMBDA >( lambda ) );
CO2BrineEzrokhiFluid,
CO2BrinePhillipsThermalFluid /*, // if I uncomment the two models at the same time, the compiler segfaults on
Lassen!
CO2BrineEzrokhiThermalFluid*/>::execute( fluid, std::forward< LAMBDA >( lambda ) );
}

} // namespace constitutive
Expand Down
28 changes: 15 additions & 13 deletions src/coreComponents/constitutive/solid/SolidInternalEnergy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,34 +30,34 @@ SolidInternalEnergy::SolidInternalEnergy( string const & name, Group * const par
ConstitutiveBase( name, parent ),
m_internalEnergy(),
m_dInternalEnergy_dTemperature(),
m_specificHeatCapacity(),
m_volumetricHeatCapacity(),
m_referenceTemperature(),
m_referenceInternalEnergy()
{
registerWrapper( viewKeyStruct::internalEnergyString(), &m_internalEnergy ).
setPlotLevel( PlotLevel::LEVEL_0 ).
setApplyDefaultValue( 0.0 ).
setDescription( "Internal energy of the solid" );
setDescription( "Internal energy of the solid per unit volume [J/m^3]" );

registerWrapper( viewKeyStruct::oldInternalEnergyString(), &m_oldInternalEnergy ).
setApplyDefaultValue( 0.0 ).
setDescription( "Internal energy of the solid at the previous time-step" );
setDescription( "Internal energy of the solid per unit volume at the previous time-step [J/m^3]" );

registerWrapper( viewKeyStruct::dInternalEnergy_dTemperatureString(), &m_dInternalEnergy_dTemperature ).
setApplyDefaultValue( 0.0 ).
setDescription( "Derivative of the solid internal energy w.r.t. temperature" );
setDescription( "Derivative of the solid internal energy w.r.t. temperature [J/(m^3.K)]" );

registerWrapper( viewKeyStruct::specificHeatCapacityString(), &m_specificHeatCapacity ).
setApplyDefaultValue( 0.0 ).
setDescription( "Solid specific heat capacity" );
registerWrapper( viewKeyStruct::volumetricHeatCapacityString(), &m_volumetricHeatCapacity ).
setInputFlag( InputFlags::REQUIRED ).
setDescription( "Solid volumetric heat capacity [J/(kg.K)]" );

registerWrapper( viewKeyStruct::referenceTemperatureString(), &m_referenceTemperature ).
setApplyDefaultValue( 0.0 ).
setDescription( "Reference temperature" );
setInputFlag( InputFlags::REQUIRED ).
setDescription( "Reference temperature [K]" );

registerWrapper( viewKeyStruct::referenceInternalEnergyString(), &m_referenceInternalEnergy ).
setApplyDefaultValue( 0.0 ).
setDescription( "Internal energy at the reference temperature" );
setInputFlag( InputFlags::REQUIRED ).
setDescription( "Internal energy at the reference temperature [J/kg]" );
}

void SolidInternalEnergy::allocateConstitutiveData( Group & parent,
Expand All @@ -81,6 +81,8 @@ void SolidInternalEnergy::saveConvergedState() const
} );
}

}
REGISTER_CATALOG_ENTRY( ConstitutiveBase, SolidInternalEnergy, string const &, Group * const )

}
} /* namespace constitutive */

} /* namespace geosx */
Loading