diff --git a/.integrated_tests.yaml b/.integrated_tests.yaml index b262b6aa27b..a21eed60480 100644 --- a/.integrated_tests.yaml +++ b/.integrated_tests.yaml @@ -1,6 +1,6 @@ baselines: bucket: geosx - baseline: integratedTests/baseline_integratedTests-pr4021-16339-bb862da + baseline: integratedTests/baseline_integratedTests-pr3959-16478-faf1698 allow_fail: all: '' diff --git a/BASELINE_NOTES.md b/BASELINE_NOTES.md index e1c07a01361..05c25880f29 100644 --- a/BASELINE_NOTES.md +++ b/BASELINE_NOTES.md @@ -5,12 +5,14 @@ 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-05-04) +Add reference thermal conductivity + PR #4021 (2026-04-14) ===================== Add Young Modulus & Poisson import from VTK mesh PR #3883 (2026-04-10) -===================== Move PVT Driver tests from unit tests to integrated tests PR #4007 (2026-04-03) diff --git a/inputFiles/singlePhaseFlow/.gitattributes b/inputFiles/singlePhaseFlow/.gitattributes new file mode 100644 index 00000000000..507ac808a4f --- /dev/null +++ b/inputFiles/singlePhaseFlow/.gitattributes @@ -0,0 +1 @@ +mesh_1d.vtr filter=lfs diff=lfs merge=lfs -text diff --git a/inputFiles/singlePhaseFlow/mesh_1d.vtr b/inputFiles/singlePhaseFlow/mesh_1d.vtr new file mode 100644 index 00000000000..40f887362ab --- /dev/null +++ b/inputFiles/singlePhaseFlow/mesh_1d.vtr @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6df3056da5d3838b0ef835e2d73b56b1623a150b41deb1329c242b4e1a0cc18d +size 2110 diff --git a/inputFiles/singlePhaseFlow/thermalCompressible_referenceConductivity.xml b/inputFiles/singlePhaseFlow/thermalCompressible_referenceConductivity.xml new file mode 100644 index 00000000000..19c80f5194c --- /dev/null +++ b/inputFiles/singlePhaseFlow/thermalCompressible_referenceConductivity.xml @@ -0,0 +1,182 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inputFiles/singlePhaseFlow/thermalSinglePhaseFlow.ats b/inputFiles/singlePhaseFlow/thermalSinglePhaseFlow.ats index b47f93c6527..84830049dc3 100644 --- a/inputFiles/singlePhaseFlow/thermalSinglePhaseFlow.ats +++ b/inputFiles/singlePhaseFlow/thermalSinglePhaseFlow.ats @@ -45,6 +45,13 @@ decks = [ restart_step=0, check_step=1, restartcheck_params=RestartcheckParameters(**restartcheck_params)), + TestDeck( + name="thermalCompressible_referenceConductivity", + description='Thermal reference conductivity (1D, thermal)', + partitions=((1, 1, 1),), + restart_step=6, + check_step=10, + restartcheck_params=RestartcheckParameters(**restartcheck_params)) ] generate_geos_tests(decks) diff --git a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivity.cpp b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivity.cpp index 85c990f83ea..84cfc3126b3 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++ ) { @@ -113,6 +127,30 @@ 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; + + real64 constexpr threshold = LvArray::NumericLimits< real64 >::epsilon; + + forAll< parallelDevicePolicy<> >( size, [=] GEOS_HOST_DEVICE ( localIndex const ei ) + { + for( localIndex q = 0; q < numQuad; ++q ) + { + for( integer dim=0; dim < 3; ++dim ) + { + if( referenceThermalConductivity[ei][q][dim] < threshold ) + { + referenceThermalConductivity[ei][q][dim] = defaultThermalConductivityComponents[dim]; + } + } + } + } ); +} + 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..ef599ce59c2 100644 --- a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.hpp +++ b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.hpp @@ -55,14 +55,21 @@ class SinglePhaseThermalConductivityBaseUpdate /** * @brief Constructor for the class performing the thermal conductivity updates + * @param referenceThermalConductivity the array of cell-wise reference conductivities in the subregion * @param effectiveConductivity the array of cell-wise effective conductivities in the subregion + * @param dEffectiveConductivity_dT the array of cell-wise derivatives of the effective conductivities w.r.t. temperature 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 +152,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..d96124bf8c6 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 initial 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 2da482cf3ea..8e02b388405 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" @@ -574,6 +575,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 c7434b7b99c..5bcdf600de2 100644 --- a/src/coreComponents/schema/schema.xsd.other +++ b/src/coreComponents/schema/schema.xsd.other @@ -3264,6 +3264,8 @@ A field can represent a physical variable. (pressure, temperature, global compos + +