From fa9cccf11df67a1fc98f6cc72a90dce4873b28bc Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Thu, 11 Jun 2020 00:09:34 +0100 Subject: [PATCH] equationOfState: Separated entropy contributions into Sp and Sv The entropy contribution from the equation of state corrects the integral of the heat capacity divided by temperature for changes in pressure in the case of Cp named Sp or changes in volume in the case of Cv, named Sv. This for enthalpy based thermodynamics Sp is needed and for internal energy Sv is needed. --- .../equationOfState/Boussinesq/Boussinesq.H | 7 +++++-- .../equationOfState/Boussinesq/BoussinesqI.H | 14 +++++++++++++- .../PengRobinsonGas/PengRobinsonGas.H | 9 ++++++--- .../PengRobinsonGas/PengRobinsonGasI.H | 16 ++++++++++++++-- .../adiabaticPerfectFluid.H | 9 ++++++--- .../adiabaticPerfectFluidI.H | 16 ++++++++++++++-- .../icoPolynomial/icoPolynomial.H | 7 +++++-- .../icoPolynomial/icoPolynomialI.H | 15 +++++++++++++-- .../equationOfState/icoTabulated/icoTabulated.H | 7 +++++-- .../equationOfState/icoTabulated/icoTabulatedI.H | 13 ++++++++++++- .../incompressiblePerfectGas.H | 9 ++++++--- .../incompressiblePerfectGasI.H | 15 +++++++++++++-- .../specie/equationOfState/linear/linear.H | 9 ++++++--- .../specie/equationOfState/linear/linearI.H | 12 ++++++++++-- .../equationOfState/perfectFluid/perfectFluid.H | 9 ++++++--- .../equationOfState/perfectFluid/perfectFluidI.H | 12 ++++++++++-- .../equationOfState/perfectGas/perfectGas.H | 9 ++++++--- .../equationOfState/perfectGas/perfectGasI.H | 12 ++++++++++-- .../equationOfState/rPolynomial/rPolynomial.H | 9 ++++++--- .../equationOfState/rPolynomial/rPolynomialI.H | 12 ++++++++++-- .../specie/equationOfState/rhoConst/rhoConst.H | 9 ++++++--- .../specie/equationOfState/rhoConst/rhoConstI.H | 11 +++++++++-- .../specie/thermo/eConst/eConstThermoI.H | 4 ++-- .../thermo/ePolynomial/ePolynomialThermoI.H | 4 ++-- .../specie/thermo/ePower/ePowerThermoI.H | 3 +-- .../specie/thermo/hConst/hConstThermoI.H | 2 +- .../thermo/hPolynomial/hPolynomialThermoI.H | 2 +- .../specie/thermo/hPower/hPowerThermoI.H | 2 +- .../specie/thermo/hTabulated/hTabulatedThermoI.H | 2 +- .../specie/thermo/janaf/janafThermoI.H | 2 +- 30 files changed, 201 insertions(+), 61 deletions(-) diff --git a/src/thermophysicalModels/specie/equationOfState/Boussinesq/Boussinesq.H b/src/thermophysicalModels/specie/equationOfState/Boussinesq/Boussinesq.H index 4b82946dbb..816239d6dd 100644 --- a/src/thermophysicalModels/specie/equationOfState/Boussinesq/Boussinesq.H +++ b/src/thermophysicalModels/specie/equationOfState/Boussinesq/Boussinesq.H @@ -172,8 +172,11 @@ public: //- Return Cv departure [J/(kg K] inline scalar Cv(scalar p, scalar T) const; - //- Return entropy [J/kg/K] - inline scalar S(const scalar p, const scalar T) const; + //- Return entropy correction to the integral of Cp/T [J/kg/K] + inline scalar Sp(const scalar p, const scalar T) const; + + //- Return entropy correction to the integral of Cv/T [J/kg/K] + inline scalar Sv(const scalar p, const scalar T) const; //- Return compressibility [s^2/m^2] inline scalar psi(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/specie/equationOfState/Boussinesq/BoussinesqI.H b/src/thermophysicalModels/specie/equationOfState/Boussinesq/BoussinesqI.H index c23cbf37f1..385cb33aad 100644 --- a/src/thermophysicalModels/specie/equationOfState/Boussinesq/BoussinesqI.H +++ b/src/thermophysicalModels/specie/equationOfState/Boussinesq/BoussinesqI.H @@ -122,7 +122,7 @@ inline Foam::scalar Foam::Boussinesq::Cv(scalar p, scalar T) const template -inline Foam::scalar Foam::Boussinesq::S +inline Foam::scalar Foam::Boussinesq::Sp ( scalar p, scalar T @@ -132,6 +132,18 @@ inline Foam::scalar Foam::Boussinesq::S } +template +inline Foam::scalar Foam::Boussinesq::Sv +( + scalar p, + scalar T +) const +{ + NotImplemented; + return 0; +} + + template inline Foam::scalar Foam::Boussinesq::psi ( diff --git a/src/thermophysicalModels/specie/equationOfState/PengRobinsonGas/PengRobinsonGas.H b/src/thermophysicalModels/specie/equationOfState/PengRobinsonGas/PengRobinsonGas.H index 88a4ee1fd8..44212a6bd9 100644 --- a/src/thermophysicalModels/specie/equationOfState/PengRobinsonGas/PengRobinsonGas.H +++ b/src/thermophysicalModels/specie/equationOfState/PengRobinsonGas/PengRobinsonGas.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -167,8 +167,11 @@ public: //- Return Cv departure [J/(kg K] inline scalar Cv(scalar p, scalar T) const; - //- Return entropy [J/kg/K] - inline scalar S(const scalar p, const scalar T) const; + //- Return entropy correction to the integral of Cp/T [J/kg/K] + inline scalar Sp(const scalar p, const scalar T) const; + + //- Return entropy correction to the integral of Cv/T [J/kg/K] + inline scalar Sv(const scalar p, const scalar T) const; //- Return compressibility [s^2/m^2] inline scalar psi(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/specie/equationOfState/PengRobinsonGas/PengRobinsonGasI.H b/src/thermophysicalModels/specie/equationOfState/PengRobinsonGas/PengRobinsonGasI.H index 9576e11500..b99d6e6362 100644 --- a/src/thermophysicalModels/specie/equationOfState/PengRobinsonGas/PengRobinsonGasI.H +++ b/src/thermophysicalModels/specie/equationOfState/PengRobinsonGas/PengRobinsonGasI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -203,7 +203,7 @@ inline Foam::scalar Foam::PengRobinsonGas::Cv(scalar p, scalar T) const template -inline Foam::scalar Foam::PengRobinsonGas::S +inline Foam::scalar Foam::PengRobinsonGas::Sp ( scalar p, scalar T @@ -229,6 +229,18 @@ inline Foam::scalar Foam::PengRobinsonGas::S } +template +inline Foam::scalar Foam::PengRobinsonGas::Sv +( + scalar p, + scalar T +) const +{ + NotImplemented; + return 0; +} + + template inline Foam::scalar Foam::PengRobinsonGas::psi ( diff --git a/src/thermophysicalModels/specie/equationOfState/adiabaticPerfectFluid/adiabaticPerfectFluid.H b/src/thermophysicalModels/specie/equationOfState/adiabaticPerfectFluid/adiabaticPerfectFluid.H index 59ce65bf6a..4fd0c4fd8d 100644 --- a/src/thermophysicalModels/specie/equationOfState/adiabaticPerfectFluid/adiabaticPerfectFluid.H +++ b/src/thermophysicalModels/specie/equationOfState/adiabaticPerfectFluid/adiabaticPerfectFluid.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -169,8 +169,11 @@ public: //- Return Cv departure [J/(kg K] inline scalar Cv(scalar p, scalar T) const; - //- Return entropy [J/kg/K] - inline scalar S(const scalar p, const scalar T) const; + //- Return entropy correction to the integral of Cp/T [J/kg/K] + inline scalar Sp(const scalar p, const scalar T) const; + + //- Return entropy correction to the integral of Cv/T [J/kg/K] + inline scalar Sv(const scalar p, const scalar T) const; //- Return compressibility [s^2/m^2] inline scalar psi(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/specie/equationOfState/adiabaticPerfectFluid/adiabaticPerfectFluidI.H b/src/thermophysicalModels/specie/equationOfState/adiabaticPerfectFluid/adiabaticPerfectFluidI.H index 593649a43d..54718b80af 100644 --- a/src/thermophysicalModels/specie/equationOfState/adiabaticPerfectFluid/adiabaticPerfectFluidI.H +++ b/src/thermophysicalModels/specie/equationOfState/adiabaticPerfectFluid/adiabaticPerfectFluidI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -147,7 +147,7 @@ inline Foam::scalar Foam::adiabaticPerfectFluid::Cv template -inline Foam::scalar Foam::adiabaticPerfectFluid::S +inline Foam::scalar Foam::adiabaticPerfectFluid::Sp ( scalar p, scalar T @@ -160,6 +160,18 @@ inline Foam::scalar Foam::adiabaticPerfectFluid::S } +template +inline Foam::scalar Foam::adiabaticPerfectFluid::Sv +( + scalar p, + scalar T +) const +{ + NotImplemented; + return 0; +} + + template inline Foam::scalar Foam::adiabaticPerfectFluid::psi ( diff --git a/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomial.H b/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomial.H index 200f0fe321..ce0396d195 100644 --- a/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomial.H +++ b/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomial.H @@ -176,8 +176,11 @@ public: //- Return Cv departure [J/(kg K] inline scalar Cv(scalar p, scalar T) const; - //- Return entropy [J/kg/K] - inline scalar S(const scalar p, const scalar T) const; + //- Return entropy correction to the integral of Cp/T [J/kg/K] + inline scalar Sp(const scalar p, const scalar T) const; + + //- Return entropy correction to the integral of Cv/T [J/kg/K] + inline scalar Sv(const scalar p, const scalar T) const; //- Return compressibility [s^2/m^2] inline scalar psi(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomialI.H b/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomialI.H index 6c3c307a86..d3344a1263 100644 --- a/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomialI.H +++ b/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomialI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -133,7 +133,18 @@ inline Foam::scalar Foam::icoPolynomial::Cv template -inline Foam::scalar Foam::icoPolynomial::S +inline Foam::scalar Foam::icoPolynomial::Sp +( + scalar p, + scalar T +) const +{ + return 0; +} + + +template +inline Foam::scalar Foam::icoPolynomial::Sv ( scalar p, scalar T diff --git a/src/thermophysicalModels/specie/equationOfState/icoTabulated/icoTabulated.H b/src/thermophysicalModels/specie/equationOfState/icoTabulated/icoTabulated.H index 39a9a7f726..c78ebc7d8a 100644 --- a/src/thermophysicalModels/specie/equationOfState/icoTabulated/icoTabulated.H +++ b/src/thermophysicalModels/specie/equationOfState/icoTabulated/icoTabulated.H @@ -153,8 +153,11 @@ public: //- Return Cv departure [J/(kg K] inline scalar Cv(scalar p, scalar T) const; - //- Return entropy [J/kg/K] - inline scalar S(const scalar p, const scalar T) const; + //- Return entropy correction to the integral of Cp/T [J/kg/K] + inline scalar Sp(const scalar p, const scalar T) const; + + //- Return entropy correction to the integral of Cv/T [J/kg/K] + inline scalar Sv(const scalar p, const scalar T) const; //- Return compressibility [s^2/m^2] inline scalar psi(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/specie/equationOfState/icoTabulated/icoTabulatedI.H b/src/thermophysicalModels/specie/equationOfState/icoTabulated/icoTabulatedI.H index cf16be053e..07dd46d43c 100644 --- a/src/thermophysicalModels/specie/equationOfState/icoTabulated/icoTabulatedI.H +++ b/src/thermophysicalModels/specie/equationOfState/icoTabulated/icoTabulatedI.H @@ -133,7 +133,18 @@ inline Foam::scalar Foam::icoTabulated::Cv template -inline Foam::scalar Foam::icoTabulated::S +inline Foam::scalar Foam::icoTabulated::Sp +( + scalar p, + scalar T +) const +{ + return 0; +} + + +template +inline Foam::scalar Foam::icoTabulated::Sv ( scalar p, scalar T diff --git a/src/thermophysicalModels/specie/equationOfState/incompressiblePerfectGas/incompressiblePerfectGas.H b/src/thermophysicalModels/specie/equationOfState/incompressiblePerfectGas/incompressiblePerfectGas.H index 1321317b3c..0020e0ed02 100644 --- a/src/thermophysicalModels/specie/equationOfState/incompressiblePerfectGas/incompressiblePerfectGas.H +++ b/src/thermophysicalModels/specie/equationOfState/incompressiblePerfectGas/incompressiblePerfectGas.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -154,8 +154,11 @@ public: //- Return Cv departure [J/(kg K] inline scalar Cv(scalar p, scalar T) const; - //- Return entropy [J/kg/K] - inline scalar S(const scalar p, const scalar T) const; + //- Return entropy correction to the integral of Cp/T [J/kg/K] + inline scalar Sp(const scalar p, const scalar T) const; + + //- Return entropy correction to the integral of Cv/T [J/kg/K] + inline scalar Sv(const scalar p, const scalar T) const; //- Return compressibility [s^2/m^2] inline scalar psi(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/specie/equationOfState/incompressiblePerfectGas/incompressiblePerfectGasI.H b/src/thermophysicalModels/specie/equationOfState/incompressiblePerfectGas/incompressiblePerfectGasI.H index 4486de6272..06640c2fd0 100644 --- a/src/thermophysicalModels/specie/equationOfState/incompressiblePerfectGas/incompressiblePerfectGasI.H +++ b/src/thermophysicalModels/specie/equationOfState/incompressiblePerfectGas/incompressiblePerfectGasI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -134,7 +134,18 @@ inline Foam::scalar Foam::incompressiblePerfectGas::Cv template -inline Foam::scalar Foam::incompressiblePerfectGas::S +inline Foam::scalar Foam::incompressiblePerfectGas::Sp +( + scalar p, + scalar T +) const +{ + return 0; +} + + +template +inline Foam::scalar Foam::incompressiblePerfectGas::Sv ( scalar p, scalar T diff --git a/src/thermophysicalModels/specie/equationOfState/linear/linear.H b/src/thermophysicalModels/specie/equationOfState/linear/linear.H index c8aac35688..9813d8e851 100644 --- a/src/thermophysicalModels/specie/equationOfState/linear/linear.H +++ b/src/thermophysicalModels/specie/equationOfState/linear/linear.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -158,8 +158,11 @@ public: //- Return Cv departure [J/(kg K] inline scalar Cv(scalar p, scalar T) const; - //- Return entropy [J/kg/K] - inline scalar S(const scalar p, const scalar T) const; + //- Return entropy correction to the integral of Cp/T [J/kg/K] + inline scalar Sp(const scalar p, const scalar T) const; + + //- Return entropy correction to the integral of Cv/T [J/kg/K] + inline scalar Sv(const scalar p, const scalar T) const; //- Return compressibility [s^2/m^2] inline scalar psi(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/specie/equationOfState/linear/linearI.H b/src/thermophysicalModels/specie/equationOfState/linear/linearI.H index ced54ac47f..e96c8e2b5f 100644 --- a/src/thermophysicalModels/specie/equationOfState/linear/linearI.H +++ b/src/thermophysicalModels/specie/equationOfState/linear/linearI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -115,12 +115,20 @@ inline Foam::scalar Foam::linear::Cv(scalar p, scalar T) const template -inline Foam::scalar Foam::linear::S(scalar p, scalar T) const +inline Foam::scalar Foam::linear::Sp(scalar p, scalar T) const { return -log((rho0_ + psi_*p)/(rho0_ + psi_*Pstd))/(T*psi_); } +template +inline Foam::scalar Foam::linear::Sv(scalar p, scalar T) const +{ + NotImplemented; + return 0; +} + + template inline Foam::scalar Foam::linear::psi(scalar p, scalar T) const { diff --git a/src/thermophysicalModels/specie/equationOfState/perfectFluid/perfectFluid.H b/src/thermophysicalModels/specie/equationOfState/perfectFluid/perfectFluid.H index 495fd5f79c..d3b8948d4c 100644 --- a/src/thermophysicalModels/specie/equationOfState/perfectFluid/perfectFluid.H +++ b/src/thermophysicalModels/specie/equationOfState/perfectFluid/perfectFluid.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -161,8 +161,11 @@ public: //- Return Cv departure [J/(kg K] inline scalar Cv(scalar p, scalar T) const; - //- Return entropy [J/kg/K] - inline scalar S(const scalar p, const scalar T) const; + //- Return entropy correction to the integral of Cp/T [J/kg/K] + inline scalar Sp(const scalar p, const scalar T) const; + + //- Return entropy correction to the integral of Cv/T [J/kg/K] + inline scalar Sv(const scalar p, const scalar T) const; //- Return compressibility [s^2/m^2] inline scalar psi(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/specie/equationOfState/perfectFluid/perfectFluidI.H b/src/thermophysicalModels/specie/equationOfState/perfectFluid/perfectFluidI.H index 933908c86b..4bb0b89b02 100644 --- a/src/thermophysicalModels/specie/equationOfState/perfectFluid/perfectFluidI.H +++ b/src/thermophysicalModels/specie/equationOfState/perfectFluid/perfectFluidI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -122,12 +122,20 @@ inline Foam::scalar Foam::perfectFluid::Cv(scalar p, scalar T) const template -inline Foam::scalar Foam::perfectFluid::S(scalar p, scalar T) const +inline Foam::scalar Foam::perfectFluid::Sp(scalar p, scalar T) const { return -this->R()*log(p/Pstd); } +template +inline Foam::scalar Foam::perfectFluid::Sv(scalar p, scalar T) const +{ + NotImplemented; + return 0; +} + + template inline Foam::scalar Foam::perfectFluid::psi(scalar p, scalar T) const { diff --git a/src/thermophysicalModels/specie/equationOfState/perfectGas/perfectGas.H b/src/thermophysicalModels/specie/equationOfState/perfectGas/perfectGas.H index 5cdd38f380..a20d658cb7 100644 --- a/src/thermophysicalModels/specie/equationOfState/perfectGas/perfectGas.H +++ b/src/thermophysicalModels/specie/equationOfState/perfectGas/perfectGas.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -138,8 +138,11 @@ public: //- Return Cv departure [J/(kg K] inline scalar Cv(scalar p, scalar T) const; - //- Return entropy [J/kg/K] - inline scalar S(const scalar p, const scalar T) const; + //- Return entropy correction to the integral of Cp/T [J/kg/K] + inline scalar Sp(const scalar p, const scalar T) const; + + //- Return entropy correction to the integral of Cv/T [J/kg/K] + inline scalar Sv(const scalar p, const scalar T) const; //- Return compressibility [s^2/m^2] inline scalar psi(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/specie/equationOfState/perfectGas/perfectGasI.H b/src/thermophysicalModels/specie/equationOfState/perfectGas/perfectGasI.H index ce89af1d2a..a56208fd6b 100644 --- a/src/thermophysicalModels/specie/equationOfState/perfectGas/perfectGasI.H +++ b/src/thermophysicalModels/specie/equationOfState/perfectGas/perfectGasI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -103,12 +103,20 @@ inline Foam::scalar Foam::perfectGas::Cv(scalar p, scalar T) const template -inline Foam::scalar Foam::perfectGas::S(scalar p, scalar T) const +inline Foam::scalar Foam::perfectGas::Sp(scalar p, scalar T) const { return -this->R()*log(p/Pstd); } +template +inline Foam::scalar Foam::perfectGas::Sv(scalar p, scalar T) const +{ + NotImplemented; + return 0; +} + + template inline Foam::scalar Foam::perfectGas::psi(scalar p, scalar T) const { diff --git a/src/thermophysicalModels/specie/equationOfState/rPolynomial/rPolynomial.H b/src/thermophysicalModels/specie/equationOfState/rPolynomial/rPolynomial.H index 2512bd412a..8fd2ac9825 100644 --- a/src/thermophysicalModels/specie/equationOfState/rPolynomial/rPolynomial.H +++ b/src/thermophysicalModels/specie/equationOfState/rPolynomial/rPolynomial.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -193,8 +193,11 @@ public: //- Return Cv departure [J/(kg K] inline scalar Cv(scalar p, scalar T) const; - //- Return entropy [J/kg/K] - inline scalar S(const scalar p, const scalar T) const; + //- Return entropy correction to the integral of Cp/T [J/kg/K] + inline scalar Sp(const scalar p, const scalar T) const; + + //- Return entropy correction to the integral of Cv/T [J/kg/K] + inline scalar Sv(const scalar p, const scalar T) const; //- Return compressibility [s^2/m^2] inline scalar psi(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/specie/equationOfState/rPolynomial/rPolynomialI.H b/src/thermophysicalModels/specie/equationOfState/rPolynomial/rPolynomialI.H index e1758b58bc..8a21c1c2b5 100644 --- a/src/thermophysicalModels/specie/equationOfState/rPolynomial/rPolynomialI.H +++ b/src/thermophysicalModels/specie/equationOfState/rPolynomial/rPolynomialI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -110,12 +110,20 @@ inline Foam::scalar Foam::rPolynomial::Cv(scalar p, scalar T) const template -inline Foam::scalar Foam::rPolynomial::S(scalar p, scalar T) const +inline Foam::scalar Foam::rPolynomial::Sp(scalar p, scalar T) const { return 0; } +template +inline Foam::scalar Foam::rPolynomial::Sv(scalar p, scalar T) const +{ + NotImplemented + return 0; +} + + template inline Foam::scalar Foam::rPolynomial::psi(scalar p, scalar T) const { diff --git a/src/thermophysicalModels/specie/equationOfState/rhoConst/rhoConst.H b/src/thermophysicalModels/specie/equationOfState/rhoConst/rhoConst.H index 3725802afd..612ef23313 100644 --- a/src/thermophysicalModels/specie/equationOfState/rhoConst/rhoConst.H +++ b/src/thermophysicalModels/specie/equationOfState/rhoConst/rhoConst.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -140,8 +140,11 @@ public: //- Return Cv departure [J/(kg K] inline scalar Cv(scalar p, scalar T) const; - //- Return entropy [J/kg/K] - inline scalar S(const scalar p, const scalar T) const; + //- Return entropy correction to the integral of Cp/T [J/kg/K] + inline scalar Sp(const scalar p, const scalar T) const; + + //- Return entropy correction to the integral of Cv/T [J/kg/K] + inline scalar Sv(const scalar p, const scalar T) const; //- Return compressibility [s^2/m^2] inline scalar psi(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/specie/equationOfState/rhoConst/rhoConstI.H b/src/thermophysicalModels/specie/equationOfState/rhoConst/rhoConstI.H index d32d08cdb4..f21c19b3d6 100644 --- a/src/thermophysicalModels/specie/equationOfState/rhoConst/rhoConstI.H +++ b/src/thermophysicalModels/specie/equationOfState/rhoConst/rhoConstI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -99,7 +99,14 @@ inline Foam::scalar Foam::rhoConst::Cv(scalar p, scalar T) const template -inline Foam::scalar Foam::rhoConst::S(scalar p, scalar T) const +inline Foam::scalar Foam::rhoConst::Sp(scalar p, scalar T) const +{ + return 0; +} + + +template +inline Foam::scalar Foam::rhoConst::Sv(scalar p, scalar T) const { return 0; } diff --git a/src/thermophysicalModels/specie/thermo/eConst/eConstThermoI.H b/src/thermophysicalModels/specie/thermo/eConst/eConstThermoI.H index f5a49845b8..ef0a53e80d 100644 --- a/src/thermophysicalModels/specie/thermo/eConst/eConstThermoI.H +++ b/src/thermophysicalModels/specie/thermo/eConst/eConstThermoI.H @@ -141,8 +141,7 @@ inline Foam::scalar Foam::eConstThermo::S const scalar T ) const { - return Cp(p, T)*log(T/Tstd) - + EquationOfState::S(p, T); // Requires EquationOfState::S for Cv + return Cp(p, T)*log(T/Tstd) + EquationOfState::Sv(p, T); } @@ -165,6 +164,7 @@ inline Foam::scalar Foam::eConstThermo::dCpdT const scalar T ) const { + NotImplemented; return 0; // EquationOfState::dCpdT } diff --git a/src/thermophysicalModels/specie/thermo/ePolynomial/ePolynomialThermoI.H b/src/thermophysicalModels/specie/thermo/ePolynomial/ePolynomialThermoI.H index ee79ca2303..5f3bb001b0 100644 --- a/src/thermophysicalModels/specie/thermo/ePolynomial/ePolynomialThermoI.H +++ b/src/thermophysicalModels/specie/thermo/ePolynomial/ePolynomialThermoI.H @@ -125,8 +125,7 @@ inline Foam::scalar Foam::ePolynomialThermo::S const scalar T ) const { - return sCoeffs_.value(T) - + EquationOfState::S(p, T); // Requires EquationOfState::S for Cv + return sCoeffs_.value(T) + EquationOfState::Sv(p, T); } @@ -149,6 +148,7 @@ inline Foam::scalar Foam::ePolynomialThermo::dCpdT const scalar T ) const { + NotImplemented; return CvCoeffs_.derivative(T); // + EquationOfState::dCpdT } diff --git a/src/thermophysicalModels/specie/thermo/ePower/ePowerThermoI.H b/src/thermophysicalModels/specie/thermo/ePower/ePowerThermoI.H index c768e1a7be..c3cdf927dc 100644 --- a/src/thermophysicalModels/specie/thermo/ePower/ePowerThermoI.H +++ b/src/thermophysicalModels/specie/thermo/ePower/ePowerThermoI.H @@ -164,7 +164,7 @@ inline Foam::scalar Foam::ePowerThermo::S { return c0_*(pow(T, n0_) - pow(Tstd, n0_))/(pow(Tref_, n0_)*n0_) - + EquationOfState::S(p, T); // Requires EquationOfState::S for Cv + + EquationOfState::Sv(p, T); } @@ -188,7 +188,6 @@ inline Foam::scalar Foam::ePowerThermo::dCpdT const scalar T ) const { - // To be implemented NotImplemented; return 0; // + EquationOfState::dCpdT } diff --git a/src/thermophysicalModels/specie/thermo/hConst/hConstThermoI.H b/src/thermophysicalModels/specie/thermo/hConst/hConstThermoI.H index ff2383d79a..92cd901405 100644 --- a/src/thermophysicalModels/specie/thermo/hConst/hConstThermoI.H +++ b/src/thermophysicalModels/specie/thermo/hConst/hConstThermoI.H @@ -141,7 +141,7 @@ inline Foam::scalar Foam::hConstThermo::S const scalar T ) const { - return Cp_*log(T/Tstd) + EquationOfState::S(p, T); + return Cp_*log(T/Tstd) + EquationOfState::Sp(p, T); } diff --git a/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermoI.H b/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermoI.H index 16e16a64ad..adebf41def 100644 --- a/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermoI.H +++ b/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermoI.H @@ -125,7 +125,7 @@ inline Foam::scalar Foam::hPolynomialThermo::S const scalar T ) const { - return sCoeffs_.value(T) + EquationOfState::S(p, T); + return sCoeffs_.value(T) + EquationOfState::Sp(p, T); } diff --git a/src/thermophysicalModels/specie/thermo/hPower/hPowerThermoI.H b/src/thermophysicalModels/specie/thermo/hPower/hPowerThermoI.H index 3463fa05e7..d1c8bb9f5d 100644 --- a/src/thermophysicalModels/specie/thermo/hPower/hPowerThermoI.H +++ b/src/thermophysicalModels/specie/thermo/hPower/hPowerThermoI.H @@ -164,7 +164,7 @@ inline Foam::scalar Foam::hPowerThermo::S { return c0_*(pow(T, n0_) - pow(Tstd, n0_))/(pow(Tref_, n0_)*n0_) - + EquationOfState::S(p, T); + + EquationOfState::Sp(p, T); } diff --git a/src/thermophysicalModels/specie/thermo/hTabulated/hTabulatedThermoI.H b/src/thermophysicalModels/specie/thermo/hTabulated/hTabulatedThermoI.H index 9f80f02964..111d2b415a 100644 --- a/src/thermophysicalModels/specie/thermo/hTabulated/hTabulatedThermoI.H +++ b/src/thermophysicalModels/specie/thermo/hTabulated/hTabulatedThermoI.H @@ -101,7 +101,7 @@ inline Foam::scalar Foam::hTabulatedThermo::S const scalar T ) const { - return Cp_.intfByTdT(p, T) + EquationOfState::S(p, T) + Sf_; + return Cp_.intfByTdT(p, T) + EquationOfState::Sp(p, T) + Sf_; } diff --git a/src/thermophysicalModels/specie/thermo/janaf/janafThermoI.H b/src/thermophysicalModels/specie/thermo/janaf/janafThermoI.H index e83828b154..30cd258331 100644 --- a/src/thermophysicalModels/specie/thermo/janaf/janafThermoI.H +++ b/src/thermophysicalModels/specie/thermo/janaf/janafThermoI.H @@ -233,7 +233,7 @@ inline Foam::scalar Foam::janafThermo::S ( (((a[4]/4.0*T + a[3]/3.0)*T + a[2]/2.0)*T + a[1])*T + a[0]*log(T) + a[6] - ) + EquationOfState::S(p, T); + ) + EquationOfState::Sp(p, T); }