Thermodynamics: Instantiated isobaricPerfectGas packages

This commit is contained in:
Henry 2012-06-12 17:14:57 +01:00
parent aea7f5218b
commit c8b62e27f7
16 changed files with 311 additions and 425 deletions

View File

@ -510,7 +510,6 @@ DebugSwitches
gradientUnburntEnthalpy 0;
granularPressureModel 0;
hCombustionThermo 0;
hMixtureThermo<dieselMixture<sutherlandTransport<specieThermo<janafThermo<perfectGas>>>>> 0;
hMixtureThermo<homogeneousMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>> 0;
hMixtureThermo<homogeneousMixture<sutherlandTransport<specieThermo<janafThermo<perfectGas>>>>> 0;
hMixtureThermo<inhomogeneousMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>> 0;

View File

@ -43,14 +43,30 @@ namespace Foam
(
ODEChemistryModel,
psiChemistryModel,
gasThermoPhysics
constGasThermoPhysics
);
makeChemistryModel
(
ODEChemistryModel,
psiChemistryModel,
constGasThermoPhysics
gasThermoPhysics
);
makeChemistryModel
(
ODEChemistryModel,
psiChemistryModel,
constIsobaricGasThermoPhysics
);
makeChemistryModel
(
ODEChemistryModel,
psiChemistryModel,
isobaricGasThermoPhysics
);
makeChemistryModel
(
ODEChemistryModel,

View File

@ -43,14 +43,30 @@ namespace Foam
(
ODEChemistryModel,
rhoChemistryModel,
gasThermoPhysics
constGasThermoPhysics
);
makeChemistryModel
(
ODEChemistryModel,
rhoChemistryModel,
constGasThermoPhysics
gasThermoPhysics
);
makeChemistryModel
(
ODEChemistryModel,
rhoChemistryModel,
constIsobaricGasThermoPhysics
);
makeChemistryModel
(
ODEChemistryModel,
rhoChemistryModel,
isobaricGasThermoPhysics
);
makeChemistryModel
(
ODEChemistryModel,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -33,11 +33,15 @@ License
namespace Foam
{
makeChemistrySolverTypes(psiChemistryModel, gasThermoPhysics);
makeChemistrySolverTypes(psiChemistryModel, constGasThermoPhysics);
makeChemistrySolverTypes(psiChemistryModel, gasThermoPhysics);
makeChemistrySolverTypes(psiChemistryModel, constIsobaricGasThermoPhysics);
makeChemistrySolverTypes(psiChemistryModel, isobaricGasThermoPhysics);
makeChemistrySolverTypes(psiChemistryModel, icoPoly8ThermoPhysics);
makeChemistrySolverTypes(rhoChemistryModel, gasThermoPhysics);
makeChemistrySolverTypes(rhoChemistryModel, constGasThermoPhysics);
makeChemistrySolverTypes(rhoChemistryModel, gasThermoPhysics);
makeChemistrySolverTypes(rhoChemistryModel, constIsobaricGasThermoPhysics);
makeChemistrySolverTypes(rhoChemistryModel, isobaricGasThermoPhysics);
makeChemistrySolverTypes(rhoChemistryModel, icoPoly8ThermoPhysics);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,7 +23,7 @@ License
\*---------------------------------------------------------------------------*/
#include "makeReaction.H"
#include "makeReactionThermo.H"
#include "thermoPhysicsTypes.H"
#include "chemistryReader.H"
@ -38,9 +38,14 @@ namespace Foam
makeChemistryReader(constGasThermoPhysics);
makeChemistryReader(gasThermoPhysics);
makeChemistryReader(constIsobaricGasThermoPhysics);
makeChemistryReader(isobaricGasThermoPhysics);
makeChemistryReader(icoPoly8ThermoPhysics);
makeChemistryReaderType(foamChemistryReader, constGasThermoPhysics);
makeChemistryReaderType(foamChemistryReader, gasThermoPhysics);
makeChemistryReaderType(foamChemistryReader, constIsobaricGasThermoPhysics);
makeChemistryReaderType(foamChemistryReader, isobaricGasThermoPhysics);
makeChemistryReaderType(foamChemistryReader, icoPoly8ThermoPhysics);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -1,134 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 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/>.
\*---------------------------------------------------------------------------*/
#include "dieselMixture.H"
#include "fvMesh.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template<class ThermoType>
const char* Foam::dieselMixture<ThermoType>::specieNames_[2] = {"ft", "fu"};
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ThermoType>
Foam::dieselMixture<ThermoType>::dieselMixture
(
const dictionary& thermoDict,
const fvMesh& mesh
)
:
basicMultiComponentMixture
(
thermoDict,
speciesTable(nSpecies_, specieNames_),
mesh
),
stoicRatio_(thermoDict.lookup("stoichiometricAirFuelMassRatio")),
fuel_(thermoDict.subDict("fuel")),
oxidant_(thermoDict.subDict("oxidant")),
products_(thermoDict.subDict("burntProducts")),
mixture_("mixture", fuel_),
ft_(Y("ft")),
fu_(Y("fu"))
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ThermoType>
const ThermoType& Foam::dieselMixture<ThermoType>::mixture
(
const scalar ft,
const scalar fu
) const
{
if (ft < 0.0001)
{
return oxidant_;
}
else
{
scalar ox = 1 - ft - (ft - fu)*stoicRatio().value();
scalar pr = 1 - fu - ox;
mixture_ = fu/fuel_.W()*fuel_;
mixture_ += ox/oxidant_.W()*oxidant_;
mixture_ += pr/products_.W()*products_;
return mixture_;
}
}
template<class ThermoType>
void Foam::dieselMixture<ThermoType>::read(const dictionary& thermoDict)
{
fuel_ = ThermoType(thermoDict.subDict("fuel"));
oxidant_ = ThermoType(thermoDict.subDict("oxidant"));
products_ = ThermoType(thermoDict.subDict("burntProducts"));
}
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_;
}
}
// ************************************************************************* //

View File

@ -1,174 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 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/>.
Class
Foam::dieselMixture
Description
Foam::dieselMixture
SourceFiles
dieselMixture.C
\*---------------------------------------------------------------------------*/
#ifndef dieselMixture_H
#define dieselMixture_H
#include "basicMultiComponentMixture.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class dieselMixture Declaration
\*---------------------------------------------------------------------------*/
template<class ThermoType>
class dieselMixture
:
public basicMultiComponentMixture
{
// Private data
static const int nSpecies_ = 2;
static const char* specieNames_[2];
dimensionedScalar stoicRatio_;
ThermoType fuel_;
ThermoType oxidant_;
ThermoType products_;
mutable ThermoType mixture_;
volScalarField& ft_;
volScalarField& fu_;
//- Construct as copy (not implemented)
dieselMixture(const dieselMixture<ThermoType>&);
public:
//- The type of thermodynamics this mixture is instantiated for
typedef ThermoType thermoType;
// Constructors
//- Construct from dictionary and mesh
dieselMixture(const dictionary&, const fvMesh&);
//- Destructor
virtual ~dieselMixture()
{}
// Member functions
const dimensionedScalar& stoicRatio() const
{
return stoicRatio_;
}
const ThermoType& mixture(const scalar, const scalar) const;
const ThermoType& cellMixture(const label celli) const
{
return mixture(ft_[celli], fu_[celli]);
}
const ThermoType& patchFaceMixture
(
const label patchi,
const label facei
) const
{
return mixture
(
ft_.boundaryField()[patchi][facei],
fu_.boundaryField()[patchi][facei]
);
}
const ThermoType& cellReactants(const label celli) const
{
return mixture(ft_[celli], ft_[celli]);
}
const ThermoType& patchFaceReactants
(
const label patchi,
const label facei
) const
{
return mixture
(
ft_.boundaryField()[patchi][facei],
ft_.boundaryField()[patchi][facei]
);
}
const ThermoType& cellProducts(const label celli) const
{
scalar ft = ft_[celli];
return mixture(ft, fres(ft, stoicRatio().value()));
}
const ThermoType& patchFaceProducts
(
const label patchi,
const label facei
) const
{
scalar ft = ft_.boundaryField()[patchi][facei];
return mixture(ft, fres(ft, stoicRatio().value()));
}
//- Read dictionary
void read(const dictionary&);
//- Return thermo based on index
const ThermoType& getLocalThermo(const label specieI) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
#ifdef NoRepository
# include "dieselMixture.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -41,7 +41,6 @@ License
#include "homogeneousMixture.H"
#include "inhomogeneousMixture.H"
#include "veryInhomogeneousMixture.H"
#include "dieselMixture.H"
#include "multiComponentMixture.H"
#include "reactingMixture.H"
#include "singleStepReactingMixture.H"
@ -172,18 +171,6 @@ makeReactionThermo
);
makeReactionThermo
(
psiThermo,
psiReactionThermo,
hePsiReactionThermo,
dieselMixture,
sutherlandTransport,
sensibleEnthalpy,
janafThermo,
perfectGas
);
// Multi-component thermo
makeReactionMixtureThermo

View File

@ -42,7 +42,6 @@ License
#include "homogeneousMixture.H"
#include "inhomogeneousMixture.H"
#include "veryInhomogeneousMixture.H"
#include "dieselMixture.H"
#include "multiComponentMixture.H"
#include "egrMixture.H"
@ -126,7 +125,6 @@ makeReactionThermo
perfectGas
);
makeReactionThermo
(
psiThermo,
@ -139,8 +137,6 @@ makeReactionThermo
perfectGas
);
makeReactionThermo
(
psiThermo,

View File

@ -29,6 +29,7 @@ License
#include "heRhoReactionThermo.H"
#include "perfectGas.H"
#include "isobaricPerfectGas.H"
#include "hConstThermo.H"
#include "janafThermo.H"
@ -41,7 +42,6 @@ License
#include "homogeneousMixture.H"
#include "inhomogeneousMixture.H"
#include "veryInhomogeneousMixture.H"
#include "dieselMixture.H"
#include "multiComponentMixture.H"
#include "reactingMixture.H"
#include "singleStepReactingMixture.H"
@ -133,11 +133,71 @@ makeReactionThermo
rhoThermo,
rhoReactionThermo,
heRhoReactionThermo,
dieselMixture,
homogeneousMixture,
constTransport,
sensibleEnthalpy,
hConstThermo,
isobaricPerfectGas
);
makeReactionThermo
(
rhoThermo,
rhoReactionThermo,
heRhoReactionThermo,
inhomogeneousMixture,
constTransport,
sensibleEnthalpy,
hConstThermo,
isobaricPerfectGas
);
makeReactionThermo
(
rhoThermo,
rhoReactionThermo,
heRhoReactionThermo,
veryInhomogeneousMixture,
constTransport,
sensibleEnthalpy,
hConstThermo,
isobaricPerfectGas
);
makeReactionThermo
(
rhoThermo,
rhoReactionThermo,
heRhoReactionThermo,
homogeneousMixture,
sutherlandTransport,
sensibleEnthalpy,
janafThermo,
perfectGas
isobaricPerfectGas
);
makeReactionThermo
(
rhoThermo,
rhoReactionThermo,
heRhoReactionThermo,
inhomogeneousMixture,
sutherlandTransport,
sensibleEnthalpy,
janafThermo,
isobaricPerfectGas
);
makeReactionThermo
(
rhoThermo,
rhoReactionThermo,
heRhoReactionThermo,
veryInhomogeneousMixture,
sutherlandTransport,
sensibleEnthalpy,
janafThermo,
isobaricPerfectGas
);
@ -158,7 +218,7 @@ makeReactionMixtureThermo
rhoReactionThermo,
heRhoReactionThermo,
multiComponentMixture,
icoPoly8ThermoPhysics
gasThermoPhysics
);
makeReactionMixtureThermo
@ -167,7 +227,25 @@ makeReactionMixtureThermo
rhoReactionThermo,
heRhoReactionThermo,
multiComponentMixture,
gasThermoPhysics
constIsobaricGasThermoPhysics
);
makeReactionMixtureThermo
(
rhoThermo,
rhoReactionThermo,
heRhoReactionThermo,
multiComponentMixture,
isobaricGasThermoPhysics
);
makeReactionMixtureThermo
(
rhoThermo,
rhoReactionThermo,
heRhoReactionThermo,
multiComponentMixture,
icoPoly8ThermoPhysics
);
@ -188,7 +266,7 @@ makeReactionMixtureThermo
rhoReactionThermo,
heRhoReactionThermo,
reactingMixture,
icoPoly8ThermoPhysics
gasThermoPhysics
);
makeReactionMixtureThermo
@ -197,7 +275,25 @@ makeReactionMixtureThermo
rhoReactionThermo,
heRhoReactionThermo,
reactingMixture,
gasThermoPhysics
constIsobaricGasThermoPhysics
);
makeReactionMixtureThermo
(
rhoThermo,
rhoReactionThermo,
heRhoReactionThermo,
reactingMixture,
isobaricGasThermoPhysics
);
makeReactionMixtureThermo
(
rhoThermo,
rhoReactionThermo,
heRhoReactionThermo,
reactingMixture,
icoPoly8ThermoPhysics
);
makeReactionMixtureThermo

