diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermo.H b/src/thermophysicalModels/basic/basicThermo/basicThermo.H index b3094c26..e0392f53 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermo.H +++ b/src/thermophysicalModels/basic/basicThermo/basicThermo.H @@ -314,7 +314,24 @@ public: const scalarField& T, const label patchi ) const = 0; + + + // Entropy for given pressure and temperature [J/kg-K] + virtual tmp Se + ( + const volScalarField& p, + const volScalarField& T + ) const = 0; + + // Gibbs free energy for given pressure and temperature [J/kg] + virtual tmp G + ( + const volScalarField& p, + const volScalarField& T + ) const = 0; + + //- Absolute enthalpy [J/kg] virtual tmp ha() const = 0; diff --git a/src/thermophysicalModels/basic/heThermo/heThermo.C b/src/thermophysicalModels/basic/heThermo/heThermo.C index 1e293921..c9d34531 100644 --- a/src/thermophysicalModels/basic/heThermo/heThermo.C +++ b/src/thermophysicalModels/basic/heThermo/heThermo.C @@ -57,7 +57,6 @@ Foam::heThermo::volScalarFieldProperty psiDim ) ); - volScalarField& psi = tPsi.ref(); forAll(this->T_, celli) @@ -66,7 +65,6 @@ Foam::heThermo::volScalarFieldProperty } volScalarField::Boundary& psiBf = psi.boundaryFieldRef(); - forAll(psiBf, patchi) { fvPatchScalarField& pPsi = psiBf[patchi]; @@ -485,6 +483,45 @@ Foam::tmp Foam::heThermo::ha ); } +template +Foam::tmp Foam::heThermo::Se +( + const volScalarField& p, + const volScalarField& T +) const +{ + return volScalarFieldProperty + ( + "S", + dimEnergy/(dimMass*dimTemperature), + &MixtureType::cellThermoMixture, + &MixtureType::patchFaceThermoMixture, + &MixtureType::thermoMixtureType::Se, + p, + T + ); +} + +template +Foam::tmp Foam::heThermo::G +( + const volScalarField& p, + const volScalarField& T +) const +{ + return volScalarFieldProperty + ( + "G", + dimEnergy/dimMass, + &MixtureType::cellThermoMixture, + &MixtureType::patchFaceThermoMixture, + &MixtureType::thermoMixtureType::G, + p, + T + ); + +} + template Foam::tmp diff --git a/src/thermophysicalModels/basic/heThermo/heThermo.H b/src/thermophysicalModels/basic/heThermo/heThermo.H index 1b166dfe..3dab3a83 100644 --- a/src/thermophysicalModels/basic/heThermo/heThermo.H +++ b/src/thermophysicalModels/basic/heThermo/heThermo.H @@ -274,6 +274,23 @@ public: const labelList& cells ) const; + + + // entropy for given pressure and temperature [J/kg-K] + virtual tmp Se + ( + const volScalarField& p, + const volScalarField& T + ) const; + + // gibbs free energy for given pressure and temperature [J/kg] + virtual tmp G + ( + const volScalarField& p, + const volScalarField& T + ) const; + + //- Enthalpy of formation [J/kg] virtual tmp hc() const; diff --git a/src/thermophysicalModels/reactionThermo/mixtures/valueMultiComponentMixture/valueMultiComponentMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/valueMultiComponentMixture/valueMultiComponentMixture.C index 527c9055..fdd0bd9b 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/valueMultiComponentMixture/valueMultiComponentMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/valueMultiComponentMixture/valueMultiComponentMixture.C @@ -194,6 +194,8 @@ thermoMixtureFunction(Cpv) thermoMixtureFunction(gamma) thermoMixtureFunction(CpByCpv) thermoMixtureFunction(HE) +thermoMixtureFunction(Se) +thermoMixtureFunction(G) template diff --git a/src/thermophysicalModels/reactionThermo/mixtures/valueMultiComponentMixture/valueMultiComponentMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/valueMultiComponentMixture/valueMultiComponentMixture.H index 9f10b61e..5f186c9e 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/valueMultiComponentMixture/valueMultiComponentMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/valueMultiComponentMixture/valueMultiComponentMixture.H @@ -116,6 +116,14 @@ public: // Absolute enthalpy [J/kg] scalar Ha(const scalar p, const scalar T) const; + // entropy[J/kg-K] + scalar Se(const scalar p, const scalar T) const; + + + // gibbs free energy[J/kg] + scalar G(const scalar p, const scalar T) const; + + // Enthalpy of formation [J/kg] scalar Hf() const; diff --git a/src/thermophysicalModels/specie/thermo/thermo/thermo.H b/src/thermophysicalModels/specie/thermo/thermo/thermo.H index d26d375a..d62592a9 100644 --- a/src/thermophysicalModels/specie/thermo/thermo/thermo.H +++ b/src/thermophysicalModels/specie/thermo/thermo/thermo.H @@ -181,7 +181,10 @@ public: //- Helmholtz free energy [J/kg] inline scalar A(const scalar p, const scalar T) const; - + //- Entropy name Se to avoid conflict [J/kg-K] + inline scalar Se(const scalar p, const scalar T) const; + + // Mole specific derived properties //- Heat capacity at constant pressure [J/kmol/K] diff --git a/src/thermophysicalModels/specie/thermo/thermo/thermoI.H b/src/thermophysicalModels/specie/thermo/thermo/thermoI.H index e330ae4e..155eba17 100644 --- a/src/thermophysicalModels/specie/thermo/thermo/thermoI.H +++ b/src/thermophysicalModels/specie/thermo/thermo/thermoI.H @@ -111,6 +111,14 @@ Foam::species::thermo::A(const scalar p, const scalar T) const return this->Ea(p, T) - T*this->S(p, T); } +template class Type> +inline Foam::scalar +Foam::species::thermo::Se(const scalar p, const scalar T) const +{ + return this->S(p, T); +} + + template class Type> inline Foam::scalar