Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -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 ).
Expand Down Expand Up @@ -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() );

Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 >;

Expand Down Expand Up @@ -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 );

Expand Down Expand Up @@ -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"; }
Expand All @@ -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;

Expand Down