diff --git a/BASELINE_NOTES.md b/BASELINE_NOTES.md index 621dd209242..0e45bc823dc 100644 --- a/BASELINE_NOTES.md +++ b/BASELINE_NOTES.md @@ -6,6 +6,10 @@ This file is designed to track changes to the integrated test baselines. Any developer who updates the baseline ID in the .integrated_tests.yaml file is expected to create an entry in this file with the pull request number, date, and their justification for rebaselining. These notes should be in reverse-chronological order, and use the following time format: (YYYY-MM-DD). +PR #3959 (2026-02-03) +===================== +Addition of reference thermal conductivity for thermal single phase + PR #3940 (2026-01-27) ===================== Fix the transimissibility calculated between a cell and a surface element diff --git a/inputFiles/singlePhaseWell/.gitattributes b/inputFiles/singlePhaseWell/.gitattributes new file mode 100644 index 00000000000..507ac808a4f --- /dev/null +++ b/inputFiles/singlePhaseWell/.gitattributes @@ -0,0 +1 @@ +mesh_1d.vtr filter=lfs diff=lfs merge=lfs -text diff --git a/inputFiles/singlePhaseWell/mesh_1d.vtr b/inputFiles/singlePhaseWell/mesh_1d.vtr new file mode 100644 index 00000000000..40f887362ab --- /dev/null +++ b/inputFiles/singlePhaseWell/mesh_1d.vtr @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6df3056da5d3838b0ef835e2d73b56b1623a150b41deb1329c242b4e1a0cc18d +size 2110 diff --git a/inputFiles/singlePhaseWell/singlePhaseWell.ats b/inputFiles/singlePhaseWell/singlePhaseWell.ats index 1f3dd38018f..6f3a9ebb343 100644 --- a/inputFiles/singlePhaseWell/singlePhaseWell.ats +++ b/inputFiles/singlePhaseWell/singlePhaseWell.ats @@ -57,6 +57,13 @@ decks = [ partitions=((1, 1, 1), (2, 2, 2)), restart_step=5, check_step=10, + restartcheck_params=RestartcheckParameters(**restartcheck_params)), + TestDeck( + name="thermal_compressible_single_phase_wells_1d", + description='Thermal well test (1D, thermal, 1 wells)', + partitions=((1, 1, 1),), + restart_step=2, + check_step=0, restartcheck_params=RestartcheckParameters(**restartcheck_params)) ] diff --git a/inputFiles/singlePhaseWell/thermal_compressible_single_phase_wells_1d.xml b/inputFiles/singlePhaseWell/thermal_compressible_single_phase_wells_1d.xml new file mode 100644 index 00000000000..a31832a2072 --- /dev/null +++ b/inputFiles/singlePhaseWell/thermal_compressible_single_phase_wells_1d.xml @@ -0,0 +1,206 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivity.cpp b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivity.cpp index 00d77439387..9ea5afdfbc1 100644 --- a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivity.cpp +++ b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivity.cpp @@ -46,11 +46,25 @@ SinglePhaseThermalConductivity::SinglePhaseThermalConductivity( string const & n setDescription( "The reference temperature at which the conductivity components are equal to the default values" ); } +void SinglePhaseThermalConductivity::allocateConstitutiveData( Group & parent, localIndex const numPts ) +{ + SinglePhaseThermalConductivityBase::allocateConstitutiveData( parent, numPts ); + + initializeState( parent.size()); +} + +void SinglePhaseThermalConductivity::initializeState() const +{ + SinglePhaseThermalConductivityBase::initializeState(); + localIndex const size = m_referenceThermalConductivity.size( 0 ); + initializeState( size ); +} + void SinglePhaseThermalConductivity::initializeRockFluidState( arrayView2d< real64 const > const & initialPorosity ) const { + arrayView3d< real64 const > referenceThermalConductivity = m_referenceThermalConductivity.toViewConst(); arrayView3d< real64 > dEffectiveConductivity_dT = m_dEffectiveConductivity_dT.toView(); arrayView3d< real64 > effectiveConductivity = m_effectiveConductivity.toView(); - R1Tensor const defaultThermalConductivityComponents = m_defaultThermalConductivityComponents; R1Tensor const thermalConductivityGradientComponents = m_thermalConductivityGradientComponents; forAll< parallelDevicePolicy<> >( initialPorosity.size( 0 ), [=] GEOS_HOST_DEVICE ( localIndex const ei ) @@ -58,9 +72,9 @@ void SinglePhaseThermalConductivity::initializeRockFluidState( arrayView2d< real // NOTE: enforcing 1 quadrature point for( localIndex q = 0; q < 1; ++q ) { - effectiveConductivity[ei][q][0] = defaultThermalConductivityComponents[0]; - effectiveConductivity[ei][q][1] = defaultThermalConductivityComponents[1]; - effectiveConductivity[ei][q][2] = defaultThermalConductivityComponents[2]; + effectiveConductivity[ei][q][0] = referenceThermalConductivity[ei][q][0]; + effectiveConductivity[ei][q][1] = referenceThermalConductivity[ei][q][1]; + effectiveConductivity[ei][q][2] = referenceThermalConductivity[ei][q][2]; dEffectiveConductivity_dT[ei][q][0] = thermalConductivityGradientComponents[0]; dEffectiveConductivity_dT[ei][q][1] = thermalConductivityGradientComponents[1]; @@ -71,9 +85,9 @@ void SinglePhaseThermalConductivity::initializeRockFluidState( arrayView2d< real void SinglePhaseThermalConductivity::updateFromTemperature( arrayView1d< real64 const > const & temperature ) const { + arrayView3d< real64 const > referenceThermalConductivity = m_referenceThermalConductivity.toViewConst(); arrayView3d< real64 > dEffectiveConductivity_dT = m_dEffectiveConductivity_dT.toView(); arrayView3d< real64 > effectiveConductivity = m_effectiveConductivity.toView(); - R1Tensor const defaultThermalConductivityComponents = m_defaultThermalConductivityComponents; R1Tensor const thermalConductivityGradientComponents = m_thermalConductivityGradientComponents; real64 const referenceTemperature = m_referenceTemperature; @@ -84,9 +98,9 @@ void SinglePhaseThermalConductivity::updateFromTemperature( arrayView1d< real64 real64 const deltaTemperature = temperature[ei] - referenceTemperature; - effectiveConductivity[ei][q][0] = defaultThermalConductivityComponents[0] + thermalConductivityGradientComponents[0] * deltaTemperature; - effectiveConductivity[ei][q][1] = defaultThermalConductivityComponents[1] + thermalConductivityGradientComponents[1] * deltaTemperature; - effectiveConductivity[ei][q][2] = defaultThermalConductivityComponents[2] + thermalConductivityGradientComponents[2] * deltaTemperature; + effectiveConductivity[ei][q][0] = referenceThermalConductivity[ei][q][0] + thermalConductivityGradientComponents[0] * deltaTemperature; + effectiveConductivity[ei][q][1] = referenceThermalConductivity[ei][q][1] + thermalConductivityGradientComponents[1] * deltaTemperature; + effectiveConductivity[ei][q][2] = referenceThermalConductivity[ei][q][2] + thermalConductivityGradientComponents[2] * deltaTemperature; for( localIndex i=0; i<=2; i++ ) { @@ -114,6 +128,24 @@ void SinglePhaseThermalConductivity::postInputInitialization() } +void SinglePhaseThermalConductivity::initializeState( localIndex const size ) const +{ + integer constexpr numQuad = 1; // NOTE: enforcing 1 quadrature point + + arrayView3d< real64 > referenceThermalConductivity = m_referenceThermalConductivity.toView(); + R1Tensor const defaultThermalConductivityComponents = m_defaultThermalConductivityComponents; + + forAll< parallelDevicePolicy<> >( size, [=] GEOS_HOST_DEVICE ( localIndex const ei ) + { + for( localIndex q = 0; q < numQuad; ++q ) + { + referenceThermalConductivity[ei][q][0] = defaultThermalConductivityComponents[0]; + referenceThermalConductivity[ei][q][1] = defaultThermalConductivityComponents[1]; + referenceThermalConductivity[ei][q][2] = defaultThermalConductivityComponents[2]; + } + } ); +} + REGISTER_CATALOG_ENTRY( ConstitutiveBase, SinglePhaseThermalConductivity, string const &, Group * const ) } // namespace constitutive diff --git a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivity.hpp b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivity.hpp index 2e65c26f48b..81431564f81 100644 --- a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivity.hpp +++ b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivity.hpp @@ -40,9 +40,11 @@ class SinglePhaseThermalConductivityUpdate : public SinglePhaseThermalConductivi * @param effectiveConductivity the array of cell-wise effective conductivities in the subregion * the subregion */ - SinglePhaseThermalConductivityUpdate( arrayView3d< real64 > const & effectiveConductivity, + SinglePhaseThermalConductivityUpdate( arrayView3d< real64 > const & referenceThermalConductivity, + arrayView3d< real64 > const & effectiveConductivity, arrayView3d< real64 > const & dEffectiveConductivity_dT ) - : SinglePhaseThermalConductivityBaseUpdate( effectiveConductivity, + : SinglePhaseThermalConductivityBaseUpdate( referenceThermalConductivity, + effectiveConductivity, dEffectiveConductivity_dT ) {} @@ -72,10 +74,16 @@ class SinglePhaseThermalConductivity : public SinglePhaseThermalConductivityBase virtual string getCatalogName() const override { return catalogName(); } + virtual void allocateConstitutiveData( Group & parent, localIndex const numPts ) override; + virtual void initializeRockFluidState( arrayView2d< real64 const > const & initialPorosity ) const override final; virtual void updateFromTemperature( arrayView1d< real64 const > const & temperature ) const override final; + virtual void initializeState() const override; + + void initializeState( localIndex const size ) const; + /// Type of kernel wrapper for in-kernel update using KernelWrapper = SinglePhaseThermalConductivityUpdate; @@ -85,7 +93,8 @@ class SinglePhaseThermalConductivity : public SinglePhaseThermalConductivityBase */ KernelWrapper createKernelWrapper() const { - return KernelWrapper( m_effectiveConductivity, + return KernelWrapper( m_referenceThermalConductivity, + m_effectiveConductivity, m_dEffectiveConductivity_dT ); } diff --git a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.cpp b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.cpp index 240a3792df4..82dd3f86aee 100644 --- a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.cpp +++ b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.cpp @@ -31,6 +31,7 @@ namespace constitutive SinglePhaseThermalConductivityBase::SinglePhaseThermalConductivityBase( string const & name, Group * const parent ) : ConstitutiveBase( name, parent ) { + registerField< fields::thermalconductivity::referenceThermalConductivity >( &m_referenceThermalConductivity ); registerField< fields::thermalconductivity::effectiveConductivity >( &m_effectiveConductivity ); registerField< fields::thermalconductivity::dEffectiveConductivity_dT >( &m_dEffectiveConductivity_dT ); } @@ -38,12 +39,16 @@ SinglePhaseThermalConductivityBase::SinglePhaseThermalConductivityBase( string c void SinglePhaseThermalConductivityBase::allocateConstitutiveData( Group & parent, localIndex const numPts ) { // NOTE: enforcing 1 quadrature point + m_referenceThermalConductivity.resize( 0, 1, 3 ); m_effectiveConductivity.resize( 0, 1, 3 ); m_dEffectiveConductivity_dT.resize( 0, 1, 3 ); ConstitutiveBase::allocateConstitutiveData( parent, numPts ); } +void SinglePhaseThermalConductivityBase::initializeState() const +{} + } // namespace constitutive } // namespace geos diff --git a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.hpp b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.hpp index 09444cd7e06..4a8dd518986 100644 --- a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.hpp +++ b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.hpp @@ -57,12 +57,17 @@ class SinglePhaseThermalConductivityBaseUpdate * @brief Constructor for the class performing the thermal conductivity updates * @param effectiveConductivity the array of cell-wise effective conductivities in the subregion */ - SinglePhaseThermalConductivityBaseUpdate( arrayView3d< real64 > const & effectiveConductivity, + SinglePhaseThermalConductivityBaseUpdate( arrayView3d< real64 > const & referenceThermalConductivity, + arrayView3d< real64 > const & effectiveConductivity, arrayView3d< real64 > const & dEffectiveConductivity_dT ) - : m_effectiveConductivity( effectiveConductivity ), + : m_referenceThermalConductivity( referenceThermalConductivity ), + m_effectiveConductivity( effectiveConductivity ), m_dEffectiveConductivity_dT( dEffectiveConductivity_dT ) {} + /// View on the cell-wise reference conductivities + arrayView3d< real64 > m_referenceThermalConductivity; + /// View on the cell-wise effective conductivities arrayView3d< real64 > m_effectiveConductivity; @@ -145,8 +150,16 @@ class SinglePhaseThermalConductivityBase : public ConstitutiveBase */ arrayView3d< real64 const > dEffectiveConductivity_dT() const { return m_dEffectiveConductivity_dT; } + /** + * @brief Initialize the thermal conductivity state + */ + virtual void initializeState() const; + protected: + /// cell-wise reference conductivities in the subregion + array3d< real64 > m_referenceThermalConductivity; + /// cell-wise effective conductivities in the subregion array3d< real64 > m_effectiveConductivity; diff --git a/src/coreComponents/constitutive/thermalConductivity/ThermalConductivityFields.hpp b/src/coreComponents/constitutive/thermalConductivity/ThermalConductivityFields.hpp index a04c1a2bffc..35302d1e321 100644 --- a/src/coreComponents/constitutive/thermalConductivity/ThermalConductivityFields.hpp +++ b/src/coreComponents/constitutive/thermalConductivity/ThermalConductivityFields.hpp @@ -48,6 +48,14 @@ DECLARE_FIELD( dEffectiveConductivity_dT, WRITE_AND_READ, "Derivative of effective conductivity w.r.t. temperature" ); +DECLARE_FIELD( referenceThermalConductivity, + "referenceThermalConductivity", + array3d< real64 >, + 0, + LEVEL_0, + WRITE_AND_READ, + "Reference thermal conductivity" ); + DECLARE_FIELD( rockThermalConductivity, "rockThermalConductivity", array3d< real64 >, diff --git a/src/coreComponents/physicsSolvers/surfaceGeneration/EmbeddedSurfaceGenerator.cpp b/src/coreComponents/physicsSolvers/surfaceGeneration/EmbeddedSurfaceGenerator.cpp index 4af9efde608..6e5fed08e4f 100644 --- a/src/coreComponents/physicsSolvers/surfaceGeneration/EmbeddedSurfaceGenerator.cpp +++ b/src/coreComponents/physicsSolvers/surfaceGeneration/EmbeddedSurfaceGenerator.cpp @@ -28,6 +28,7 @@ #include "mesh/MeshFields.hpp" #include "mesh/utilities/ComputationalGeometry.hpp" #include "mesh/utilities/CIcomputationKernel.hpp" +#include "constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.hpp" #include "physicsSolvers/solidMechanics/kernels/SolidMechanicsLagrangianFEMKernels.hpp" #include "mesh/simpleGeometricObjects/GeometricObjectManager.hpp" #include "mesh/simpleGeometricObjects/Rectangle.hpp" @@ -283,6 +284,14 @@ real64 EmbeddedSurfaceGenerator::solverStep( real64 const & GEOS_UNUSED_PARAM( t gravityCoef[ ei ] = LvArray::tensorOps::AiBi< 3 >( elemCenter[ ei ], gravVector ); } ); } + + string const thermalCondModelName = getConstitutiveName< SinglePhaseThermalConductivityBase >( fractureSubRegion ); + if( !thermalCondModelName.empty() ) + { + // if a thermal conductivity model exists we need to set the intial value to something meaningful + SinglePhaseThermalConductivityBase & thermalCondModel = getConstitutiveModel< SinglePhaseThermalConductivityBase >( fractureSubRegion, thermalCondModelName ); + thermalCondModel.initializeState(); + } } ); return rval; diff --git a/src/coreComponents/physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp b/src/coreComponents/physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp index 76a9fd032c4..0c723c53bf3 100644 --- a/src/coreComponents/physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp +++ b/src/coreComponents/physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp @@ -28,6 +28,7 @@ #include "finiteVolume/FluxApproximationBase.hpp" #include "mesh/SurfaceElementRegion.hpp" #include "mesh/utilities/ComputationalGeometry.hpp" +#include "constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.hpp" #include "physicsSolvers/solidMechanics/SolidMechanicsFields.hpp" #include "physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.hpp" #include "physicsSolvers/solidMechanics/kernels/SolidMechanicsLagrangianFEMKernels.hpp" @@ -552,6 +553,14 @@ real64 SurfaceGenerator::solverStep( real64 const & time_n, PermeabilityBase & permModel = getConstitutiveModel< PermeabilityBase >( fractureSubRegion, permModelName ); permModel.initializeState(); } + + string const thermalCondModelName = getConstitutiveName< SinglePhaseThermalConductivityBase >( fractureSubRegion ); + if( !thermalCondModelName.empty() ) + { + // if a thermal conductivity model exists we need to set the intial value to something meaningful + SinglePhaseThermalConductivityBase & thermalCondModel = getConstitutiveModel< SinglePhaseThermalConductivityBase >( fractureSubRegion, thermalCondModelName ); + thermalCondModel.initializeState(); + } } ); return rval; diff --git a/src/coreComponents/schema/schema.xsd.other b/src/coreComponents/schema/schema.xsd.other index e77cc9d197a..1e2c85101fd 100644 --- a/src/coreComponents/schema/schema.xsd.other +++ b/src/coreComponents/schema/schema.xsd.other @@ -3215,6 +3215,8 @@ A field can represent a physical variable. (pressure, temperature, global compos + +