The fundamental properties provided by the specie class hierarchy were
mole-based, i.e. provide the properties per mole whereas the fundamental
properties provided by the liquidProperties and solidProperties classes are
mass-based, i.e. per unit mass. This inconsistency made it impossible to
instantiate the thermodynamics packages (rhoThermo, psiThermo) used by the FV
transport solvers on liquidProperties. In order to combine VoF with film and/or
Lagrangian models it is essential that the physical propertied of the three
representations of the liquid are consistent which means that it is necessary to
instantiate the thermodynamics packages on liquidProperties. This requires
either liquidProperties to be rewritten mole-based or the specie classes to be
rewritten mass-based. Given that most of OpenFOAM solvers operate
mass-based (solve for mass-fractions and provide mass-fractions to sub-models it
is more consistent and efficient if the low-level thermodynamics is also
mass-based.
This commit includes all of the changes necessary for all of the thermodynamics
in OpenFOAM to operate mass-based and supports the instantiation of
thermodynamics packages on liquidProperties.
Note that most users, developers and contributors to OpenFOAM will not notice
any difference in the operation of the code except that the confusing
nMoles 1;
entries in the thermophysicalProperties files are no longer needed or used and
have been removed in this commet. The only substantial change to the internals
is that species thermodynamics are now "mixed" with mass rather than mole
fractions. This is more convenient except for defining reaction equilibrium
thermodynamics for which the molar rather than mass composition is usually know.
The consequence of this can be seen in the adiabaticFlameT, equilibriumCO and
equilibriumFlameT utilities in which the species thermodynamics are
pre-multiplied by their molecular mass to effectively convert them to mole-basis
to simplify the definition of the reaction equilibrium thermodynamics, e.g. in
equilibriumCO
// Reactants (mole-based)
thermo FUEL(thermoData.subDict(fuelName)); FUEL *= FUEL.W();
// Oxidant (mole-based)
thermo O2(thermoData.subDict("O2")); O2 *= O2.W();
thermo N2(thermoData.subDict("N2")); N2 *= N2.W();
// Intermediates (mole-based)
thermo H2(thermoData.subDict("H2")); H2 *= H2.W();
// Products (mole-based)
thermo CO2(thermoData.subDict("CO2")); CO2 *= CO2.W();
thermo H2O(thermoData.subDict("H2O")); H2O *= H2O.W();
thermo CO(thermoData.subDict("CO")); CO *= CO.W();
// Product dissociation reactions
thermo CO2BreakUp
(
CO2 == CO + 0.5*O2
);
thermo H2OBreakUp
(
H2O == H2 + 0.5*O2
);
Please report any problems with this substantial but necessary rewrite of the
thermodynamic at https://bugs.openfoam.org
Henry G. Weller
CFD Direct Ltd.
110 lines
2.5 KiB
C
110 lines
2.5 KiB
C
/*---------------------------------------------------------------------------*\
|
|
========= |
|
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
\\ / O peration |
|
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
|
\\/ M anipulation |
|
|
-------------------------------------------------------------------------------
|
|
License
|
|
This file is part of OpenFOAM.
|
|
|
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
\*---------------------------------------------------------------------------*/
|
|
|
|
inline Foam::scalar Foam::C9H20::rho(scalar p, scalar T) const
|
|
{
|
|
return rho_.f(p, T);
|
|
}
|
|
|
|
|
|
inline Foam::scalar Foam::C9H20::pv(scalar p, scalar T) const
|
|
{
|
|
return pv_.f(p, T);
|
|
}
|
|
|
|
|
|
inline Foam::scalar Foam::C9H20::hl(scalar p, scalar T) const
|
|
{
|
|
return hl_.f(p, T);
|
|
}
|
|
|
|
|
|
inline Foam::scalar Foam::C9H20::Cp(scalar p, scalar T) const
|
|
{
|
|
return Cp_.f(p, T);
|
|
}
|
|
|
|
|
|
inline Foam::scalar Foam::C9H20::h(scalar p, scalar T) const
|
|
{
|
|
return h_.f(p, T);
|
|
}
|
|
|
|
|
|
inline Foam::scalar Foam::C9H20::Cpg(scalar p, scalar T) const
|
|
{
|
|
return Cpg_.f(p, T);
|
|
}
|
|
|
|
|
|
inline Foam::scalar Foam::C9H20::B(scalar p, scalar T) const
|
|
{
|
|
return B_.f(p, T);
|
|
}
|
|
|
|
|
|
inline Foam::scalar Foam::C9H20::mu(scalar p, scalar T) const
|
|
{
|
|
return mu_.f(p, T);
|
|
}
|
|
|
|
|
|
inline Foam::scalar Foam::C9H20::mug(scalar p, scalar T) const
|
|
{
|
|
return mug_.f(p, T);
|
|
}
|
|
|
|
|
|
inline Foam::scalar Foam::C9H20::kappa(scalar p, scalar T) const
|
|
{
|
|
return kappa_.f(p, T);
|
|
}
|
|
|
|
|
|
inline Foam::scalar Foam::C9H20::kappag(scalar p, scalar T) const
|
|
{
|
|
return kappag_.f(p, T);
|
|
}
|
|
|
|
|
|
inline Foam::scalar Foam::C9H20::sigma(scalar p, scalar T) const
|
|
{
|
|
return sigma_.f(p, T);
|
|
}
|
|
|
|
|
|
inline Foam::scalar Foam::C9H20::D(scalar p, scalar T) const
|
|
{
|
|
return D_.f(p, T);
|
|
}
|
|
|
|
|
|
inline Foam::scalar Foam::C9H20::D(scalar p, scalar T, scalar Wb) const
|
|
{
|
|
return D_.f(p, T, Wb);
|
|
}
|
|
|
|
|
|
// ************************************************************************* //
|