diff --git a/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.C index d7d312735d79232193697cb45906728e546ed67d..014ef3da510e3a7a24d89185332ec589cde986d9 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.C @@ -97,4 +97,189 @@ void Foam::dieselMixture<ThermoType>::read(const dictionary& thermoDict) } +template<class ThermoType> +const ThermoType& Foam::dieselMixture<ThermoType>::getLocalThermo +( + const label specieI +) const +{ + if (specieI == 0) + { + return fuel_; + } + else if (specieI == 1) + { + return oxidant_; + } + else if (specieI == 2) + { + return products_; + } + else + { + FatalErrorIn + ( + "const ThermoType& Foam::dieselMixture<ThermoType>::getLocalThermo" + "(" + "const label " + ") const" + ) << "Unknown specie index " << specieI << ". Valid indices are 0..2" + << abort(FatalError); + + return fuel_; + } +} + + +template<class ThermoType> +Foam::scalar Foam::dieselMixture<ThermoType>::nMoles +( + const label specieI +) const +{ + return getLocalThermo(specieI).nMoles(); +} + + +template<class ThermoType> +Foam::scalar Foam::dieselMixture<ThermoType>::W +( + const label specieI +) const +{ + return getLocalThermo(specieI).W(); +} + + +template<class ThermoType> +Foam::scalar Foam::dieselMixture<ThermoType>::Cp +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Cp(T); +} + + +template<class ThermoType> +Foam::scalar Foam::dieselMixture<ThermoType>::Cv +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Cv(T); +} + + +template<class ThermoType> +Foam::scalar Foam::dieselMixture<ThermoType>::H +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).H(T); +} + + +template<class ThermoType> +Foam::scalar Foam::dieselMixture<ThermoType>::Hs +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Hs(T); +} + + +template<class ThermoType> +Foam::scalar Foam::dieselMixture<ThermoType>::Hc +( + const label specieI +) const +{ + return getLocalThermo(specieI).Hc(); +} + + +template<class ThermoType> +Foam::scalar Foam::dieselMixture<ThermoType>::S +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).S(T); +} + + +template<class ThermoType> +Foam::scalar Foam::dieselMixture<ThermoType>::E +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).E(T); +} + + +template<class ThermoType> +Foam::scalar Foam::dieselMixture<ThermoType>::G +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).G(T); +} + + +template<class ThermoType> +Foam::scalar Foam::dieselMixture<ThermoType>::A +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).A(T); +} + + +template<class ThermoType> +Foam::scalar Foam::dieselMixture<ThermoType>::mu +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).mu(T); +} + + +template<class ThermoType> +Foam::scalar Foam::dieselMixture<ThermoType>::kappa +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).kappa(T); +} + + +template<class ThermoType> +Foam::scalar Foam::dieselMixture<ThermoType>::alpha +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).alpha(T); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.H index b0b46a88cc679a097810e053cece1e454560129a..8625818a58736b526bdacb11d26890dd39849210 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.H @@ -151,6 +151,60 @@ public: //- Read dictionary void read(const dictionary&); + + //- Return thermo based on index + const ThermoType& getLocalThermo(const label specieI) const; + + + // Per specie properties + + //- Number of moles [] + virtual scalar nMoles(const label specieI) const; + + //- Molecular weight [kg/kmol] + virtual scalar W(const label specieI) const; + + + // Per specie thermo properties + + //- Heat capacity at constant pressure [J/(kg K)] + virtual scalar Cp(const label specieI, const scalar T) const; + + //- Heat capacity at constant volume [J/(kg K)] + virtual scalar Cv(const label specieI, const scalar T) const; + + //- Enthalpy [J/kg] + virtual scalar H(const label specieI, const scalar T) const; + + //- Sensible enthalpy [J/kg] + virtual scalar Hs(const label specieI, const scalar T) const; + + //- Chemical enthalpy [J/kg] + virtual scalar Hc(const label specieI) const; + + //- Entropy [J/(kg K)] + virtual scalar S(const label specieI, const scalar T) const; + + //- Internal energy [J/kg] + virtual scalar E(const label specieI, const scalar T) const; + + //- Gibbs free energy [J/kg] + virtual scalar G(const label specieI, const scalar T) const; + + //- Helmholtz free energy [J/kg] + virtual scalar A(const label specieI, const scalar T) const; + + + // Per specie transport properties + + //- Dynamic viscosity [kg/m/s] + virtual scalar mu(const label specieI, const scalar T) const; + + //- Thermal conductivity [W/m/K] + virtual scalar kappa(const label specieI, const scalar T) const; + + //- Thermal diffusivity [kg/m/s] + virtual scalar alpha(const label specieI, const scalar T) const; }; diff --git a/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.C index 7ba65975e822676bbe9fcff361c4a7080835066f..06cf80a47f4226b5e77c3e91636856499a9fda94 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.C @@ -107,4 +107,189 @@ void Foam::egrMixture<ThermoType>::read(const dictionary& thermoDict) } +template<class ThermoType> +const ThermoType& Foam::egrMixture<ThermoType>::getLocalThermo +( + const label specieI +) const +{ + if (specieI == 0) + { + return fuel_; + } + else if (specieI == 1) + { + return oxidant_; + } + else if (specieI == 2) + { + return products_; + } + else + { + FatalErrorIn + ( + "const ThermoType& Foam::egrMixture<ThermoType>::getLocalThermo" + "(" + "const label " + ") const" + ) << "Unknown specie index " << specieI << ". Valid indices are 0..2" + << abort(FatalError); + + return fuel_; + } +} + + +template<class ThermoType> +Foam::scalar Foam::egrMixture<ThermoType>::nMoles +( + const label specieI +) const +{ + return getLocalThermo(specieI).nMoles(); +} + + +template<class ThermoType> +Foam::scalar Foam::egrMixture<ThermoType>::W +( + const label specieI +) const +{ + return getLocalThermo(specieI).W(); +} + + +template<class ThermoType> +Foam::scalar Foam::egrMixture<ThermoType>::Cp +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Cp(T); +} + + +template<class ThermoType> +Foam::scalar Foam::egrMixture<ThermoType>::Cv +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Cv(T); +} + + +template<class ThermoType> +Foam::scalar Foam::egrMixture<ThermoType>::H +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).H(T); +} + + +template<class ThermoType> +Foam::scalar Foam::egrMixture<ThermoType>::Hs +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Hs(T); +} + + +template<class ThermoType> +Foam::scalar Foam::egrMixture<ThermoType>::Hc +( + const label specieI +) const +{ + return getLocalThermo(specieI).Hc(); +} + + +template<class ThermoType> +Foam::scalar Foam::egrMixture<ThermoType>::S +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).S(T); +} + + +template<class ThermoType> +Foam::scalar Foam::egrMixture<ThermoType>::E +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).E(T); +} + + +template<class ThermoType> +Foam::scalar Foam::egrMixture<ThermoType>::G +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).G(T); +} + + +template<class ThermoType> +Foam::scalar Foam::egrMixture<ThermoType>::A +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).A(T); +} + + +template<class ThermoType> +Foam::scalar Foam::egrMixture<ThermoType>::mu +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).mu(T); +} + + +template<class ThermoType> +Foam::scalar Foam::egrMixture<ThermoType>::kappa +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).kappa(T); +} + + +template<class ThermoType> +Foam::scalar Foam::egrMixture<ThermoType>::alpha +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).alpha(T); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.H index 0a9adf6aa72d2013737e3bbbdc4effa1e50eb390..95de13f321caac5b89b0ffad2bf8c337801c2adc 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.H @@ -167,6 +167,60 @@ public: //- Read dictionary void read(const dictionary&); + + //- Return thermo based on index + const ThermoType& getLocalThermo(const label specieI) const; + + + // Per specie properties + + //- Number of moles [] + virtual scalar nMoles(const label specieI) const; + + //- Molecular weight [kg/kmol] + virtual scalar W(const label specieI) const; + + + // Per specie thermo properties + + //- Heat capacity at constant pressure [J/(kg K)] + virtual scalar Cp(const label specieI, const scalar T) const; + + //- Heat capacity at constant volume [J/(kg K)] + virtual scalar Cv(const label specieI, const scalar T) const; + + //- Enthalpy [J/kg] + virtual scalar H(const label specieI, const scalar T) const; + + //- Sensible enthalpy [J/kg] + virtual scalar Hs(const label specieI, const scalar T) const; + + //- Chemical enthalpy [J/kg] + virtual scalar Hc(const label specieI) const; + + //- Entropy [J/(kg K)] + virtual scalar S(const label specieI, const scalar T) const; + + //- Internal energy [J/kg] + virtual scalar E(const label specieI, const scalar T) const; + + //- Gibbs free energy [J/kg] + virtual scalar G(const label specieI, const scalar T) const; + + //- Helmholtz free energy [J/kg] + virtual scalar A(const label specieI, const scalar T) const; + + + // Per specie transport properties + + //- Dynamic viscosity [kg/m/s] + virtual scalar mu(const label specieI, const scalar T) const; + + //- Thermal conductivity [W/m/K] + virtual scalar kappa(const label specieI, const scalar T) const; + + //- Thermal diffusivity [kg/m/s] + virtual scalar alpha(const label specieI, const scalar T) const; }; diff --git a/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.C index 89878ed40cbd9572e99d093b32bc36070687af0f..eca7ffd0d5c21dc91ca0b0e87f598e84936a76f2 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.C @@ -89,4 +89,186 @@ void Foam::homogeneousMixture<ThermoType>::read(const dictionary& thermoDict) } +template<class ThermoType> +const ThermoType& Foam::homogeneousMixture<ThermoType>::getLocalThermo +( + const label specieI +) const +{ + if (specieI == 0) + { + return reactants_; + } + else if (specieI == 1) + { + return products_; + } + else + { + FatalErrorIn + ( + "const ThermoType& Foam::homogeneousMixture<ThermoType>::" + "getLocalThermo" + "(" + "const label " + ") const" + ) << "Unknown specie index " << specieI << ". Valid indices are 0..1" + << abort(FatalError); + + return reactants_; + } +} + + +template<class ThermoType> +Foam::scalar Foam::homogeneousMixture<ThermoType>::nMoles +( + const label specieI +) const +{ + return getLocalThermo(specieI).nMoles(); +} + + +template<class ThermoType> +Foam::scalar Foam::homogeneousMixture<ThermoType>::W +( + const label specieI +) const +{ + return getLocalThermo(specieI).W(); +} + + +template<class ThermoType> +Foam::scalar Foam::homogeneousMixture<ThermoType>::Cp +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Cp(T); +} + + +template<class ThermoType> +Foam::scalar Foam::homogeneousMixture<ThermoType>::Cv +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Cv(T); +} + + +template<class ThermoType> +Foam::scalar Foam::homogeneousMixture<ThermoType>::H +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).H(T); +} + + +template<class ThermoType> +Foam::scalar Foam::homogeneousMixture<ThermoType>::Hs +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Hs(T); +} + + +template<class ThermoType> +Foam::scalar Foam::homogeneousMixture<ThermoType>::Hc +( + const label specieI +) const +{ + return getLocalThermo(specieI).Hc(); +} + + +template<class ThermoType> +Foam::scalar Foam::homogeneousMixture<ThermoType>::S +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).S(T); +} + + +template<class ThermoType> +Foam::scalar Foam::homogeneousMixture<ThermoType>::E +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).E(T); +} + + +template<class ThermoType> +Foam::scalar Foam::homogeneousMixture<ThermoType>::G +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).G(T); +} + + +template<class ThermoType> +Foam::scalar Foam::homogeneousMixture<ThermoType>::A +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).A(T); +} + + +template<class ThermoType> +Foam::scalar Foam::homogeneousMixture<ThermoType>::mu +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).mu(T); +} + + +template<class ThermoType> +Foam::scalar Foam::homogeneousMixture<ThermoType>::kappa +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).kappa(T); +} + + +template<class ThermoType> +Foam::scalar Foam::homogeneousMixture<ThermoType>::alpha +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).alpha(T); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.H index b03e63d7c7396e1f76a83db74f8791b1a6fc7165..a1fd589c8337eb40bd4a07376d56385f0f461f0e 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.H @@ -125,6 +125,60 @@ public: //- Read dictionary void read(const dictionary&); + + //- Return thermo based on index + const ThermoType& getLocalThermo(const label specieI) const; + + + // Per specie properties + + //- Number of moles [] + virtual scalar nMoles(const label specieI) const; + + //- Molecular weight [kg/kmol] + virtual scalar W(const label specieI) const; + + + // Per specie thermo properties + + //- Heat capacity at constant pressure [J/(kg K)] + virtual scalar Cp(const label specieI, const scalar T) const; + + //- Heat capacity at constant volume [J/(kg K)] + virtual scalar Cv(const label specieI, const scalar T) const; + + //- Enthalpy [J/kg] + virtual scalar H(const label specieI, const scalar T) const; + + //- Sensible enthalpy [J/kg] + virtual scalar Hs(const label specieI, const scalar T) const; + + //- Chemical enthalpy [J/kg] + virtual scalar Hc(const label specieI) const; + + //- Entropy [J/(kg K)] + virtual scalar S(const label specieI, const scalar T) const; + + //- Internal energy [J/kg] + virtual scalar E(const label specieI, const scalar T) const; + + //- Gibbs free energy [J/kg] + virtual scalar G(const label specieI, const scalar T) const; + + //- Helmholtz free energy [J/kg] + virtual scalar A(const label specieI, const scalar T) const; + + + // Per specie transport properties + + //- Dynamic viscosity [kg/m/s] + virtual scalar mu(const label specieI, const scalar T) const; + + //- Thermal conductivity [W/m/K] + virtual scalar kappa(const label specieI, const scalar T) const; + + //- Thermal diffusivity [kg/m/s] + virtual scalar alpha(const label specieI, const scalar T) const; }; diff --git a/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.C index 743aeff98b9c400d6d89494d100471bd37a7a64f..2ef52c112d097533aa13f2a0c21fbfdcc0b810c1 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.C @@ -101,4 +101,190 @@ void Foam::inhomogeneousMixture<ThermoType>::read(const dictionary& thermoDict) } +template<class ThermoType> +const ThermoType& Foam::inhomogeneousMixture<ThermoType>::getLocalThermo +( + const label specieI +) const +{ + if (specieI == 0) + { + return fuel_; + } + else if (specieI == 1) + { + return oxidant_; + } + else if (specieI == 2) + { + return products_; + } + else + { + FatalErrorIn + ( + "const ThermoType& Foam::inhomogeneousMixture<ThermoType>::" + "getLocalThermo" + "(" + "const label " + ") const" + ) << "Unknown specie index " << specieI << ". Valid indices are 0..2" + << abort(FatalError); + + return fuel_; + } +} + + +template<class ThermoType> +Foam::scalar Foam::inhomogeneousMixture<ThermoType>::nMoles +( + const label specieI +) const +{ + return getLocalThermo(specieI).nMoles(); +} + + +template<class ThermoType> +Foam::scalar Foam::inhomogeneousMixture<ThermoType>::W +( + const label specieI +) const +{ + return getLocalThermo(specieI).W(); +} + + +template<class ThermoType> +Foam::scalar Foam::inhomogeneousMixture<ThermoType>::Cp +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Cp(T); +} + + +template<class ThermoType> +Foam::scalar Foam::inhomogeneousMixture<ThermoType>::Cv +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Cv(T); +} + + +template<class ThermoType> +Foam::scalar Foam::inhomogeneousMixture<ThermoType>::H +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).H(T); +} + + +template<class ThermoType> +Foam::scalar Foam::inhomogeneousMixture<ThermoType>::Hs +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Hs(T); +} + + +template<class ThermoType> +Foam::scalar Foam::inhomogeneousMixture<ThermoType>::Hc +( + const label specieI +) const +{ + return getLocalThermo(specieI).Hc(); +} + + +template<class ThermoType> +Foam::scalar Foam::inhomogeneousMixture<ThermoType>::S +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).S(T); +} + + +template<class ThermoType> +Foam::scalar Foam::inhomogeneousMixture<ThermoType>::E +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).E(T); +} + + +template<class ThermoType> +Foam::scalar Foam::inhomogeneousMixture<ThermoType>::G +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).G(T); +} + + +template<class ThermoType> +Foam::scalar Foam::inhomogeneousMixture<ThermoType>::A +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).A(T); +} + + +template<class ThermoType> +Foam::scalar Foam::inhomogeneousMixture<ThermoType>::mu +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).mu(T); +} + + +template<class ThermoType> +Foam::scalar Foam::inhomogeneousMixture<ThermoType>::kappa +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).kappa(T); +} + + +template<class ThermoType> +Foam::scalar Foam::inhomogeneousMixture<ThermoType>::alpha +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).alpha(T); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.H index b4f9fc5f38fa71ef8ca4ac6df7547bae4c3f7db3..163052a84803bc8b1cd785845f6f2512c0a1d3cf 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.H @@ -156,6 +156,60 @@ public: //- Read dictionary void read(const dictionary&); + + //- Return thermo based on index + const ThermoType& getLocalThermo(const label specieI) const; + + + // Per specie properties + + //- Number of moles [] + virtual scalar nMoles(const label specieI) const; + + //- Molecular weight [kg/kmol] + virtual scalar W(const label specieI) const; + + + // Per specie thermo properties + + //- Heat capacity at constant pressure [J/(kg K)] + virtual scalar Cp(const label specieI, const scalar T) const; + + //- Heat capacity at constant volume [J/(kg K)] + virtual scalar Cv(const label specieI, const scalar T) const; + + //- Enthalpy [J/kg] + virtual scalar H(const label specieI, const scalar T) const; + + //- Sensible enthalpy [J/kg] + virtual scalar Hs(const label specieI, const scalar T) const; + + //- Chemical enthalpy [J/kg] + virtual scalar Hc(const label specieI) const; + + //- Entropy [J/(kg K)] + virtual scalar S(const label specieI, const scalar T) const; + + //- Internal energy [J/kg] + virtual scalar E(const label specieI, const scalar T) const; + + //- Gibbs free energy [J/kg] + virtual scalar G(const label specieI, const scalar T) const; + + //- Helmholtz free energy [J/kg] + virtual scalar A(const label specieI, const scalar T) const; + + + // Per specie transport properties + + //- Dynamic viscosity [kg/m/s] + virtual scalar mu(const label specieI, const scalar T) const; + + //- Thermal conductivity [W/m/K] + virtual scalar kappa(const label specieI, const scalar T) const; + + //- Thermal diffusivity [kg/m/s] + virtual scalar alpha(const label specieI, const scalar T) const; }; diff --git a/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.C index a8575e037cf80e0b606d96a5380f959533d09421..a30dd5dd1ba1defba758f5fcd8de5fbbbf7c6a6b 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.C @@ -160,4 +160,155 @@ void Foam::multiComponentMixture<ThermoType>::read } +template<class ThermoType> +Foam::scalar Foam::multiComponentMixture<ThermoType>::nMoles +( + const label specieI +) const +{ + return speciesData_[specieI].nMoles(); +} + + +template<class ThermoType> +Foam::scalar Foam::multiComponentMixture<ThermoType>::W +( + const label specieI +) const +{ + return speciesData_[specieI].W(); +} + + +template<class ThermoType> +Foam::scalar Foam::multiComponentMixture<ThermoType>::Cp +( + const label specieI, + const scalar T +) const +{ + return speciesData_[specieI].Cp(T); +} + + +template<class ThermoType> +Foam::scalar Foam::multiComponentMixture<ThermoType>::Cv +( + const label specieI, + const scalar T +) const +{ + return speciesData_[specieI].Cv(T); +} + + +template<class ThermoType> +Foam::scalar Foam::multiComponentMixture<ThermoType>::H +( + const label specieI, + const scalar T +) const +{ + return speciesData_[specieI].H(T); +} + + +template<class ThermoType> +Foam::scalar Foam::multiComponentMixture<ThermoType>::Hs +( + const label specieI, + const scalar T +) const +{ + return speciesData_[specieI].Hs(T); +} + + +template<class ThermoType> +Foam::scalar Foam::multiComponentMixture<ThermoType>::Hc +( + const label specieI +) const +{ + return speciesData_[specieI].Hc(); +} + + +template<class ThermoType> +Foam::scalar Foam::multiComponentMixture<ThermoType>::S +( + const label specieI, + const scalar T +) const +{ + return speciesData_[specieI].S(T); +} + + +template<class ThermoType> +Foam::scalar Foam::multiComponentMixture<ThermoType>::E +( + const label specieI, + const scalar T +) const +{ + return speciesData_[specieI].E(T); +} + + +template<class ThermoType> +Foam::scalar Foam::multiComponentMixture<ThermoType>::G +( + const label specieI, + const scalar T +) const +{ + return speciesData_[specieI].G(T); +} + + +template<class ThermoType> +Foam::scalar Foam::multiComponentMixture<ThermoType>::A +( + const label specieI, + const scalar T +) const +{ + return speciesData_[specieI].A(T); +} + + +template<class ThermoType> +Foam::scalar Foam::multiComponentMixture<ThermoType>::mu +( + const label specieI, + const scalar T +) const +{ + return speciesData_[specieI].mu(T); +} + + +template<class ThermoType> +Foam::scalar Foam::multiComponentMixture<ThermoType>::kappa +( + const label specieI, + const scalar T +) const +{ + return speciesData_[specieI].kappa(T); +} + + +template<class ThermoType> +Foam::scalar Foam::multiComponentMixture<ThermoType>::alpha +( + const label specieI, + const scalar T +) const +{ + return speciesData_[specieI].alpha(T); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.H index 73d27f72cc09d34e3bffc775471ba62736030e35..b388e9c411076a72eb5a514fb93129a9d6c98b22 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.H @@ -118,6 +118,57 @@ public: //- Read dictionary void read(const dictionary&); + + + // Per specie properties + + //- Number of moles [] + virtual scalar nMoles(const label specieI) const; + + //- Molecular weight [kg/kmol] + virtual scalar W(const label specieI) const; + + + // Per specie thermo properties + + //- Heat capacity at constant pressure [J/(kg K)] + virtual scalar Cp(const label specieI, const scalar T) const; + + //- Heat capacity at constant volume [J/(kg K)] + virtual scalar Cv(const label specieI, const scalar T) const; + + //- Enthalpy [J/kg] + virtual scalar H(const label specieI, const scalar T) const; + + //- Sensible enthalpy [J/kg] + virtual scalar Hs(const label specieI, const scalar T) const; + + //- Chemical enthalpy [J/kg] + virtual scalar Hc(const label specieI) const; + + //- Entropy [J/(kg K)] + virtual scalar S(const label specieI, const scalar T) const; + + //- Internal energy [J/kg] + virtual scalar E(const label specieI, const scalar T) const; + + //- Gibbs free energy [J/kg] + virtual scalar G(const label specieI, const scalar T) const; + + //- Helmholtz free energy [J/kg] + virtual scalar A(const label specieI, const scalar T) const; + + + // Per specie transport properties + + //- Dynamic viscosity [kg/m/s] + virtual scalar mu(const label specieI, const scalar T) const; + + //- Thermal conductivity [W/m/K] + virtual scalar kappa(const label specieI, const scalar T) const; + + //- Thermal diffusivity [kg/m/s] + virtual scalar alpha(const label specieI, const scalar T) const; }; diff --git a/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.C index 9781890b1ad858ffc77f0cd946d78bcd84ecda08..3684fc3e094be4bf6a1f45da1bc7e9385af5d386 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.C @@ -102,4 +102,190 @@ void Foam::veryInhomogeneousMixture<ThermoType>::read } +template<class ThermoType> +const ThermoType& Foam::veryInhomogeneousMixture<ThermoType>::getLocalThermo +( + const label specieI +) const +{ + if (specieI == 0) + { + return fuel_; + } + else if (specieI == 1) + { + return oxidant_; + } + else if (specieI == 2) + { + return products_; + } + else + { + FatalErrorIn + ( + "const ThermoType& Foam::veryInhomogeneousMixture<ThermoType>::" + "getLocalThermo" + "(" + "const label " + ") const" + ) << "Unknown specie index " << specieI << ". Valid indices are 0..2" + << abort(FatalError); + + return fuel_; + } +} + + +template<class ThermoType> +Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::nMoles +( + const label specieI +) const +{ + return getLocalThermo(specieI).nMoles(); +} + + +template<class ThermoType> +Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::W +( + const label specieI +) const +{ + return getLocalThermo(specieI).W(); +} + + +template<class ThermoType> +Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::Cp +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Cp(T); +} + + +template<class ThermoType> +Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::Cv +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Cv(T); +} + + +template<class ThermoType> +Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::H +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).H(T); +} + + +template<class ThermoType> +Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::Hs +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Hs(T); +} + + +template<class ThermoType> +Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::Hc +( + const label specieI +) const +{ + return getLocalThermo(specieI).Hc(); +} + + +template<class ThermoType> +Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::S +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).S(T); +} + + +template<class ThermoType> +Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::E +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).E(T); +} + + +template<class ThermoType> +Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::G +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).G(T); +} + + +template<class ThermoType> +Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::A +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).A(T); +} + + +template<class ThermoType> +Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::mu +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).mu(T); +} + + +template<class ThermoType> +Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::kappa +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).kappa(T); +} + + +template<class ThermoType> +Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::alpha +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).alpha(T); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.H index f58335f4e4169d4e9a930d08b374da421b346ef6..1ae7a369857c82dcad638707da5d5bba328057e5 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.H @@ -157,6 +157,60 @@ public: //- Read dictionary void read(const dictionary&); + + //- Return thermo based on index + const ThermoType& getLocalThermo(const label specieI) const; + + + // Per specie properties + + //- Number of moles [] + virtual scalar nMoles(const label specieI) const; + + //- Molecular weight [kg/kmol] + virtual scalar W(const label specieI) const; + + + // Per specie thermo properties + + //- Heat capacity at constant pressure [J/(kg K)] + virtual scalar Cp(const label specieI, const scalar T) const; + + //- Heat capacity at constant volume [J/(kg K)] + virtual scalar Cv(const label specieI, const scalar T) const; + + //- Enthalpy [J/kg] + virtual scalar H(const label specieI, const scalar T) const; + + //- Sensible enthalpy [J/kg] + virtual scalar Hs(const label specieI, const scalar T) const; + + //- Chemical enthalpy [J/kg] + virtual scalar Hc(const label specieI) const; + + //- Entropy [J/(kg K)] + virtual scalar S(const label specieI, const scalar T) const; + + //- Internal energy [J/kg] + virtual scalar E(const label specieI, const scalar T) const; + + //- Gibbs free energy [J/kg] + virtual scalar G(const label specieI, const scalar T) const; + + //- Helmholtz free energy [J/kg] + virtual scalar A(const label specieI, const scalar T) const; + + + // Per specie transport properties + + //- Dynamic viscosity [kg/m/s] + virtual scalar mu(const label specieI, const scalar T) const; + + //- Thermal conductivity [W/m/K] + virtual scalar kappa(const label specieI, const scalar T) const; + + //- Thermal diffusivity [kg/m/s] + virtual scalar alpha(const label specieI, const scalar T) const; };