mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Implemented per specie info for mixtures
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user