thermophysicalModels::equationOfState: Completed departure functions for all except adiabaticPerfectFluid
Changed liquid thermo from sensibleEnthalpy to sensibleInternalEnergy in tutorials. It is generally more convergent and stable to solve for internal energy if the fluid is incompressible or weakly compressible.
This commit is contained in:
@ -96,9 +96,7 @@ inline Foam::scalar Foam::Boussinesq<Specie>::rho
|
||||
template<class Specie>
|
||||
inline Foam::scalar Foam::Boussinesq<Specie>::H(scalar p, scalar T) const
|
||||
{
|
||||
const scalar rho = this->rho(p, T);
|
||||
|
||||
return (p/rho)*(1 - rho0_*beta_*T/rho);
|
||||
return p/this->rho(p, T);
|
||||
}
|
||||
|
||||
|
||||
@ -163,7 +161,7 @@ inline Foam::scalar Foam::Boussinesq<Specie>::CpMCv
|
||||
scalar T
|
||||
) const
|
||||
{
|
||||
return this->R();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -107,6 +107,7 @@ inline Foam::scalar Foam::adiabaticPerfectFluid<Specie>::H
|
||||
scalar T
|
||||
) const
|
||||
{
|
||||
// ***HGW This needs to be added, it is not 0
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -129,6 +130,7 @@ inline Foam::scalar Foam::adiabaticPerfectFluid<Specie>::E
|
||||
scalar T
|
||||
) const
|
||||
{
|
||||
// ***HGW This needs to be added, it is H - p/rho
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -95,9 +95,7 @@ inline Foam::scalar Foam::icoPolynomial<Specie, PolySize>::H
|
||||
scalar T
|
||||
) const
|
||||
{
|
||||
const scalar rho = this->rho(p, T);
|
||||
|
||||
return (p/rho)*(1 + (T/rho)*rhoCoeffs_.derivative(T));
|
||||
return p/this->rho(p, T);
|
||||
}
|
||||
|
||||
|
||||
@ -174,7 +172,7 @@ inline Foam::scalar Foam::icoPolynomial<Specie, PolySize>::CpMCv
|
||||
scalar T
|
||||
) const
|
||||
{
|
||||
return -(p/sqr(rhoCoeffs_.value(T)))*rhoCoeffs_.derivative(T);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -96,7 +96,7 @@ inline Foam::scalar Foam::incompressiblePerfectGas<Specie>::H
|
||||
scalar T
|
||||
) const
|
||||
{
|
||||
return 0;
|
||||
return p/this->rho(p, T);
|
||||
}
|
||||
|
||||
|
||||
@ -173,7 +173,7 @@ inline Foam::scalar Foam::incompressiblePerfectGas<Specie>::CpMCv
|
||||
scalar T
|
||||
) const
|
||||
{
|
||||
return this->R();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -87,7 +87,7 @@ inline Foam::scalar Foam::linear<Specie>::rho(scalar p, scalar T) const
|
||||
template<class Specie>
|
||||
inline Foam::scalar Foam::linear<Specie>::H(scalar p, scalar T) const
|
||||
{
|
||||
return 0;
|
||||
return log(rho(p, T))/psi_;
|
||||
}
|
||||
|
||||
|
||||
@ -101,7 +101,9 @@ inline Foam::scalar Foam::linear<Specie>::Cp(scalar p, scalar T) const
|
||||
template<class Specie>
|
||||
inline Foam::scalar Foam::linear<Specie>::E(scalar p, scalar T) const
|
||||
{
|
||||
return 0;
|
||||
const scalar rho = this->rho(p, T);
|
||||
|
||||
return log(rho)/psi_ - p/rho;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -146,7 +146,10 @@ inline Foam::scalar Foam::perfectFluid<Specie>::Z(scalar p, scalar T) const
|
||||
template<class Specie>
|
||||
inline Foam::scalar Foam::perfectFluid<Specie>::CpMCv(scalar p, scalar T) const
|
||||
{
|
||||
return 0;
|
||||
const scalar R = this->R();
|
||||
const scalar rho = this->rho(p, T);
|
||||
|
||||
return R*sqr(p/(rho*R*T));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user