basicThermo: Make molar mass available to basic thermos
This commit is contained in:
@ -103,14 +103,14 @@ Foam::tmp<Foam::scalarField> Foam::compressibleMultiphaseVoFMixture::nu
|
||||
scalarField mu
|
||||
(
|
||||
phases_[0].Alpha().boundaryField()[patchi]
|
||||
*phases_[0].thermo().mu(patchi)
|
||||
*phases_[0].thermo().mu().boundaryField()[patchi]
|
||||
);
|
||||
|
||||
for (label phasei=1; phasei<phases_.size(); phasei++)
|
||||
{
|
||||
mu +=
|
||||
phases_[phasei].Alpha().boundaryField()[patchi]
|
||||
*phases_[phasei].thermo().mu(patchi);
|
||||
*phases_[phasei].thermo().mu().boundaryField()[patchi];
|
||||
}
|
||||
|
||||
return mu/rho_.boundaryField()[patchi];
|
||||
|
||||
@ -197,8 +197,8 @@ Foam::tmp<Foam::scalarField> Foam::compressibleTwoPhaseVoFMixture::nu
|
||||
{
|
||||
return
|
||||
(
|
||||
alpha1().boundaryField()[patchi]*thermo1_->mu(patchi)
|
||||
+ alpha2().boundaryField()[patchi]*thermo2_->mu(patchi)
|
||||
alpha1().boundaryField()[patchi]*thermo1_->mu().boundaryField()[patchi]
|
||||
+ alpha2().boundaryField()[patchi]*thermo2_->mu().boundaryField()[patchi]
|
||||
)/rho_.boundaryField()[patchi];
|
||||
}
|
||||
|
||||
|
||||
@ -136,7 +136,7 @@ Foam::ThermoPhaseModel<BasePhaseModel, ThermoModel>::mu
|
||||
const label patchi
|
||||
) const
|
||||
{
|
||||
return thermo_->mu(patchi);
|
||||
return thermo_->mu().boundaryField()[patchi];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -144,7 +144,7 @@ Foam::solvers::shockFluid::shockFluid(fvMesh& mesh)
|
||||
|
||||
inviscid
|
||||
(
|
||||
max(thermo_.mu()().primitiveField()) > 0
|
||||
max(thermo_.mu().primitiveField()) > 0
|
||||
? false
|
||||
: true
|
||||
),
|
||||
|
||||
@ -103,7 +103,7 @@ public:
|
||||
}
|
||||
|
||||
|
||||
// Access to thermophysical state variables
|
||||
// Mechanical state
|
||||
|
||||
//- Youngs modulus [Pa]
|
||||
virtual const volScalarField& E() const;
|
||||
|
||||
@ -301,6 +301,36 @@ Foam::BasicThermo<MixtureType, BasicThermoType>::~BasicThermo()
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class MixtureType, class BasicThermoType>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::BasicThermo<MixtureType, BasicThermoType>::W() const
|
||||
{
|
||||
return volScalarFieldProperty
|
||||
(
|
||||
"W",
|
||||
dimMass/dimMoles,
|
||||
&MixtureType::thermoMixture,
|
||||
&MixtureType::thermoMixtureType::W
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class MixtureType, class BasicThermoType>
|
||||
Foam::tmp<Foam::scalarField>
|
||||
Foam::BasicThermo<MixtureType, BasicThermoType>::W
|
||||
(
|
||||
const label patchi
|
||||
) const
|
||||
{
|
||||
return patchFieldProperty
|
||||
(
|
||||
&MixtureType::thermoMixture,
|
||||
&MixtureType::thermoMixtureType::W,
|
||||
patchi
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class MixtureType, class BasicThermoType>
|
||||
const Foam::volScalarField&
|
||||
Foam::BasicThermo<MixtureType, BasicThermoType>::Cpv() const
|
||||
@ -593,33 +623,6 @@ Foam::BasicThermo<MixtureType, BasicThermoType>::Cv
|
||||
}
|
||||
|
||||
|
||||
template<class MixtureType, class BasicThermoType>
|
||||
Foam::tmp<Foam::scalarField>
|
||||
Foam::BasicThermo<MixtureType, BasicThermoType>::gamma
|
||||
(
|
||||
const scalarField& T,
|
||||
const label patchi
|
||||
) const
|
||||
{
|
||||
return patchFieldProperty
|
||||
(
|
||||
&MixtureType::thermoMixture,
|
||||
&MixtureType::thermoMixtureType::gamma,
|
||||
patchi,
|
||||
this->p_.boundaryField()[patchi],
|
||||
T
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class MixtureType, class BasicThermoType>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::BasicThermo<MixtureType, BasicThermoType>::gamma() const
|
||||
{
|
||||
return volScalarField::New("gamma", Cp_/Cv_);
|
||||
}
|
||||
|
||||
|
||||
template<class MixtureType, class BasicThermoType>
|
||||
Foam::tmp<Foam::scalarField>
|
||||
Foam::BasicThermo<MixtureType, BasicThermoType>::Cpv
|
||||
@ -703,36 +706,6 @@ Foam::BasicThermo<MixtureType, BasicThermoType>::THE
|
||||
}
|
||||
|
||||
|
||||
template<class MixtureType, class BasicThermoType>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::BasicThermo<MixtureType, BasicThermoType>::W() const
|
||||
{
|
||||
return volScalarFieldProperty
|
||||
(
|
||||
"W",
|
||||
dimMass/dimMoles,
|
||||
&MixtureType::thermoMixture,
|
||||
&MixtureType::thermoMixtureType::W
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class MixtureType, class BasicThermoType>
|
||||
Foam::tmp<Foam::scalarField>
|
||||
Foam::BasicThermo<MixtureType, BasicThermoType>::W
|
||||
(
|
||||
const label patchi
|
||||
) const
|
||||
{
|
||||
return patchFieldProperty
|
||||
(
|
||||
&MixtureType::thermoMixture,
|
||||
&MixtureType::thermoMixtureType::W,
|
||||
patchi
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class MixtureType, class BasicThermoType>
|
||||
bool Foam::BasicThermo<MixtureType, BasicThermoType>::read()
|
||||
{
|
||||
|
||||
@ -209,17 +209,26 @@ public:
|
||||
}
|
||||
|
||||
|
||||
// Access to thermodynamic state variables
|
||||
// Molecular properties
|
||||
|
||||
//- Molecular weight [kg/kmol]
|
||||
virtual tmp<volScalarField> W() const;
|
||||
|
||||
//- Molecular weight for patch [kg/kmol]
|
||||
virtual tmp<scalarField> W(const label patchi) const;
|
||||
|
||||
|
||||
// Thermodynamic state
|
||||
|
||||
//- Enthalpy/Internal energy [J/kg]
|
||||
// Non-const access allowed for transport equations
|
||||
virtual volScalarField& he()
|
||||
virtual const volScalarField& he() const
|
||||
{
|
||||
return he_;
|
||||
}
|
||||
|
||||
//- Enthalpy/Internal energy [J/kg]
|
||||
virtual const volScalarField& he() const
|
||||
// Non-const access allowed for transport equations
|
||||
virtual volScalarField& he()
|
||||
{
|
||||
return he_;
|
||||
}
|
||||
@ -240,7 +249,7 @@ public:
|
||||
virtual const volScalarField& Cpv() const;
|
||||
|
||||
|
||||
// Fields derived from thermodynamic state variables
|
||||
// Derived Thermodynamic Properties
|
||||
|
||||
//- Enthalpy/Internal energy
|
||||
// for given pressure and temperature [J/kg]
|
||||
@ -324,6 +333,30 @@ public:
|
||||
//- Enthalpy of formation [J/kg]
|
||||
virtual tmp<volScalarField> hc() const;
|
||||
|
||||
//- Heat capacity at constant pressure for patch [J/kg/K]
|
||||
virtual tmp<scalarField> Cp
|
||||
(
|
||||
const scalarField& T,
|
||||
const label patchi
|
||||
) const;
|
||||
|
||||
//- Heat capacity at constant volume for patch [J/kg/K]
|
||||
virtual tmp<scalarField> Cv
|
||||
(
|
||||
const scalarField& T,
|
||||
const label patchi
|
||||
) const;
|
||||
|
||||
//- Heat capacity at constant pressure/volume for patch [J/kg/K]
|
||||
virtual tmp<scalarField> Cpv
|
||||
(
|
||||
const scalarField& T,
|
||||
const label patchi
|
||||
) const;
|
||||
|
||||
|
||||
// Temperature-energy inversion functions
|
||||
|
||||
//- Temperature from enthalpy/internal energy
|
||||
virtual tmp<volScalarField> THE
|
||||
(
|
||||
@ -348,43 +381,6 @@ public:
|
||||
const label patchi
|
||||
) const;
|
||||
|
||||
//- Heat capacity at constant pressure for patch [J/kg/K]
|
||||
virtual tmp<scalarField> Cp
|
||||
(
|
||||
const scalarField& T,
|
||||
const label patchi
|
||||
) const;
|
||||
|
||||
//- Heat capacity at constant volume for patch [J/kg/K]
|
||||
virtual tmp<scalarField> Cv
|
||||
(
|
||||
const scalarField& T,
|
||||
const label patchi
|
||||
) const;
|
||||
|
||||
//- Gamma = Cp/Cv []
|
||||
virtual tmp<volScalarField> gamma() const;
|
||||
|
||||
//- Gamma = Cp/Cv for patch []
|
||||
virtual tmp<scalarField> gamma
|
||||
(
|
||||
const scalarField& T,
|
||||
const label patchi
|
||||
) const;
|
||||
|
||||
//- Heat capacity at constant pressure/volume for patch [J/kg/K]
|
||||
virtual tmp<scalarField> Cpv
|
||||
(
|
||||
const scalarField& T,
|
||||
const label patchi
|
||||
) const;
|
||||
|
||||
//- Molecular weight [kg/kmol]
|
||||
virtual tmp<volScalarField> W() const;
|
||||
|
||||
//- Molecular weight for patch [kg/kmol]
|
||||
virtual tmp<scalarField> W(const label patchi) const;
|
||||
|
||||
|
||||
//- Read thermophysical properties dictionary
|
||||
using BasicThermoType::read;
|
||||
|
||||
@ -319,6 +319,7 @@ void Foam::basicThermo::validate
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::basicThermo::validate
|
||||
(
|
||||
const string& app,
|
||||
@ -343,6 +344,22 @@ void Foam::basicThermo::validate
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::basicThermo::gamma() const
|
||||
{
|
||||
return volScalarField::New(phasePropertyName("gamma"), Cp()/Cv());
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> Foam::basicThermo::gamma
|
||||
(
|
||||
const scalarField& T,
|
||||
const label patchi
|
||||
) const
|
||||
{
|
||||
return Cp(T, patchi)/Cv(T, patchi);
|
||||
}
|
||||
|
||||
|
||||
const Foam::volScalarField& Foam::basicThermo::implementation::T() const
|
||||
{
|
||||
return T_;
|
||||
|
||||
@ -252,7 +252,42 @@ public:
|
||||
virtual Switch dpdt() const = 0;
|
||||
|
||||
|
||||
// Access to thermodynamic state variables
|
||||
// Molecular properties
|
||||
|
||||
//- Molecular weight [kg/kmol]
|
||||
virtual tmp<volScalarField> W() const = 0;
|
||||
|
||||
//- Molecular weight for patch [kg/kmol]
|
||||
virtual tmp<scalarField> W(const label patchi) const = 0;
|
||||
|
||||
|
||||
// Thermodynamic state
|
||||
|
||||
//- Temperature [K]
|
||||
virtual const volScalarField& T() const = 0;
|
||||
|
||||
//- Temperature [K]
|
||||
// Non-const access allowed for transport equations
|
||||
virtual volScalarField& T() = 0;
|
||||
|
||||
//- Enthalpy/Internal energy [J/kg]
|
||||
virtual const volScalarField& he() const = 0;
|
||||
|
||||
//- Enthalpy/Internal energy [J/kg]
|
||||
// Non-const access allowed for transport equations
|
||||
virtual volScalarField& he() = 0;
|
||||
|
||||
//- Heat capacity at constant pressure [J/kg/K]
|
||||
virtual const volScalarField& Cp() const = 0;
|
||||
|
||||
//- Heat capacity at constant volume [J/kg/K]
|
||||
virtual const volScalarField& Cv() const = 0;
|
||||
|
||||
//- Heat capacity at constant pressure/volume [J/kg/K]
|
||||
virtual const volScalarField& Cpv() const = 0;
|
||||
|
||||
|
||||
// Derived Thermodynamic Properties
|
||||
|
||||
//- Density [kg/m^3]
|
||||
virtual tmp<volScalarField> rho() const = 0;
|
||||
@ -260,13 +295,6 @@ public:
|
||||
//- Density for patch [kg/m^3]
|
||||
virtual tmp<scalarField> rho(const label patchi) const = 0;
|
||||
|
||||
//- Enthalpy/Internal energy [J/kg]
|
||||
// Non-const access allowed for transport equations
|
||||
virtual volScalarField& he() = 0;
|
||||
|
||||
//- Enthalpy/Internal energy [J/kg]
|
||||
virtual const volScalarField& he() const = 0;
|
||||
|
||||
//- Enthalpy/Internal energy
|
||||
// for given pressure and temperature [J/kg]
|
||||
virtual tmp<volScalarField> he
|
||||
@ -349,6 +377,40 @@ public:
|
||||
//- Enthalpy of formation [J/kg]
|
||||
virtual tmp<volScalarField> hc() const = 0;
|
||||
|
||||
//- Heat capacity at constant pressure for patch [J/kg/K]
|
||||
virtual tmp<scalarField> Cp
|
||||
(
|
||||
const scalarField& T,
|
||||
const label patchi
|
||||
) const = 0;
|
||||
|
||||
//- Heat capacity at constant volume for patch [J/kg/K]
|
||||
virtual tmp<scalarField> Cv
|
||||
(
|
||||
const scalarField& T,
|
||||
const label patchi
|
||||
) const = 0;
|
||||
|
||||
//- Heat capacity at constant pressure/volume for patch [J/kg/K]
|
||||
virtual tmp<scalarField> Cpv
|
||||
(
|
||||
const scalarField& T,
|
||||
const label patchi
|
||||
) const = 0;
|
||||
|
||||
//- Gamma = Cp/Cv []
|
||||
tmp<volScalarField> gamma() const;
|
||||
|
||||
//- Gamma = Cp/Cv for patch []
|
||||
tmp<scalarField> gamma
|
||||
(
|
||||
const scalarField& T,
|
||||
const label patchi
|
||||
) const;
|
||||
|
||||
|
||||
// Temperature-energy inversion functions
|
||||
|
||||
//- Temperature from enthalpy/internal energy
|
||||
virtual tmp<volScalarField> THE
|
||||
(
|
||||
@ -373,51 +435,11 @@ public:
|
||||
const label patchi
|
||||
) const = 0;
|
||||
|
||||
//- Heat capacity at constant pressure [J/kg/K]
|
||||
virtual const volScalarField& Cp() const = 0;
|
||||
|
||||
//- Heat capacity at constant volume [J/kg/K]
|
||||
virtual const volScalarField& Cv() const = 0;
|
||||
|
||||
//- Heat capacity at constant pressure/volume [J/kg/K]
|
||||
virtual const volScalarField& Cpv() const = 0;
|
||||
|
||||
|
||||
// Access to transport state variables
|
||||
// Transport state
|
||||
|
||||
//- Thermal conductivity of mixture [W/m/K]
|
||||
virtual const volScalarField& kappa() const = 0;
|
||||
|
||||
|
||||
// Fields derived from thermodynamic state variables
|
||||
|
||||
//- Temperature [K]
|
||||
virtual const volScalarField& T() const = 0;
|
||||
|
||||
//- Temperature [K]
|
||||
// Non-const access allowed for transport equations
|
||||
virtual volScalarField& T() = 0;
|
||||
|
||||
//- Heat capacity at constant pressure for patch [J/kg/K]
|
||||
virtual tmp<scalarField> Cp
|
||||
(
|
||||
const scalarField& T,
|
||||
const label patchi
|
||||
) const = 0;
|
||||
|
||||
//- Heat capacity at constant volume for patch [J/kg/K]
|
||||
virtual tmp<scalarField> Cv
|
||||
(
|
||||
const scalarField& T,
|
||||
const label patchi
|
||||
) const = 0;
|
||||
|
||||
//- Heat capacity at constant pressure/volume for patch [J/kg/K]
|
||||
virtual tmp<scalarField> Cpv
|
||||
(
|
||||
const scalarField& T,
|
||||
const label patchi
|
||||
) const = 0;
|
||||
};
|
||||
|
||||
|
||||
@ -493,7 +515,7 @@ public:
|
||||
}
|
||||
|
||||
|
||||
// Fields derived from thermodynamic state variables
|
||||
// Thermodynamic state
|
||||
|
||||
//- Temperature [K]
|
||||
virtual const volScalarField& T() const;
|
||||
@ -503,7 +525,7 @@ public:
|
||||
virtual volScalarField& T();
|
||||
|
||||
|
||||
// Access to transport state variables
|
||||
// Transport state
|
||||
|
||||
//- Thermal conductivity of mixture [W/m/K]
|
||||
virtual const volScalarField& kappa() const;
|
||||
|
||||
@ -108,17 +108,17 @@ Foam::tmp<Foam::volScalarField> Foam::fluidThermo::nu() const
|
||||
Foam::tmp<Foam::scalarField>
|
||||
Foam::fluidThermo::nu(const label patchi) const
|
||||
{
|
||||
return mu(patchi)/rho(patchi);
|
||||
return mu().boundaryField()[patchi]/rho(patchi);
|
||||
}
|
||||
|
||||
|
||||
Foam::volScalarField& Foam::fluidThermo::implementation::p()
|
||||
const Foam::volScalarField& Foam::fluidThermo::implementation::p() const
|
||||
{
|
||||
return p_;
|
||||
}
|
||||
|
||||
|
||||
const Foam::volScalarField& Foam::fluidThermo::implementation::p() const
|
||||
Foam::volScalarField& Foam::fluidThermo::implementation::p()
|
||||
{
|
||||
return p_;
|
||||
}
|
||||
@ -130,19 +130,10 @@ const Foam::volScalarField& Foam::fluidThermo::implementation::psi() const
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::fluidThermo::implementation::mu() const
|
||||
const Foam::volScalarField& Foam::fluidThermo::implementation::mu() const
|
||||
{
|
||||
return mu_;
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> Foam::fluidThermo::implementation::mu
|
||||
(
|
||||
const label patchi
|
||||
) const
|
||||
{
|
||||
return mu_.boundaryField()[patchi];
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -95,60 +95,44 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access to thermodynamic state variables
|
||||
// Thermodynamic state
|
||||
|
||||
//- Pressure [Pa]
|
||||
virtual const volScalarField& p() const = 0;
|
||||
|
||||
//- Pressure [Pa]
|
||||
// Non-const access allowed for transport equations
|
||||
virtual volScalarField& p() = 0;
|
||||
|
||||
//- Pressure [Pa]
|
||||
virtual const volScalarField& p() const = 0;
|
||||
|
||||
//- Add the given density correction to the density field.
|
||||
// Used to update the density field following pressure solution
|
||||
virtual void correctRho(const volScalarField& deltaRho) = 0;
|
||||
|
||||
//- Compressibility [s^2/m^2]
|
||||
virtual const volScalarField& psi() const = 0;
|
||||
|
||||
|
||||
// Fields derived from thermodynamic state variables
|
||||
// Derived thermodynamic properties
|
||||
|
||||
//- Rename the thermodynamic density field if stored and return
|
||||
// This is used by solvers which create a separate continuity rho
|
||||
// [kg/m^3]
|
||||
virtual tmp<volScalarField> renameRho() = 0;
|
||||
|
||||
//- Gamma = Cp/Cv []
|
||||
virtual tmp<volScalarField> gamma() const = 0;
|
||||
|
||||
//- Gamma = Cp/Cv for patch []
|
||||
virtual tmp<scalarField> gamma
|
||||
(
|
||||
const scalarField& T,
|
||||
const label patchi
|
||||
) const = 0;
|
||||
|
||||
//- Molecular weight [kg/kmol]
|
||||
virtual tmp<volScalarField> W() const = 0;
|
||||
|
||||
//- Molecular weight for patch [kg/kmol]
|
||||
virtual tmp<scalarField> W(const label patchi) const = 0;
|
||||
//- Add the given density correction to the density field.
|
||||
// Used to update the density field following pressure solution
|
||||
virtual void correctRho(const volScalarField& deltaRho) = 0;
|
||||
|
||||
|
||||
// Access to transport state variables
|
||||
// Transport state
|
||||
|
||||
//- Dynamic viscosity of mixture [kg/m/s]
|
||||
virtual tmp<volScalarField> mu() const = 0;
|
||||
virtual const volScalarField& mu() const = 0;
|
||||
|
||||
//- Dynamic viscosity of mixture for patch [kg/m/s]
|
||||
virtual tmp<scalarField> mu(const label patchi) const = 0;
|
||||
|
||||
// Derived transport properties
|
||||
|
||||
//- Kinematic viscosity of mixture [m^2/s]
|
||||
virtual tmp<volScalarField> nu() const;
|
||||
tmp<volScalarField> nu() const;
|
||||
|
||||
//- Kinematic viscosity of mixture for patch [m^2/s]
|
||||
virtual tmp<scalarField> nu(const label patchi) const;
|
||||
tmp<scalarField> nu(const label patchi) const;
|
||||
};
|
||||
|
||||
|
||||
@ -193,26 +177,23 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access to thermodynamic state variables
|
||||
// Thermodynamic state
|
||||
|
||||
//- Pressure [Pa]
|
||||
virtual const volScalarField& p() const;
|
||||
|
||||
//- Pressure [Pa]
|
||||
// Non-const access allowed for transport equations
|
||||
virtual volScalarField& p();
|
||||
|
||||
//- Pressure [Pa]
|
||||
virtual const volScalarField& p() const;
|
||||
|
||||
//- Compressibility [s^2/m^2]
|
||||
virtual const volScalarField& psi() const;
|
||||
|
||||
|
||||
// Access to transport state variables
|
||||
// Transport state
|
||||
|
||||
//- Dynamic viscosity of mixture [kg/m/s]
|
||||
virtual tmp<volScalarField> mu() const;
|
||||
|
||||
//- Dynamic viscosity of mixture for patch [kg/m/s]
|
||||
virtual tmp<scalarField> mu(const label patchi) const;
|
||||
virtual const volScalarField& mu() const;
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
@ -71,16 +71,16 @@ Foam::psiThermo::implementation::~implementation()
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::psiThermo::correctRho(const Foam::volScalarField& deltaRho)
|
||||
{}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::psiThermo::renameRho()
|
||||
{
|
||||
return rho();
|
||||
}
|
||||
|
||||
|
||||
void Foam::psiThermo::correctRho(const Foam::volScalarField& deltaRho)
|
||||
{}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::psiThermo::implementation::rho() const
|
||||
{
|
||||
return p()*psi();
|
||||
|
||||
@ -108,7 +108,7 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Fields derived from thermodynamic state variables
|
||||
// Derived thermodynamic properties
|
||||
|
||||
//- Density [kg/m^3] - uses current value of pressure
|
||||
virtual tmp<volScalarField> rho() const = 0;
|
||||
@ -152,7 +152,7 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Fields derived from thermodynamic state variables
|
||||
// Derived thermodynamic properties
|
||||
|
||||
//- Density [kg/m^3] - uses current value of pressure
|
||||
virtual tmp<volScalarField> rho() const;
|
||||
|
||||
@ -56,8 +56,7 @@ Foam::rhoFluidThermo::~rhoFluidThermo()
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::rhoFluidThermo::renameRho()
|
||||
Foam::tmp<Foam::volScalarField> Foam::rhoFluidThermo::renameRho()
|
||||
{
|
||||
rho().rename(phasePropertyName(Foam::typedName<rhoFluidThermo>("rho")));
|
||||
return rho();
|
||||
|
||||
@ -107,7 +107,7 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Fields derived from thermodynamic state variables
|
||||
// Derived Thermodynamic Properties
|
||||
|
||||
//- Rename and return the thermodynamic density field [kg/m^3]
|
||||
// This is used by solvers which create a separate continuity rho
|
||||
|
||||
@ -67,7 +67,7 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Fields derived from thermodynamic state variables
|
||||
// Derived thermodynamic properties
|
||||
|
||||
//- Density [kg/m^3]
|
||||
virtual tmp<volScalarField> rho() const = 0;
|
||||
@ -113,7 +113,7 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Fields derived from thermodynamic state variables
|
||||
// Derived thermodynamic properties
|
||||
|
||||
//- Density [kg/m^3]
|
||||
virtual tmp<volScalarField> rho() const;
|
||||
|
||||
@ -137,16 +137,6 @@ Foam::scalar Foam::MulticomponentThermo<BaseThermo>::Wi
|
||||
}
|
||||
|
||||
|
||||
template<class BaseThermo>
|
||||
Foam::scalar Foam::MulticomponentThermo<BaseThermo>::hfi
|
||||
(
|
||||
const label speciei
|
||||
) const
|
||||
{
|
||||
return this->specieThermo(speciei).Hf();
|
||||
}
|
||||
|
||||
|
||||
template<class BaseThermo>
|
||||
Foam::scalar Foam::MulticomponentThermo<BaseThermo>::rhoi
|
||||
(
|
||||
@ -366,6 +356,16 @@ Foam::MulticomponentThermo<BaseThermo>::hai
|
||||
}
|
||||
|
||||
|
||||
template<class BaseThermo>
|
||||
Foam::scalar Foam::MulticomponentThermo<BaseThermo>::hfi
|
||||
(
|
||||
const label speciei
|
||||
) const
|
||||
{
|
||||
return this->specieThermo(speciei).Hf();
|
||||
}
|
||||
|
||||
|
||||
template<class BaseThermo>
|
||||
Foam::scalar Foam::MulticomponentThermo<BaseThermo>::kappai
|
||||
(
|
||||
|
||||
@ -94,16 +94,13 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Specie properties
|
||||
// Specie molecular properties
|
||||
|
||||
//- Molecular weight [kg/kmol]
|
||||
virtual scalar Wi(const label speciei) const;
|
||||
|
||||
//- Enthalpy of formation [J/kg]
|
||||
virtual scalar hfi(const label speciei) const;
|
||||
|
||||
|
||||
// Specie thermo properties
|
||||
// Specie thermodynamic properties
|
||||
|
||||
//- Density [kg/m^3]
|
||||
virtual scalar rhoi
|
||||
@ -209,6 +206,9 @@ public:
|
||||
const volScalarField& T
|
||||
) const;
|
||||
|
||||
//- Enthalpy of formation [J/kg]
|
||||
virtual scalar hfi(const label speciei) const;
|
||||
|
||||
|
||||
// Specie transport properties
|
||||
|
||||
|
||||
@ -129,7 +129,7 @@ public:
|
||||
void normaliseY();
|
||||
|
||||
|
||||
// Specie properties
|
||||
// Specie molecular properties
|
||||
|
||||
//- Molecular weight [kg/kmol]
|
||||
virtual scalar Wi(const label speciei) const = 0;
|
||||
@ -138,7 +138,7 @@ public:
|
||||
virtual scalar hfi(const label speciei) const = 0;
|
||||
|
||||
|
||||
// Specie thermo properties
|
||||
// Specie thermodynamic properties
|
||||
|
||||
//- Density [kg/m^3]
|
||||
virtual scalar rhoi
|
||||
|
||||
@ -91,13 +91,12 @@ public:
|
||||
virtual void correct();
|
||||
|
||||
|
||||
// Access to thermodynamic state variables.
|
||||
// Thermodynamic state
|
||||
|
||||
//- Unburnt gas enthalpy [J/kg]
|
||||
// Non-const access allowed for transport equations
|
||||
virtual volScalarField& heu()
|
||||
//- Unburnt gas temperature [K]
|
||||
virtual const volScalarField& Tu() const
|
||||
{
|
||||
return heu_;
|
||||
return Tu_;
|
||||
}
|
||||
|
||||
//- Unburnt gas enthalpy [J/kg]
|
||||
@ -106,14 +105,15 @@ public:
|
||||
return heu_;
|
||||
}
|
||||
|
||||
//- Unburnt gas temperature [K]
|
||||
virtual const volScalarField& Tu() const
|
||||
//- Unburnt gas enthalpy [J/kg]
|
||||
// Non-const access allowed for transport equations
|
||||
virtual volScalarField& heu()
|
||||
{
|
||||
return Tu_;
|
||||
return heu_;
|
||||
}
|
||||
|
||||
|
||||
// Fields derived from thermodynamic state variables
|
||||
// Derived thermodynamic properties
|
||||
|
||||
//- Unburnt gas enthalpy for cell-set [J/kg]
|
||||
virtual tmp<scalarField> heu
|
||||
@ -129,7 +129,6 @@ public:
|
||||
const label patchi
|
||||
) const;
|
||||
|
||||
|
||||
//- Burnt gas temperature [K]
|
||||
virtual tmp<volScalarField> Tb() const;
|
||||
|
||||
@ -140,7 +139,7 @@ public:
|
||||
virtual tmp<volScalarField> psib() const;
|
||||
|
||||
|
||||
// Access to transport variables
|
||||
// Derived transport properties
|
||||
|
||||
//- Dynamic viscosity of unburnt gas [kg/m/s]
|
||||
virtual tmp<volScalarField> muu() const;
|
||||
|
||||
@ -161,6 +161,18 @@ Foam::psiuMulticomponentThermo::implementation::~implementation()
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::psiuMulticomponentThermo::rhou() const
|
||||
{
|
||||
return p()*psiu();
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::psiuMulticomponentThermo::rhob() const
|
||||
{
|
||||
return p()*psib();
|
||||
}
|
||||
|
||||
|
||||
const Foam::speciesTable&
|
||||
Foam::psiuMulticomponentThermo::implementation::species() const
|
||||
{
|
||||
|
||||
@ -147,17 +147,20 @@ public:
|
||||
inline const volScalarField& Y(const word& specieName) const;
|
||||
|
||||
|
||||
// Access to thermodynamic state variables.
|
||||
// Thermodynamic state
|
||||
|
||||
//- Unburnt gas temperature [K]
|
||||
virtual const volScalarField& Tu() const = 0;
|
||||
|
||||
//- Unburnt gas enthalpy [J/kg]
|
||||
virtual const volScalarField& heu() const = 0;
|
||||
|
||||
//- Unburnt gas enthalpy [J/kg]
|
||||
// Non-const access allowed for transport equations
|
||||
virtual volScalarField& heu() = 0;
|
||||
|
||||
//- Unburnt gas enthalpy [J/kg]
|
||||
virtual const volScalarField& heu() const = 0;
|
||||
|
||||
|
||||
// Fields derived from thermodynamic state variables
|
||||
// Derived thermodynamic properties
|
||||
|
||||
//- Unburnt gas enthalpy for cell-set [J/kg]
|
||||
virtual tmp<scalarField> heu
|
||||
@ -173,30 +176,24 @@ public:
|
||||
const label patchi
|
||||
) const = 0;
|
||||
|
||||
//- Unburnt gas temperature [K]
|
||||
virtual const volScalarField& Tu() const = 0;
|
||||
|
||||
//- Burnt gas temperature [K]
|
||||
virtual tmp<volScalarField> Tb() const = 0;
|
||||
|
||||
//- Unburnt gas density [kg/m^3]
|
||||
virtual tmp<volScalarField> rhou() const
|
||||
{
|
||||
return p()*psiu();
|
||||
}
|
||||
|
||||
//- Burnt gas density [kg/m^3]
|
||||
virtual tmp<volScalarField> rhob() const
|
||||
{
|
||||
return p()*psib();
|
||||
}
|
||||
|
||||
//- Unburnt gas compressibility [s^2/m^2]
|
||||
virtual tmp<volScalarField> psiu() const = 0;
|
||||
|
||||
//- Burnt gas compressibility [s^2/m^2]
|
||||
virtual tmp<volScalarField> psib() const = 0;
|
||||
|
||||
//- Unburnt gas density [kg/m^3]
|
||||
tmp<volScalarField> rhou() const;
|
||||
|
||||
//- Burnt gas density [kg/m^3]
|
||||
tmp<volScalarField> rhob() const;
|
||||
|
||||
|
||||
// Derived transport properties
|
||||
|
||||
//- Dynamic viscosity of unburnt gas [kg/m/s]
|
||||
virtual tmp<volScalarField> muu() const = 0;
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2022-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -160,7 +160,7 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access to transport state variables
|
||||
// Transport state
|
||||
|
||||
//- Return false as the thermal conductivity is anisotropic
|
||||
virtual bool isotropic() const
|
||||
|
||||
@ -92,9 +92,23 @@ Foam::constSolidThermo::~constSolidThermo()
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
const Foam::volScalarField& Foam::constSolidThermo::Cpv() const
|
||||
Foam::tmp<Foam::volScalarField> Foam::constSolidThermo::W() const
|
||||
{
|
||||
return Cv_;
|
||||
NotImplemented;
|
||||
return tmp<volScalarField>(nullptr);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> Foam::constSolidThermo::W(const label patchi) const
|
||||
{
|
||||
NotImplemented;
|
||||
return tmp<scalarField>(nullptr);
|
||||
}
|
||||
|
||||
|
||||
const Foam::volScalarField& Foam::constSolidThermo::he() const
|
||||
{
|
||||
return e_;
|
||||
}
|
||||
|
||||
|
||||
@ -104,9 +118,21 @@ Foam::volScalarField& Foam::constSolidThermo::he()
|
||||
}
|
||||
|
||||
|
||||
const Foam::volScalarField& Foam::constSolidThermo::he() const
|
||||
const Foam::volScalarField& Foam::constSolidThermo::Cp() const
|
||||
{
|
||||
return e_;
|
||||
return Cv_;
|
||||
}
|
||||
|
||||
|
||||
const Foam::volScalarField& Foam::constSolidThermo::Cv() const
|
||||
{
|
||||
return Cv_;
|
||||
}
|
||||
|
||||
|
||||
const Foam::volScalarField& Foam::constSolidThermo::Cpv() const
|
||||
{
|
||||
return Cv_;
|
||||
}
|
||||
|
||||
|
||||
@ -238,6 +264,36 @@ Foam::tmp<Foam::volScalarField> Foam::constSolidThermo::hc() const
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> Foam::constSolidThermo::Cp
|
||||
(
|
||||
const scalarField& T,
|
||||
const label patchi
|
||||
) const
|
||||
{
|
||||
return Cv_.boundaryField()[patchi];
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> Foam::constSolidThermo::Cv
|
||||
(
|
||||
const scalarField& T,
|
||||
const label patchi
|
||||
) const
|
||||
{
|
||||
return Cv_.boundaryField()[patchi];
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> Foam::constSolidThermo::Cpv
|
||||
(
|
||||
const scalarField& T,
|
||||
const label patchi
|
||||
) const
|
||||
{
|
||||
return Cv_.boundaryField()[patchi];
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::constSolidThermo::THE
|
||||
(
|
||||
const volScalarField& h,
|
||||
@ -274,48 +330,6 @@ Foam::tmp<Foam::scalarField> Foam::constSolidThermo::THE
|
||||
}
|
||||
|
||||
|
||||
const Foam::volScalarField& Foam::constSolidThermo::Cp() const
|
||||
{
|
||||
return Cv_;
|
||||
}
|
||||
|
||||
|
||||
const Foam::volScalarField& Foam::constSolidThermo::Cv() const
|
||||
{
|
||||
return Cv_;
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> Foam::constSolidThermo::Cp
|
||||
(
|
||||
const scalarField& T,
|
||||
const label patchi
|
||||
) const
|
||||
{
|
||||
return Cv_.boundaryField()[patchi];
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> Foam::constSolidThermo::Cv
|
||||
(
|
||||
const scalarField& T,
|
||||
const label patchi
|
||||
) const
|
||||
{
|
||||
return Cv_.boundaryField()[patchi];
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> Foam::constSolidThermo::Cpv
|
||||
(
|
||||
const scalarField& T,
|
||||
const label patchi
|
||||
) const
|
||||
{
|
||||
return Cv_.boundaryField()[patchi];
|
||||
}
|
||||
|
||||
|
||||
const Foam::volVectorField& Foam::constSolidThermo::Kappa() const
|
||||
{
|
||||
NotImplemented;
|
||||
|
||||
@ -206,15 +206,24 @@ public:
|
||||
}
|
||||
|
||||
|
||||
// Access to thermophysical state variables
|
||||
// Molecular properties
|
||||
|
||||
//- Molecular weight [kg/kmol]
|
||||
virtual tmp<volScalarField> W() const;
|
||||
|
||||
//- Molecular weight for patch [kg/kmol]
|
||||
virtual tmp<scalarField> W(const label patchi) const;
|
||||
|
||||
|
||||
// Thermodynamic state
|
||||
|
||||
//- Enthalpy/Internal energy [J/kg]
|
||||
virtual const volScalarField& he() const;
|
||||
|
||||
//- Enthalpy/Internal energy [J/kg]
|
||||
// Non-const access allowed for transport equations
|
||||
virtual volScalarField& he();
|
||||
|
||||
//- Enthalpy/Internal energy [J/kg]
|
||||
virtual const volScalarField& he() const;
|
||||
|
||||
//- Heat capacity at constant pressure [J/kg/K]
|
||||
virtual const volScalarField& Cp() const;
|
||||
|
||||
@ -225,20 +234,7 @@ public:
|
||||
virtual const volScalarField& Cpv() const;
|
||||
|
||||
|
||||
// Access to transport state variables
|
||||
|
||||
//- Return true as the thermal conductivity is isotropic
|
||||
virtual bool isotropic() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//- Anisotropic thermal conductivity [W/m/K]
|
||||
// Not implemented
|
||||
virtual const volVectorField& Kappa() const;
|
||||
|
||||
|
||||
// Fields derived from thermodynamic state variables
|
||||
// Derived thermodynamic properties
|
||||
|
||||
//- Enthalpy/Internal energy
|
||||
// for given pressure and temperature [J/kg]
|
||||
@ -322,6 +318,30 @@ public:
|
||||
//- Enthalpy of formation [J/kg]
|
||||
virtual tmp<volScalarField> hc() const;
|
||||
|
||||
//- Heat capacity at constant pressure for patch [J/kg/K]
|
||||
virtual tmp<scalarField> Cp
|
||||
(
|
||||
const scalarField& T,
|
||||
const label patchi
|
||||
) const;
|
||||
|
||||
//- Heat capacity at constant volume for patch [J/kg/K]
|
||||
virtual tmp<scalarField> Cv
|
||||
(
|
||||
const scalarField& T,
|
||||
const label patchi
|
||||
) const;
|
||||
|
||||
//- Heat capacity at constant pressure/volume for patch [J/kg/K]
|
||||
virtual tmp<scalarField> Cpv
|
||||
(
|
||||
const scalarField& T,
|
||||
const label patchi
|
||||
) const;
|
||||
|
||||
|
||||
// Temperature-energy inversion functions
|
||||
|
||||
//- Temperature from enthalpy/internal energy
|
||||
virtual tmp<volScalarField> THE
|
||||
(
|
||||
@ -346,26 +366,18 @@ public:
|
||||
const label patchi
|
||||
) const;
|
||||
|
||||
//- Heat capacity at constant pressure for patch [J/kg/K]
|
||||
virtual tmp<scalarField> Cp
|
||||
(
|
||||
const scalarField& T,
|
||||
const label patchi
|
||||
) const;
|
||||
|
||||
//- Heat capacity at constant volume for patch [J/kg/K]
|
||||
virtual tmp<scalarField> Cv
|
||||
(
|
||||
const scalarField& T,
|
||||
const label patchi
|
||||
) const;
|
||||
// Transport state
|
||||
|
||||
//- Heat capacity at constant pressure/volume for patch [J/kg/K]
|
||||
virtual tmp<scalarField> Cpv
|
||||
(
|
||||
const scalarField& T,
|
||||
const label patchi
|
||||
) const;
|
||||
//- Return true as the thermal conductivity is isotropic
|
||||
virtual bool isotropic() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//- Anisotropic thermal conductivity [W/m/K]
|
||||
// Not implemented
|
||||
virtual const volVectorField& Kappa() const;
|
||||
|
||||
|
||||
//- Update properties
|
||||
|
||||
Reference in New Issue
Block a user