mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: Fixing Href for hPolynomialThermo.
Tref, Href , Sref and Pref are optional inputs to set the enthalpy at Href for Tref. Pref is needed for the departure function EoS::H
This commit is contained in:
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
Copyright (C) 2020 OpenCFD Ltd.
|
Copyright (C) 2020-2021 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -41,17 +41,22 @@ Foam::hPolynomialThermo<EquationOfState, PolySize>::hPolynomialThermo
|
|||||||
Hf_(dict.subDict("thermodynamics").get<scalar>("Hf")),
|
Hf_(dict.subDict("thermodynamics").get<scalar>("Hf")),
|
||||||
Sf_(dict.subDict("thermodynamics").get<scalar>("Sf")),
|
Sf_(dict.subDict("thermodynamics").get<scalar>("Sf")),
|
||||||
CpCoeffs_(dict.subDict("thermodynamics").lookup(coeffsName("Cp"))),
|
CpCoeffs_(dict.subDict("thermodynamics").lookup(coeffsName("Cp"))),
|
||||||
|
Tref_(dict.subDict("thermodynamics").getOrDefault<scalar>("Tref", Tstd)),
|
||||||
|
Href_(dict.subDict("thermodynamics").getOrDefault<scalar>("Href", 0)),
|
||||||
|
Sref_(dict.subDict("thermodynamics").getOrDefault<scalar>("Sref", 0)),
|
||||||
|
Pref_(dict.subDict("thermodynamics").getOrDefault<scalar>("Pref", Pstd)),
|
||||||
hCoeffs_(),
|
hCoeffs_(),
|
||||||
sCoeffs_()
|
sCoeffs_()
|
||||||
{
|
{
|
||||||
hCoeffs_ = CpCoeffs_.integral();
|
hCoeffs_ = CpCoeffs_.integral();
|
||||||
sCoeffs_ = CpCoeffs_.integralMinus1();
|
sCoeffs_ = CpCoeffs_.integralMinus1();
|
||||||
|
// Offset h poly so that it is relative to the enthalpy at Tref
|
||||||
|
hCoeffs_[0] +=
|
||||||
|
Href_ - hCoeffs_.value(Tref_) - EquationOfState::H(Pstd, Tref_);
|
||||||
|
|
||||||
// Offset h poly so that it is relative to the enthalpy at Tstd
|
// Offset s poly so that it is relative to the entropy at Tref
|
||||||
hCoeffs_[0] += Hf_ - hCoeffs_.value(Tstd);
|
sCoeffs_[0] +=
|
||||||
|
Sref_ - sCoeffs_.value(Tref_) - EquationOfState::S(Pstd, Tref_);
|
||||||
// Offset s poly so that it is relative to the entropy at Tstd
|
|
||||||
sCoeffs_[0] += Sf_ - sCoeffs_.value(Tstd);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -70,6 +75,10 @@ void Foam::hPolynomialThermo<EquationOfState, PolySize>::write
|
|||||||
os.beginBlock("thermodynamics");
|
os.beginBlock("thermodynamics");
|
||||||
os.writeEntry("Hf", Hf_);
|
os.writeEntry("Hf", Hf_);
|
||||||
os.writeEntry("Sf", Sf_);
|
os.writeEntry("Sf", Sf_);
|
||||||
|
os.writeEntry("Tref", Tref_);
|
||||||
|
os.writeEntry("Hsref", Href_);
|
||||||
|
os.writeEntry("Sref", Sref_);
|
||||||
|
os.writeEntry("Pref", Pref_);
|
||||||
os.writeEntry(coeffsName("Cp"), CpCoeffs_);
|
os.writeEntry(coeffsName("Cp"), CpCoeffs_);
|
||||||
os.endBlock();
|
os.endBlock();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
Copyright (C) 2020 OpenCFD Ltd.
|
Copyright (C) 2020-2021 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -141,6 +141,18 @@ class hPolynomialThermo
|
|||||||
//- Specific heat at constant pressure polynomial coeffs
|
//- Specific heat at constant pressure polynomial coeffs
|
||||||
Polynomial<PolySize> CpCoeffs_;
|
Polynomial<PolySize> CpCoeffs_;
|
||||||
|
|
||||||
|
//- Reference temperature
|
||||||
|
scalar Tref_;
|
||||||
|
|
||||||
|
//- Reference enthalphy
|
||||||
|
scalar Href_;
|
||||||
|
|
||||||
|
//- Reference entropy
|
||||||
|
scalar Sref_;
|
||||||
|
|
||||||
|
//- Reference pressure
|
||||||
|
scalar Pref_;
|
||||||
|
|
||||||
//- Enthalpy polynomial coeffs - derived from cp [J/kg]
|
//- Enthalpy polynomial coeffs - derived from cp [J/kg]
|
||||||
// NOTE: relative to Tstd
|
// NOTE: relative to Tstd
|
||||||
typename Polynomial<PolySize>::intPolyType hCoeffs_;
|
typename Polynomial<PolySize>::intPolyType hCoeffs_;
|
||||||
|
|||||||
Reference in New Issue
Block a user