diff --git a/.integrated_tests.yaml b/.integrated_tests.yaml index b262b6aa27b..a316f39a21a 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-pr4029-16484-a4227f0 allow_fail: all: '' diff --git a/BASELINE_NOTES.md b/BASELINE_NOTES.md index e1c07a01361..ae00ff42212 100644 --- a/BASELINE_NOTES.md +++ b/BASELINE_NOTES.md @@ -5,6 +5,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 #4029 (2026-05-04) +===================== +Add single phase viscosity dependency on temperature + PR #4021 (2026-04-14) ===================== Add Young Modulus & Poisson import from VTK mesh diff --git a/inputFiles/singlePhaseFlow/thermalSinglePhaseFlow.ats b/inputFiles/singlePhaseFlow/thermalSinglePhaseFlow.ats index b47f93c6527..fe69112725f 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="thermalViscosity_1d", + description='Thermal problem with temperature dependent viscosity', + partitions=((1, 1, 1),), + restart_step=0, + check_step=1, + restartcheck_params=RestartcheckParameters(**restartcheck_params)), ] generate_geos_tests(decks) diff --git a/inputFiles/singlePhaseFlow/thermalViscosity_1d.xml b/inputFiles/singlePhaseFlow/thermalViscosity_1d.xml new file mode 100644 index 00000000000..fd24ed980ba --- /dev/null +++ b/inputFiles/singlePhaseFlow/thermalViscosity_1d.xml @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/coreComponents/constitutive/docs/CompressibleSinglePhaseFluid.rst b/src/coreComponents/constitutive/docs/CompressibleSinglePhaseFluid.rst index 1781ed99222..2b8b4e3d0fd 100644 --- a/src/coreComponents/constitutive/docs/CompressibleSinglePhaseFluid.rst +++ b/src/coreComponents/constitutive/docs/CompressibleSinglePhaseFluid.rst @@ -9,31 +9,46 @@ Overview This model represents a compressible single-phase fluid with constant compressibility and pressure-dependent viscosity. +For thermal simulations, fluid density and viscosity are temperature-dependent, governed by a constant thermal +expansion coefficient and a constant temperature-viscosity coefficient, respectively. These assumptions are valid for slightly compressible fluids, such as water, and some types of oil with negligible amounts of dissolved gas. Specifically, fluid density is computed as .. math:: - \rho(p) = \rho_0 ( e^{c_\rho(p - p_0)} + e^{\beta_f (T - T_0)} ) + \rho(p) = \rho_0 e^{c_\rho(p - p_0)} -where :math:`c_\rho` is compressibility, :math:`p_0` is reference pressure, :math:`\rho_0` is -density at reference pressure, :math:`\beta_f` is the fluid thermal expansion coefficient, :math:`T_0` is reference temperature. +for isothermal cases and, + +.. math:: + \rho(p,T) = \rho_0 e^{c_\rho(p - p_0)} e^{-\beta_\rho (T - T_0)} + +for thermal cases. + +where :math:`c_\rho` is compressibility, :math:`p_0` is reference pressure, :math:`\rho_0` is the +density at the reference pressure, :math:`\beta_\rho` is the fluid thermal expansion coefficient, +:math:`T_0` is reference temperature. Similarly, .. math:: \mu(p) = \mu_0 e^{c_\mu(p - p_0)} -where :math:`c_\mu` is viscosibility (viscosity compressibility), :math:`\mu_0` is reference viscosity. +for isothermal cases and, -Either exponent may be approximated by linear (default) or quadratic terms of Taylor series expansion. -Currently there is no temperature dependence in the model, although it may be added in future. +.. math:: + \mu(p,T) = \mu_0 e^{c_\mu(p - p_0)} e^{-\beta_\mu (T - T_0)} + +for thermal cases. + +where :math:`c_\mu` is viscosibility (viscosity compressibility), :math:`\mu_0` is reference viscosity, +:math:`\beta_\rho` is the fluid viscosity thermal coefficient. Parameters ========================= -The model is represented by ```` node in the input. +For the isothermal case, the model is represented by ```` node in the input. The following attributes are supported: @@ -51,4 +66,29 @@ Example compressibility="1e-19" referenceViscosity="0.001" viscosibility="0.0"/> - \ No newline at end of file + + +For the thermal case, the model is represented by ```` node in the input. + +The following attributes are supported: + +.. include:: /docs/sphinx/datastructure/ThermalCompressibleSinglePhaseFluid.rst + +Example +========================= + +.. code-block:: xml + + + + diff --git a/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.cpp b/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.cpp index e52ab6a878e..d8a6e2c16d4 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.cpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.cpp @@ -32,12 +32,18 @@ namespace constitutive ThermalCompressibleSinglePhaseFluid::ThermalCompressibleSinglePhaseFluid( string const & name, Group * const parent ): CompressibleSinglePhaseFluid( name, parent ) { - m_numDOF=2; + m_numDOF = 2; + registerWrapper( viewKeyStruct::thermalExpansionCoeffString(), &m_thermalExpansionCoeff ). setApplyDefaultValue( 0.0 ). setInputFlag( InputFlags::OPTIONAL ). setDescription( "Fluid thermal expansion coefficient. Unit: 1/K" ); + registerWrapper( viewKeyStruct::temperatureViscosityCoefficient(), &m_temperatureViscosityCoefficient ). + setApplyDefaultValue( 0.0 ). + setInputFlag( InputFlags::OPTIONAL ). + setDescription( "Fluid viscosity thermal expansion coefficient at the reference temperature. Unit: 1/K" ); + registerWrapper( viewKeyStruct::specificHeatCapacityString(), &m_specificHeatCapacity ). setApplyDefaultValue( 0.0 ). setInputFlag( InputFlags::OPTIONAL ). @@ -80,6 +86,7 @@ void ThermalCompressibleSinglePhaseFluid::postInputInitialization() }; checkNonnegative( m_thermalExpansionCoeff, viewKeyStruct::thermalExpansionCoeffString() ); + checkNonnegative( m_temperatureViscosityCoefficient, viewKeyStruct::temperatureViscosityCoefficient() ); checkNonnegative( m_specificHeatCapacity, viewKeyStruct::specificHeatCapacityString() ); checkNonnegative( m_referenceInternalEnergy, viewKeyStruct::referenceInternalEnergyString() ); @@ -98,7 +105,7 @@ ThermalCompressibleSinglePhaseFluid::KernelWrapper ThermalCompressibleSinglePhaseFluid::createKernelWrapper() { return KernelWrapper( KernelWrapper::DensRelationType( m_referencePressure, m_referenceTemperature, m_referenceDensity, m_compressibility, -m_thermalExpansionCoeff ), - KernelWrapper::ViscRelationType( m_referencePressure, m_referenceViscosity, m_viscosibility ), + KernelWrapper::ViscRelationType( m_referencePressure, m_referenceTemperature, m_referenceViscosity, m_viscosibility, -m_temperatureViscosityCoefficient ), KernelWrapper::IntEnergyRelationType( m_referenceTemperature, m_referenceInternalEnergy, m_specificHeatCapacity/m_referenceInternalEnergy ), m_density.value, m_density.derivs, diff --git a/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.hpp b/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.hpp index 2f110c295ef..83958834e33 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.hpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.hpp @@ -43,7 +43,7 @@ class ThermalCompressibleSinglePhaseUpdate : public SingleFluidBaseUpdate public: using DensRelationType = ExponentialRelation< real64, DENS_EAT, 3 >; - using ViscRelationType = ExponentialRelation< real64, VISC_EAT >; + using ViscRelationType = ExponentialRelation< real64, VISC_EAT, 3 >; using IntEnergyRelationType = ExponentialRelation< real64, INTENERGY_EAT >; using DerivOffset = constitutive::singlefluid::DerivativeOffsetC< 1 >; @@ -114,11 +114,10 @@ class ThermalCompressibleSinglePhaseUpdate : public SingleFluidBaseUpdate real64 & dEnthalpy_dPressure, real64 & dEnthalpy_dTemperature ) const override { - m_viscRelation.compute( pressure, viscosity, dViscosity_dPressure ); - dViscosity_dTemperature = 0.0; - m_densRelation.compute( pressure, temperature, density, dDensity_dPressure, dDensity_dTemperature ); + m_viscRelation.compute( pressure, temperature, viscosity, dViscosity_dPressure, dViscosity_dTemperature ); + /// Compute the internal energy (only sensitive to temperature) m_intEnergyRelation.compute( temperature, internalEnergy, dInternalEnergy_dTemperature ); dInternalEnergy_dPressure = 0.0; @@ -126,7 +125,6 @@ class ThermalCompressibleSinglePhaseUpdate : public SingleFluidBaseUpdate enthalpy = internalEnergy - m_refIntEnergy; dEnthalpy_dPressure = 0.0; dEnthalpy_dTemperature = dInternalEnergy_dTemperature; - } GEOS_HOST_DEVICE @@ -240,6 +238,7 @@ class ThermalCompressibleSinglePhaseFluid : public CompressibleSinglePhaseFluid struct viewKeyStruct : public CompressibleSinglePhaseFluid::viewKeyStruct { static constexpr char const * thermalExpansionCoeffString() { return "thermalExpansionCoeff"; } + static constexpr char const * temperatureViscosityCoefficient() { return "temperatureViscosityCoefficient"; } static constexpr char const * specificHeatCapacityString() { return "specificHeatCapacity"; } static constexpr char const * referenceTemperatureString() { return "referenceTemperature"; } static constexpr char const * referenceInternalEnergyString() { return "referenceInternalEnergy"; } @@ -255,6 +254,9 @@ class ThermalCompressibleSinglePhaseFluid : public CompressibleSinglePhaseFluid /// scalar fluid thermal expansion coefficient real64 m_thermalExpansionCoeff; + /// scalar fluid temperature-viscosity coefficient + real64 m_temperatureViscosityCoefficient; + /// scalar fluid volumetric heat capacity coefficient real64 m_specificHeatCapacity; diff --git a/src/coreComponents/schema/schema.xsd b/src/coreComponents/schema/schema.xsd index 9a9bb51d843..4805f560fa5 100644 --- a/src/coreComponents/schema/schema.xsd +++ b/src/coreComponents/schema/schema.xsd @@ -8612,6 +8612,8 @@ If you want to do a three-phase simulation, please use instead wettingIntermedia + + @@ -8770,6 +8772,8 @@ To neglect hysteresis on this phase, just use the same table name for the draina + +