diff --git a/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.cpp b/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.cpp index 203cac5b95f..279e15001f3 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.cpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.cpp @@ -38,6 +38,11 @@ ThermalCompressibleSinglePhaseFluid::ThermalCompressibleSinglePhaseFluid( string setInputFlag( InputFlags::OPTIONAL ). setDescription( "Fluid thermal expansion coefficient. Unit: 1/K" ); + registerWrapper( viewKeyStruct::viscosityExpansivityString(), &m_viscosityExpansivity ). + 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 +85,7 @@ void ThermalCompressibleSinglePhaseFluid::postInputInitialization() }; checkNonnegative( m_thermalExpansionCoeff, viewKeyStruct::thermalExpansionCoeffString() ); + checkNonnegative( m_viscosityExpansivity, viewKeyStruct::viscosityExpansivityString() ); checkNonnegative( m_specificHeatCapacity, viewKeyStruct::specificHeatCapacityString() ); checkNonnegative( m_referenceInternalEnergy, viewKeyStruct::referenceInternalEnergyString() ); @@ -98,7 +104,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_viscosityExpansivity ), 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..ee9e4610ac1 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,8 +114,7 @@ class ThermalCompressibleSinglePhaseUpdate : public SingleFluidBaseUpdate real64 & dEnthalpy_dPressure, real64 & dEnthalpy_dTemperature ) const override { - m_viscRelation.compute( pressure, viscosity, dViscosity_dPressure ); - dViscosity_dTemperature = 0.0; + m_viscRelation.compute( pressure, temperature, viscosity, dViscosity_dPressure, dViscosity_dTemperature ); m_densRelation.compute( pressure, temperature, density, dDensity_dPressure, dDensity_dTemperature ); @@ -240,6 +239,7 @@ class ThermalCompressibleSinglePhaseFluid : public CompressibleSinglePhaseFluid struct viewKeyStruct : public CompressibleSinglePhaseFluid::viewKeyStruct { static constexpr char const * thermalExpansionCoeffString() { return "thermalExpansionCoeff"; } + static constexpr char const * viscosityExpansivityString() { return "viscosityExpansivity"; } static constexpr char const * specificHeatCapacityString() { return "specificHeatCapacity"; } static constexpr char const * referenceTemperatureString() { return "referenceTemperature"; } static constexpr char const * referenceInternalEnergyString() { return "referenceInternalEnergy"; } @@ -255,6 +255,9 @@ class ThermalCompressibleSinglePhaseFluid : public CompressibleSinglePhaseFluid /// scalar fluid thermal expansion coefficient real64 m_thermalExpansionCoeff; + /// scalar fluid viscosity thermal expansion coefficient + real64 m_viscosityExpansivity; + /// scalar fluid volumetric heat capacity coefficient real64 m_specificHeatCapacity;