View File

@ -8,7 +8,6 @@ $(specie)/specie.C
$(equationOfState)/perfectGas/perfectGas.C
$(equationOfState)/incompressible/incompressible.C
$(equationOfState)/isobaricPerfectGas/isobaricPerfectGas.C
$(reactions)/makeChemkinReactions.C
$(reactions)/makeReactionThermoReactions.C
$(reactions)/makeLangmuirHinshelwoodReactions.C

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -43,9 +43,13 @@ Description
namespace Foam
{
typedef Reaction<constGasThermoPhysics> constGasReaction;
typedef Reaction<gasThermoPhysics> gasReaction;
typedef Reaction<constGasThermoPhysics> constGasReaction;
typedef Reaction<constIsobaricGasThermoPhysics> constIsobaricGasReaction;
typedef Reaction<isobaricGasThermoPhysics> isobaricGasReaction;
typedef Reaction<icoPoly8ThermoPhysics> icoPoly8Reaction;
}
@ -55,4 +59,3 @@ namespace Foam
#endif
// ************************************************************************* //

View File

@ -33,6 +33,7 @@ Description
#define thermoPhysicsTypes_H
#include "perfectGas.H"
#include "isobaricPerfectGas.H"
#include "hConstThermo.H"
#include "janafThermo.H"
#include "sensibleEnthalpy.H"
@ -49,48 +50,71 @@ Description
namespace Foam
{
typedef
sutherlandTransport
constTransport
<
specieThermo
<
specieThermo
hConstThermo
<
janafThermo
<
perfectGas
>,
sensibleEnthalpy
>
>
gasThermoPhysics;
typedef
constTransport
<
specieThermo
<
hConstThermo
<
perfectGas
>,
sensibleEnthalpy
>
>
constGasThermoPhysics;
typedef
polynomialTransport
<
specieThermo
<
hPolynomialThermo
<
icoPolynomial<8>,
8
>,
sensibleEnthalpy
perfectGas
>,
8
sensibleEnthalpy
>
icoPoly8ThermoPhysics;
> constGasThermoPhysics;
typedef
sutherlandTransport
<
specieThermo
<
janafThermo
<
perfectGas
>,
sensibleEnthalpy
>
> gasThermoPhysics;
typedef
constTransport
<
specieThermo
<
hConstThermo
<
isobaricPerfectGas
>,
sensibleEnthalpy
>
> constIsobaricGasThermoPhysics;
typedef
sutherlandTransport
<
specieThermo
<
janafThermo
<
isobaricPerfectGas
>,
sensibleEnthalpy
>
> isobaricGasThermoPhysics;
typedef
polynomialTransport
<
specieThermo
<
hPolynomialThermo
<
icoPolynomial<8>,
8
>,
sensibleEnthalpy
>,
8
> icoPoly8ThermoPhysics;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -43,50 +43,51 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTemplateTypeNameAndDebug(icoPoly8Reaction, 0);
defineTemplateRunTimeSelectionTable(icoPoly8Reaction, Istream);
defineTemplateRunTimeSelectionTable(icoPoly8Reaction, dictionary);
// * * * * * * * * * * * * * Make CHEMKIN reactions * * * * * * * * * * * * //
makeIRNReactions(icoPoly8ThermoPhysics, ArrheniusReactionRate)
makeIRNReactions(icoPoly8ThermoPhysics, infiniteReactionRate)
makeIRNReactions(icoPoly8ThermoPhysics, LandauTellerReactionRate)
makeIRNReactions(icoPoly8ThermoPhysics, thirdBodyArrheniusReactionRate)
makeIRReactions(icoPoly8ThermoPhysics, JanevReactionRate)
makeIRReactions(icoPoly8ThermoPhysics, powerSeriesReactionRate)
makePressureDependentReactions
(
icoPoly8ThermoPhysics,
ArrheniusReactionRate,
LindemannFallOffFunction
)
makePressureDependentReactions
(
icoPoly8ThermoPhysics,
ArrheniusReactionRate,
TroeFallOffFunction
)
makePressureDependentReactions
(
icoPoly8ThermoPhysics,
ArrheniusReactionRate,
SRIFallOffFunction
)
#define makeReactions(Thermo, Reaction) \
\
defineTemplateTypeNameAndDebug(Reaction, 0); \
defineTemplateRunTimeSelectionTable(Reaction, Istream); \
defineTemplateRunTimeSelectionTable(Reaction, dictionary); \
\
makeIRNReactions(Thermo, ArrheniusReactionRate) \
makeIRNReactions(Thermo, infiniteReactionRate) \
makeIRNReactions(Thermo, LandauTellerReactionRate) \
makeIRNReactions(Thermo, thirdBodyArrheniusReactionRate) \
\
makeIRReactions(Thermo, JanevReactionRate) \
makeIRReactions(Thermo, powerSeriesReactionRate) \
\
makePressureDependentReactions \
( \
Thermo, \
ArrheniusReactionRate, \
LindemannFallOffFunction \
) \
\
makePressureDependentReactions \
( \
Thermo, \
ArrheniusReactionRate, \
TroeFallOffFunction \
) \
\
makePressureDependentReactions \
( \
Thermo, \
ArrheniusReactionRate, \
SRIFallOffFunction \
)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
namespace Foam
{
makeReactions(constGasThermoPhysics, constGasReaction)
makeReactions(gasThermoPhysics, gasReaction)
makeReactions(constIsobaricGasThermoPhysics, constIsobaricGasReaction)
makeReactions(isobaricGasThermoPhysics, isobaricGasReaction)
makeReactions(icoPoly8ThermoPhysics, icoPoly8Reaction)
}
// ************************************************************************* //

View File

@ -125,6 +125,15 @@ public:
//- Construct from dictionary
constTransport(const dictionary& dict);
//- Construct and return a clone
inline autoPtr<constTransport> clone() const;
// Selector from Istream
inline static autoPtr<constTransport> New(Istream& is);
// Selector from dictionary
inline static autoPtr<constTransport> New(const dictionary& dict);
// Member functions

View File

@ -52,6 +52,45 @@ inline Foam::constTransport<Thermo>::constTransport
{}
template<class Thermo>
inline Foam::autoPtr<Foam::constTransport<Thermo> >
Foam::constTransport<Thermo>::clone() const
{
return autoPtr<constTransport<Thermo> >
(
new constTransport<Thermo>(*this)
);
}
template<class Thermo>
inline Foam::autoPtr<Foam::constTransport<Thermo> >
Foam::constTransport<Thermo>::New
(
Istream& is
)
{
return autoPtr<constTransport<Thermo> >
(
new constTransport<Thermo>(is)
);
}
template<class Thermo>
inline Foam::autoPtr<Foam::constTransport<Thermo> >
Foam::constTransport<Thermo>::New
(
const dictionary& dict
)
{
return autoPtr<constTransport<Thermo> >
(
new constTransport<Thermo>(dict)
);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Thermo>