diff --git a/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.C index d7d312735d..014ef3da51 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.C @@ -97,4 +97,189 @@ void Foam::dieselMixture::read(const dictionary& thermoDict) } +template +const ThermoType& Foam::dieselMixture::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::getLocalThermo" + "(" + "const label " + ") const" + ) << "Unknown specie index " << specieI << ". Valid indices are 0..2" + << abort(FatalError); + + return fuel_; + } +} + + +template +Foam::scalar Foam::dieselMixture::nMoles +( + const label specieI +) const +{ + return getLocalThermo(specieI).nMoles(); +} + + +template +Foam::scalar Foam::dieselMixture::W +( + const label specieI +) const +{ + return getLocalThermo(specieI).W(); +} + + +template +Foam::scalar Foam::dieselMixture::Cp +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Cp(T); +} + + +template +Foam::scalar Foam::dieselMixture::Cv +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Cv(T); +} + + +template +Foam::scalar Foam::dieselMixture::H +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).H(T); +} + + +template +Foam::scalar Foam::dieselMixture::Hs +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Hs(T); +} + + +template +Foam::scalar Foam::dieselMixture::Hc +( + const label specieI +) const +{ + return getLocalThermo(specieI).Hc(); +} + + +template +Foam::scalar Foam::dieselMixture::S +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).S(T); +} + + +template +Foam::scalar Foam::dieselMixture::E +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).E(T); +} + + +template +Foam::scalar Foam::dieselMixture::G +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).G(T); +} + + +template +Foam::scalar Foam::dieselMixture::A +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).A(T); +} + + +template +Foam::scalar Foam::dieselMixture::mu +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).mu(T); +} + + +template +Foam::scalar Foam::dieselMixture::kappa +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).kappa(T); +} + + +template +Foam::scalar Foam::dieselMixture::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 b0b46a88cc..8625818a58 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 7ba65975e8..06cf80a47f 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.C @@ -107,4 +107,189 @@ void Foam::egrMixture::read(const dictionary& thermoDict) } +template +const ThermoType& Foam::egrMixture::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::getLocalThermo" + "(" + "const label " + ") const" + ) << "Unknown specie index " << specieI << ". Valid indices are 0..2" + << abort(FatalError); + + return fuel_; + } +} + + +template +Foam::scalar Foam::egrMixture::nMoles +( + const label specieI +) const +{ + return getLocalThermo(specieI).nMoles(); +} + + +template +Foam::scalar Foam::egrMixture::W +( + const label specieI +) const +{ + return getLocalThermo(specieI).W(); +} + + +template +Foam::scalar Foam::egrMixture::Cp +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Cp(T); +} + + +template +Foam::scalar Foam::egrMixture::Cv +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Cv(T); +} + + +template +Foam::scalar Foam::egrMixture::H +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).H(T); +} + + +template +Foam::scalar Foam::egrMixture::Hs +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Hs(T); +} + + +template +Foam::scalar Foam::egrMixture::Hc +( + const label specieI +) const +{ + return getLocalThermo(specieI).Hc(); +} + + +template +Foam::scalar Foam::egrMixture::S +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).S(T); +} + + +template +Foam::scalar Foam::egrMixture::E +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).E(T); +} + + +template +Foam::scalar Foam::egrMixture::G +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).G(T); +} + + +template +Foam::scalar Foam::egrMixture::A +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).A(T); +} + + +template +Foam::scalar Foam::egrMixture::mu +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).mu(T); +} + + +template +Foam::scalar Foam::egrMixture::kappa +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).kappa(T); +} + + +template +Foam::scalar Foam::egrMixture::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 0a9adf6aa7..95de13f321 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 89878ed40c..eca7ffd0d5 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.C @@ -89,4 +89,186 @@ void Foam::homogeneousMixture::read(const dictionary& thermoDict) } +template +const ThermoType& Foam::homogeneousMixture::getLocalThermo +( + const label specieI +) const +{ + if (specieI == 0) + { + return reactants_; + } + else if (specieI == 1) + { + return products_; + } + else + { + FatalErrorIn + ( + "const ThermoType& Foam::homogeneousMixture::" + "getLocalThermo" + "(" + "const label " + ") const" + ) << "Unknown specie index " << specieI << ". Valid indices are 0..1" + << abort(FatalError); + + return reactants_; + } +} + + +template +Foam::scalar Foam::homogeneousMixture::nMoles +( + const label specieI +) const +{ + return getLocalThermo(specieI).nMoles(); +} + + +template +Foam::scalar Foam::homogeneousMixture::W +( + const label specieI +) const +{ + return getLocalThermo(specieI).W(); +} + + +template +Foam::scalar Foam::homogeneousMixture::Cp +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Cp(T); +} + + +template +Foam::scalar Foam::homogeneousMixture::Cv +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Cv(T); +} + + +template +Foam::scalar Foam::homogeneousMixture::H +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).H(T); +} + + +template +Foam::scalar Foam::homogeneousMixture::Hs +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Hs(T); +} + + +template +Foam::scalar Foam::homogeneousMixture::Hc +( + const label specieI +) const +{ + return getLocalThermo(specieI).Hc(); +} + + +template +Foam::scalar Foam::homogeneousMixture::S +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).S(T); +} + + +template +Foam::scalar Foam::homogeneousMixture::E +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).E(T); +} + + +template +Foam::scalar Foam::homogeneousMixture::G +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).G(T); +} + + +template +Foam::scalar Foam::homogeneousMixture::A +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).A(T); +} + + +template +Foam::scalar Foam::homogeneousMixture::mu +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).mu(T); +} + + +template +Foam::scalar Foam::homogeneousMixture::kappa +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).kappa(T); +} + + +template +Foam::scalar Foam::homogeneousMixture::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 b03e63d7c7..a1fd589c83 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 743aeff98b..2ef52c112d 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.C @@ -101,4 +101,190 @@ void Foam::inhomogeneousMixture::read(const dictionary& thermoDict) } +template +const ThermoType& Foam::inhomogeneousMixture::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::" + "getLocalThermo" + "(" + "const label " + ") const" + ) << "Unknown specie index " << specieI << ". Valid indices are 0..2" + << abort(FatalError); + + return fuel_; + } +} + + +template +Foam::scalar Foam::inhomogeneousMixture::nMoles +( + const label specieI +) const +{ + return getLocalThermo(specieI).nMoles(); +} + + +template +Foam::scalar Foam::inhomogeneousMixture::W +( + const label specieI +) const +{ + return getLocalThermo(specieI).W(); +} + + +template +Foam::scalar Foam::inhomogeneousMixture::Cp +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Cp(T); +} + + +template +Foam::scalar Foam::inhomogeneousMixture::Cv +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Cv(T); +} + + +template +Foam::scalar Foam::inhomogeneousMixture::H +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).H(T); +} + + +template +Foam::scalar Foam::inhomogeneousMixture::Hs +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Hs(T); +} + + +template +Foam::scalar Foam::inhomogeneousMixture::Hc +( + const label specieI +) const +{ + return getLocalThermo(specieI).Hc(); +} + + +template +Foam::scalar Foam::inhomogeneousMixture::S +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).S(T); +} + + +template +Foam::scalar Foam::inhomogeneousMixture::E +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).E(T); +} + + +template +Foam::scalar Foam::inhomogeneousMixture::G +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).G(T); +} + + +template +Foam::scalar Foam::inhomogeneousMixture::A +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).A(T); +} + + +template +Foam::scalar Foam::inhomogeneousMixture::mu +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).mu(T); +} + + +template +Foam::scalar Foam::inhomogeneousMixture::kappa +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).kappa(T); +} + + +template +Foam::scalar Foam::inhomogeneousMixture::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 b4f9fc5f38..163052a848 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 a8575e037c..a30dd5dd1b 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.C @@ -160,4 +160,155 @@ void Foam::multiComponentMixture::read } +template +Foam::scalar Foam::multiComponentMixture::nMoles +( + const label specieI +) const +{ + return speciesData_[specieI].nMoles(); +} + + +template +Foam::scalar Foam::multiComponentMixture::W +( + const label specieI +) const +{ + return speciesData_[specieI].W(); +} + + +template +Foam::scalar Foam::multiComponentMixture::Cp +( + const label specieI, + const scalar T +) const +{ + return speciesData_[specieI].Cp(T); +} + + +template +Foam::scalar Foam::multiComponentMixture::Cv +( + const label specieI, + const scalar T +) const +{ + return speciesData_[specieI].Cv(T); +} + + +template +Foam::scalar Foam::multiComponentMixture::H +( + const label specieI, + const scalar T +) const +{ + return speciesData_[specieI].H(T); +} + + +template +Foam::scalar Foam::multiComponentMixture::Hs +( + const label specieI, + const scalar T +) const +{ + return speciesData_[specieI].Hs(T); +} + + +template +Foam::scalar Foam::multiComponentMixture::Hc +( + const label specieI +) const +{ + return speciesData_[specieI].Hc(); +} + + +template +Foam::scalar Foam::multiComponentMixture::S +( + const label specieI, + const scalar T +) const +{ + return speciesData_[specieI].S(T); +} + + +template +Foam::scalar Foam::multiComponentMixture::E +( + const label specieI, + const scalar T +) const +{ + return speciesData_[specieI].E(T); +} + + +template +Foam::scalar Foam::multiComponentMixture::G +( + const label specieI, + const scalar T +) const +{ + return speciesData_[specieI].G(T); +} + + +template +Foam::scalar Foam::multiComponentMixture::A +( + const label specieI, + const scalar T +) const +{ + return speciesData_[specieI].A(T); +} + + +template +Foam::scalar Foam::multiComponentMixture::mu +( + const label specieI, + const scalar T +) const +{ + return speciesData_[specieI].mu(T); +} + + +template +Foam::scalar Foam::multiComponentMixture::kappa +( + const label specieI, + const scalar T +) const +{ + return speciesData_[specieI].kappa(T); +} + + +template +Foam::scalar Foam::multiComponentMixture::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 73d27f72cc..b388e9c411 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 9781890b1a..3684fc3e09 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.C @@ -102,4 +102,190 @@ void Foam::veryInhomogeneousMixture::read } +template +const ThermoType& Foam::veryInhomogeneousMixture::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::" + "getLocalThermo" + "(" + "const label " + ") const" + ) << "Unknown specie index " << specieI << ". Valid indices are 0..2" + << abort(FatalError); + + return fuel_; + } +} + + +template +Foam::scalar Foam::veryInhomogeneousMixture::nMoles +( + const label specieI +) const +{ + return getLocalThermo(specieI).nMoles(); +} + + +template +Foam::scalar Foam::veryInhomogeneousMixture::W +( + const label specieI +) const +{ + return getLocalThermo(specieI).W(); +} + + +template +Foam::scalar Foam::veryInhomogeneousMixture::Cp +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Cp(T); +} + + +template +Foam::scalar Foam::veryInhomogeneousMixture::Cv +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Cv(T); +} + + +template +Foam::scalar Foam::veryInhomogeneousMixture::H +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).H(T); +} + + +template +Foam::scalar Foam::veryInhomogeneousMixture::Hs +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Hs(T); +} + + +template +Foam::scalar Foam::veryInhomogeneousMixture::Hc +( + const label specieI +) const +{ + return getLocalThermo(specieI).Hc(); +} + + +template +Foam::scalar Foam::veryInhomogeneousMixture::S +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).S(T); +} + + +template +Foam::scalar Foam::veryInhomogeneousMixture::E +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).E(T); +} + + +template +Foam::scalar Foam::veryInhomogeneousMixture::G +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).G(T); +} + + +template +Foam::scalar Foam::veryInhomogeneousMixture::A +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).A(T); +} + + +template +Foam::scalar Foam::veryInhomogeneousMixture::mu +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).mu(T); +} + + +template +Foam::scalar Foam::veryInhomogeneousMixture::kappa +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).kappa(T); +} + + +template +Foam::scalar Foam::veryInhomogeneousMixture::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 f58335f4e4..1ae7a36985 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; };