ENH: Aligning solid thermo mixing with gas mixing and solid reaction

This commit is contained in:
sergio
2012-10-31 17:13:03 +00:00
parent 3083282e21
commit 92d2bc1b76
92 changed files with 1725 additions and 865559 deletions

View File

@ -7,6 +7,7 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidChemistryModel/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/solidChemistryModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
-I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \
@ -28,4 +29,5 @@ LIB_LIBS = \
-lcompressibleLESModels \ -lcompressibleLESModels \
-lLESdeltas \ -lLESdeltas \
-lregionModels \ -lregionModels \
-lradiationModels -lradiationModels \
-lreactionThermophysicalModels

View File

@ -1,7 +1,6 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \ -I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solid/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude \

View File

@ -4,6 +4,7 @@ makeType=${1:-libso}
set -x set -x
wmake $makeType specie wmake $makeType specie
wmake $makeType solidSpecie
wmake $makeType thermophysicalFunctions wmake $makeType thermophysicalFunctions
./properties/Allwmake $* ./properties/Allwmake $*
@ -15,7 +16,7 @@ wmake $makeType barotropicCompressibilityModel
wmake $makeType thermalPorousZone wmake $makeType thermalPorousZone
wmake $makeType SLGThermo wmake $makeType SLGThermo
wmake $makeType solidSpecie
wmake $makeType solidThermo wmake $makeType solidThermo
wmake $makeType solidChemistryModel wmake $makeType solidChemistryModel

View File

@ -87,6 +87,27 @@ public:
return mixture_; return mixture_;
} }
const ThermoType& cellVolMixture
(
const scalar,
const scalar,
const label
) const
{
return mixture_;
}
const ThermoType& patchFaceVolMixture
(
const scalar,
const scalar,
const label,
const label
) const
{
return mixture_;
}
//- Read dictionary //- Read dictionary
void read(const dictionary&); void read(const dictionary&);
}; };

View File

@ -27,7 +27,7 @@ License
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "unitConversion.H" #include "unitConversion.H"
#include "zeroGradientFvPatchFields.H" #include "zeroGradientFvPatchFields.H"
#include "basicSolidMixture.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -71,7 +71,7 @@ greyMeanSolidAbsorptionEmission::X(const word specie) const
} }
} }
const scalarField& Yj = mixture_.Y(specie); const scalarField& Yj = mixture_.Y(specie);
const label mySpecieI = mixture_.components()[specie]; const label mySpecieI = mixture_.species()[specie];
forAll(Xj, iCell) forAll(Xj, iCell)
{ {
Xj[iCell] = Yj[iCell]/mixture_.rho(mySpecieI, p[iCell], T[iCell]); Xj[iCell] = Yj[iCell]/mixture_.rho(mySpecieI, p[iCell], T[iCell]);
@ -93,10 +93,10 @@ greyMeanSolidAbsorptionEmission
coeffsDict_((dict.subDict(typeName + "Coeffs"))), coeffsDict_((dict.subDict(typeName + "Coeffs"))),
thermo_(mesh.lookupObject<solidThermo>("thermophysicalProperties")), thermo_(mesh.lookupObject<solidThermo>("thermophysicalProperties")),
speciesNames_(0), speciesNames_(0),
mixture_(dynamic_cast<const basicSolidMixture&>(thermo_)), mixture_(dynamic_cast<const basicMultiComponentMixture&>(thermo_)),
solidData_(mixture_.Y().size()) solidData_(mixture_.Y().size())
{ {
if (!isA<basicSolidMixture>(thermo_)) if (!isA<basicMultiComponentMixture>(thermo_))
{ {
FatalErrorIn FatalErrorIn
( (

View File

@ -90,7 +90,7 @@ private:
HashTable<label> speciesNames_; HashTable<label> speciesNames_;
//- Basic multicomponent mixture //- Basic multicomponent mixture
const basicSolidMixture& mixture_; const basicMultiComponentMixture& mixture_;
//- List of solid species data //- List of solid species data
List<FixedList<scalar, 2> > solidData_; List<FixedList<scalar, 2> > solidData_;

View File

@ -1,7 +1,8 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidSpecie/lnInclude
LIB_LIBS = \ LIB_LIBS = \
-lfiniteVolume -lfiniteVolume

View File

@ -25,6 +25,7 @@ License
#include "makeReactionThermo.H" #include "makeReactionThermo.H"
#include "thermoPhysicsTypes.H" #include "thermoPhysicsTypes.H"
#include "solidThermoPhysicsTypes.H"
#include "chemistryReader.H" #include "chemistryReader.H"
#include "foamChemistryReader.H" #include "foamChemistryReader.H"
@ -41,6 +42,8 @@ makeChemistryReader(gasThermoPhysics);
makeChemistryReader(constIncompressibleGasThermoPhysics); makeChemistryReader(constIncompressibleGasThermoPhysics);
makeChemistryReader(incompressibleGasThermoPhysics); makeChemistryReader(incompressibleGasThermoPhysics);
makeChemistryReader(icoPoly8ThermoPhysics); makeChemistryReader(icoPoly8ThermoPhysics);
makeChemistryReader(hConstSolidThermoPhysics);
makeChemistryReader(hExponentialSolidThermoPhysics);
makeChemistryReaderType(foamChemistryReader, constGasThermoPhysics); makeChemistryReaderType(foamChemistryReader, constGasThermoPhysics);
makeChemistryReaderType(foamChemistryReader, gasThermoPhysics); makeChemistryReaderType(foamChemistryReader, gasThermoPhysics);
@ -51,6 +54,8 @@ makeChemistryReaderType
); );
makeChemistryReaderType(foamChemistryReader, incompressibleGasThermoPhysics); makeChemistryReaderType(foamChemistryReader, incompressibleGasThermoPhysics);
makeChemistryReaderType(foamChemistryReader, icoPoly8ThermoPhysics); makeChemistryReaderType(foamChemistryReader, icoPoly8ThermoPhysics);
makeChemistryReaderType(foamChemistryReader, hConstSolidThermoPhysics);
makeChemistryReaderType(foamChemistryReader, hExponentialSolidThermoPhysics);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -41,6 +41,7 @@ License
#include "powerSeriesReactionRate.H" #include "powerSeriesReactionRate.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
/* * * * * * * * * * * * * * * * * Static data * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * Static data * * * * * * * * * * * * * * * */
namespace Foam namespace Foam
@ -178,7 +179,8 @@ void Foam::chemkinReader::addReactionType
{ {
reactions_.append reactions_.append
( (
new IrreversibleReaction<gasThermoPhysics, ReactionRateType> new IrreversibleReaction
<Reaction, gasThermoPhysics, ReactionRateType>
( (
Reaction<gasThermoPhysics> Reaction<gasThermoPhysics>
( (
@ -197,7 +199,8 @@ void Foam::chemkinReader::addReactionType
{ {
reactions_.append reactions_.append
( (
new ReversibleReaction<gasThermoPhysics, ReactionRateType> new ReversibleReaction
<Reaction, gasThermoPhysics, ReactionRateType>
( (
Reaction<gasThermoPhysics> Reaction<gasThermoPhysics>
( (
@ -496,7 +499,7 @@ void Foam::chemkinReader::addReaction
reactions_.append reactions_.append
( (
new NonEquilibriumReversibleReaction new NonEquilibriumReversibleReaction
<gasThermoPhysics, ArrheniusReactionRate> <Reaction, gasThermoPhysics, ArrheniusReactionRate>
( (
Reaction<gasThermoPhysics> Reaction<gasThermoPhysics>
( (
@ -549,7 +552,11 @@ void Foam::chemkinReader::addReaction
reactions_.append reactions_.append
( (
new NonEquilibriumReversibleReaction new NonEquilibriumReversibleReaction
<gasThermoPhysics, thirdBodyArrheniusReactionRate> <
Reaction,
gasThermoPhysics,
thirdBodyArrheniusReactionRate
>
( (
Reaction<gasThermoPhysics> Reaction<gasThermoPhysics>
( (
@ -654,7 +661,7 @@ void Foam::chemkinReader::addReaction
reactions_.append reactions_.append
( (
new NonEquilibriumReversibleReaction new NonEquilibriumReversibleReaction
<gasThermoPhysics, LandauTellerReactionRate> <Reaction, gasThermoPhysics, LandauTellerReactionRate>
( (
Reaction<gasThermoPhysics> Reaction<gasThermoPhysics>
( (

View File

@ -77,7 +77,8 @@ Foam::multiComponentMixture<ThermoType>::multiComponentMixture
: :
basicMultiComponentMixture(thermoDict, specieNames, mesh), basicMultiComponentMixture(thermoDict, specieNames, mesh),
speciesData_(species_.size()), speciesData_(species_.size()),
mixture_("mixture", *thermoData[specieNames[0]]) mixture_("mixture", *thermoData[specieNames[0]]),
mixtureVol_("volMixture", *thermoData[specieNames[0]])
{ {
forAll(species_, i) forAll(species_, i)
{ {
@ -101,7 +102,8 @@ Foam::multiComponentMixture<ThermoType>::multiComponentMixture
: :
basicMultiComponentMixture(thermoDict, thermoDict.lookup("species"), mesh), basicMultiComponentMixture(thermoDict, thermoDict.lookup("species"), mesh),
speciesData_(species_.size()), speciesData_(species_.size()),
mixture_("mixture", constructSpeciesData(thermoDict)) mixture_("mixture", constructSpeciesData(thermoDict)),
mixtureVol_("volMixture", speciesData_[0])
{ {
correctMassFractions(); correctMassFractions();
} }
@ -148,6 +150,78 @@ const ThermoType& Foam::multiComponentMixture<ThermoType>::patchFaceMixture
} }
template<class ThermoType>
const ThermoType& Foam::multiComponentMixture<ThermoType>::cellVolMixture
(
const scalar p,
const scalar T,
const label celli
) const
{
scalar rhoInv = 0.0;
forAll(speciesData_, i)
{
rhoInv += Y_[i][celli]/speciesData_[i].rho(p, T);
}
mixtureVol_ =
Y_[0][celli]
/ speciesData_[0].rho(p, T)
/ rhoInv
/ speciesData_[0].W()
* speciesData_[0];
for (label n=1; n<Y_.size(); n++)
{
mixtureVol_ +=
Y_[n][celli]
/ speciesData_[n].rho(p, T)
/ rhoInv
/ speciesData_[n].W()
* speciesData_[n];
}
return mixtureVol_;
}
template<class ThermoType>
const ThermoType& Foam::multiComponentMixture<ThermoType>::
patchFaceVolMixture
(
const scalar p,
const scalar T,
const label patchi,
const label facei
) const
{
scalar rhoInv = 0.0;
forAll(speciesData_, i)
{
rhoInv += Y_[i].boundaryField()[patchi][facei]/speciesData_[i].rho(p, T);
}
mixtureVol_ =
Y_[0].boundaryField()[patchi][facei]
/ speciesData_[0].rho(p, T)
/ rhoInv
/ speciesData_[0].W()
* speciesData_[0];
for (label n=1; n<Y_.size(); n++)
{
mixtureVol_ +=
Y_[n].boundaryField()[patchi][facei]
/ speciesData_[n].rho(p,T)
/ rhoInv
/ speciesData_[n].W()
* speciesData_[n];
}
return mixtureVol_;
}
template<class ThermoType> template<class ThermoType>
void Foam::multiComponentMixture<ThermoType>::read void Foam::multiComponentMixture<ThermoType>::read
( (

View File

@ -60,6 +60,10 @@ class multiComponentMixture
//- Temporary storage for the cell/face mixture thermo data //- Temporary storage for the cell/face mixture thermo data
mutable ThermoType mixture_; mutable ThermoType mixture_;
//- Temporary storage for the volume weighted
// cell/face mixture thermo data
mutable ThermoType mixtureVol_;
// Private Member Functions // Private Member Functions
@ -110,6 +114,21 @@ public:
const label facei const label facei
) const; ) const;
const ThermoType& cellVolMixture
(
const scalar p,
const scalar T,
const label celli
) const;
const ThermoType& patchFaceVolMixture
(
const scalar p,
const scalar T,
const label patchi,
const label facei
) const;
//- Return the raw specie thermodynamic data //- Return the raw specie thermodynamic data
const PtrList<ThermoType>& speciesData() const const PtrList<ThermoType>& speciesData() const
{ {

View File

@ -12,4 +12,5 @@ EXE_INC = \
LIB_LIBS = \ LIB_LIBS = \
-lchemistryModel \ -lchemistryModel \
-lfiniteVolume \ -lfiniteVolume \
-lODE -lODE\
-lreactionThermophysicalModels

View File

@ -24,7 +24,8 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "ODESolidChemistryModel.H" #include "ODESolidChemistryModel.H"
#include "reactingSolidMixture.H" #include "reactingMixture.H"
#include "solidReaction.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -38,24 +39,20 @@ ODESolidChemistryModel
CompType(mesh), CompType(mesh),
ODE(), ODE(),
Ys_(this->solidThermo().composition().Y()), Ys_(this->solidThermo().composition().Y()),
pyrolisisGases_
(
mesh.lookupObject<dictionary>
("chemistryProperties").lookup("species")
),
reactions_ reactions_
( (
dynamic_cast<const reactingSolidMixture<SolidThermo>& > dynamic_cast<const reactingMixture<SolidThermo>& >
( (
this->solidThermo() this->solidThermo()
) )
), ),
pyrolisisGases_(reactions_[0].gasSpecies()),
solidThermo_ solidThermo_
( (
dynamic_cast<const reactingSolidMixture<SolidThermo>& > dynamic_cast<const reactingMixture<SolidThermo>& >
( (
this->solidThermo() this->solidThermo()
).solidData() ).speciesData()
), ),
gasThermo_(pyrolisisGases_.size()), gasThermo_(pyrolisisGases_.size()),
nGases_(pyrolisisGases_.size()), nGases_(pyrolisisGases_.size()),
@ -183,7 +180,7 @@ ODESolidChemistryModel
dictionary thermoDict = dictionary thermoDict =
mesh.lookupObject<dictionary> mesh.lookupObject<dictionary>
( (
"chemistryProperties" "thermophysicalProperties"
).subDict(pyrolisisGases_[gasI]); ).subDict(pyrolisisGases_[gasI]);
gasThermo_.set gasThermo_.set
@ -193,14 +190,13 @@ ODESolidChemistryModel
); );
} }
Info<< "ODESolidChemistryModel: Number of solids = " << nSolids_ Info<< "solidChemistryModel: Number of solids = " << nSolids_ << endl;
<< " and reactions = " << nReaction_ << endl;
Info<< "Number of gases from pyrolysis = " << nGases_ << endl; Info<< "solidChemistryModel: Number of gases = " << nGases_ << endl;
forAll(reactions_, i) forAll(reactions_, i)
{ {
Info<< indent << "Reaction " << i << nl << reactions_[i] << nl; Info<< indent << reactions_[i] << nl;
} }
} }
@ -235,23 +231,23 @@ ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::omega
forAll(reactions_, i) forAll(reactions_, i)
{ {
const solidReaction& R = reactions_[i]; const Reaction<SolidThermo>& R = reactions_[i];
scalar omegai = omega scalar omegai = omega
( (
R, c, T, p, pf, cf, lRef, pr, cr, rRef R, c, T, p, pf, cf, lRef, pr, cr, rRef
); );
scalar rhoL = 0.0; scalar rhoL = 0.0;
forAll(R.slhs(), s) forAll(R.lhs(), s)
{ {
label si = R.slhs()[s]; label si = R.lhs()[s].index;
om[si] -= omegai; om[si] -= omegai;
rhoL = solidThermo_[si].rho(p, T); rhoL = solidThermo_[si].rho(p, T);
} }
scalar sr = 0.0; scalar sr = 0.0;
forAll(R.srhs(), s) forAll(R.rhs(), s)
{ {
label si = R.srhs()[s]; label si = R.rhs()[s].index;
scalar rhoR = solidThermo_[si].rho(p, T); scalar rhoR = solidThermo_[si].rho(p, T);
sr = rhoR/rhoL; sr = rhoR/rhoL;
om[si] += sr*omegai; om[si] += sr*omegai;
@ -263,7 +259,7 @@ ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::omega
} }
forAll(R.grhs(), g) forAll(R.grhs(), g)
{ {
label gi = R.grhs()[g]; label gi = R.grhs()[g].index;
om[gi + nSolids_] += (1.0 - sr)*omegai; om[gi + nSolids_] += (1.0 - sr)*omegai;
} }
} }
@ -276,7 +272,7 @@ template<class CompType, class SolidThermo, class GasThermo>
Foam::scalar Foam::scalar
Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::omega Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::omega
( (
const solidReaction& R, const Reaction<SolidThermo>& R,
const scalarField& c, const scalarField& c,
const scalar T, const scalar T,
const scalar p, const scalar p,
@ -299,16 +295,17 @@ Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::omega
scalar kf = R.kf(p, T, c1); scalar kf = R.kf(p, T, c1);
const scalar exponent = R.nReact(); //const scalar exponent = R.nReact();
const label Nl = R.slhs().size(); const label Nl = R.lhs().size();
for (label s=0; s<Nl; s++) for (label s=0; s<Nl; s++)
{ {
label si = R.slhs()[s]; label si = R.lhs()[s].index;
const scalar exp = R.lhs()[si].exponent;
kf *= kf *=
pow(c1[si]/Ys0_[si][cellI], exponent) pow(c1[si]/Ys0_[si][cellI], exp)
*(Ys0_[si][cellI]); *(Ys0_[si][cellI]);
} }
@ -390,18 +387,18 @@ void Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::jacobian
for (label ri=0; ri<reactions_.size(); ri++) for (label ri=0; ri<reactions_.size(); ri++)
{ {
const solidReaction& R = reactions_[ri]; const Reaction<SolidThermo>& R = reactions_[ri];
scalar kf0 = R.kf(p, T, c2); scalar kf0 = R.kf(p, T, c2);
forAll(R.slhs(), j) forAll(R.lhs(), j)
{ {
label sj = R.slhs()[j]; label sj = R.lhs()[j].index;
scalar kf = kf0; scalar kf = kf0;
forAll(R.slhs(), i) forAll(R.lhs(), i)
{ {
label si = R.slhs()[i]; label si = R.lhs()[i].index;
scalar exp = R.nReact(); scalar exp = R.lhs()[i].exponent;
if (i == j) if (i == j)
{ {
if (exp < 1.0) if (exp < 1.0)
@ -428,14 +425,14 @@ void Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::jacobian
} }
} }
forAll(R.slhs(), i) forAll(R.lhs(), i)
{ {
label si = R.slhs()[i]; label si = R.lhs()[i].index;
dfdc[si][sj] -= kf; dfdc[si][sj] -= kf;
} }
forAll(R.srhs(), i) forAll(R.rhs(), i)
{ {
label si = R.srhs()[i]; label si = R.rhs()[i].index;
dfdc[si][sj] += kf; dfdc[si][sj] += kf;
} }
} }
@ -551,7 +548,8 @@ ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::nEqns() const
template<class CompType, class SolidThermo, class GasThermo> template<class CompType, class SolidThermo, class GasThermo>
void Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::calculate() void Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::
calculate()
{ {
if (!this->chemistry_) if (!this->chemistry_)
{ {

View File

@ -38,7 +38,7 @@ SourceFiles
#ifndef ODESolidChemistryModel_H #ifndef ODESolidChemistryModel_H
#define ODESolidChemistryModel_H #define ODESolidChemistryModel_H
#include "solidReaction.H" #include "Reaction.H"
#include "ODE.H" #include "ODE.H"
#include "volFieldsFwd.H" #include "volFieldsFwd.H"
#include "DimensionedField.H" #include "DimensionedField.H"
@ -72,12 +72,12 @@ protected:
//- Reference to solid mass fractions //- Reference to solid mass fractions
PtrList<volScalarField>& Ys_; PtrList<volScalarField>& Ys_;
//- Reactions
const PtrList<Reaction<SolidThermo> >& reactions_;
//- List of gas species present in reaction system //- List of gas species present in reaction system
speciesTable pyrolisisGases_; speciesTable pyrolisisGases_;
//- Reactions
const PtrList<solidReaction>& reactions_;
//- Thermodynamic data of solids //- Thermodynamic data of solids
const PtrList<SolidThermo>& solidThermo_; const PtrList<SolidThermo>& solidThermo_;
@ -149,7 +149,7 @@ public:
// Member Functions // Member Functions
//- The reactions //- The reactions
inline const PtrList<solidReaction>& reactions() const; inline const PtrList<Reaction<SolidThermo> >& reactions() const;
//- Thermodynamic data of gases //- Thermodynamic data of gases
inline const PtrList<GasThermo>& gasThermo() const; inline const PtrList<GasThermo>& gasThermo() const;
@ -180,7 +180,7 @@ public:
// species and charateristic times // species and charateristic times
virtual scalar omega virtual scalar omega
( (
const solidReaction& r, const Reaction<SolidThermo>& r,
const scalarField& c, const scalarField& c,
const scalar T, const scalar T,
const scalar p, const scalar p,

View File

@ -45,7 +45,7 @@ Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::RRg()
template<class CompType, class SolidThermo, class GasThermo> template<class CompType, class SolidThermo, class GasThermo>
inline const Foam::PtrList<Foam::solidReaction>& inline const Foam::PtrList<Foam::Reaction<SolidThermo> >&
Foam::ODESolidChemistryModel<CompType, SolidThermo,GasThermo>::reactions() const Foam::ODESolidChemistryModel<CompType, SolidThermo,GasThermo>::reactions() const
{ {
return reactions_; return reactions_;

View File

@ -53,6 +53,7 @@ namespace Foam
hExponentialSolidThermoPhysics, hExponentialSolidThermoPhysics,
gasThermoPhysics gasThermoPhysics
) )
} }

View File

@ -1,4 +1,4 @@
reaction/Reactions/solidReaction/solidReaction.C solidSpecie/solidSpecie.C
reaction/reactions/makeSolidReactions.C reaction/reactions/makeSolidReactions.C
LIB = $(FOAM_LIBBIN)/libsolidSpecie LIB = $(FOAM_LIBBIN)/libsolidSpecie

View File

@ -1,2 +1,5 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude
LIB_LIBS = \
-lspecie

View File

@ -32,7 +32,7 @@ Description
#ifndef solidThermoPhysicsTypes_H #ifndef solidThermoPhysicsTypes_H
#define solidThermoPhysicsTypes_H #define solidThermoPhysicsTypes_H
#include "specie.H" #include "solidSpecie.H"
#include "rhoConst.H" #include "rhoConst.H"
#include "hConstThermo.H" #include "hConstThermo.H"
#include "hExponentialThermo.H" #include "hExponentialThermo.H"
@ -53,7 +53,7 @@ namespace Foam
< <
hConstThermo hConstThermo
< <
rhoConst<specie> rhoConst<solidSpecie>
>, >,
sensibleEnthalpy sensibleEnthalpy
> >
@ -67,7 +67,7 @@ namespace Foam
< <
hExponentialThermo hExponentialThermo
< <
rhoConst<specie> rhoConst<solidSpecie>
>, >,
sensibleEnthalpy sensibleEnthalpy
> >

View File

@ -1,92 +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 "IrreversibleSolidReaction.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ReactionRate>
Foam::IrreversibleSolidReaction<ReactionRate>::IrreversibleSolidReaction
(
const solidReaction& reaction,
const ReactionRate& k,
const scalar nReact
)
:
solidReaction(reaction),
k_(k),
nReact_(nReact)
{}
template<class ReactionRate>
Foam::IrreversibleSolidReaction<ReactionRate>::IrreversibleSolidReaction
(
const speciesTable& components,
Istream& is,
const speciesTable& pyrolysisGases
)
:
solidReaction(components, is, pyrolysisGases),
k_(components, is),
nReact_(readScalar(is))
{
is.readEnd("solidArrheniusReactionRate(Istream&)");
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ReactionRate>
Foam::scalar Foam::IrreversibleSolidReaction<ReactionRate>::kf
(
const scalar p,
const scalar T,
const scalarField& c
) const
{
return k_(p, T, c);
}
template<class ReactionRate>
Foam::scalar Foam::IrreversibleSolidReaction<ReactionRate>::nReact() const
{
return nReact_;
}
template<class ReactionRate>
void Foam::IrreversibleSolidReaction<ReactionRate>::write
(
Ostream& os
) const
{
solidReaction::write(os);
os << token::SPACE << "Reaction order: " << nReact_ << nl << k_;
}
// ************************************************************************* //

View File

@ -26,299 +26,118 @@ License
#include "solidReaction.H" #include "solidReaction.H"
#include "DynamicList.H" #include "DynamicList.H"
/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */
namespace Foam
{
defineTypeNameAndDebug(solidReaction, 0);
defineRunTimeSelectionTable(solidReaction, Istream);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::solidReaction::solidReaction template<class ReactionThermo>
Foam::solidReaction<ReactionThermo>::solidReaction
( (
const speciesTable& componets, const Reaction<ReactionThermo>& reaction,
const speciesTable& pyrolisisGases, const speciesTable& pyrolisisGases,
const List<label>& slhs, const List<specieCoeffs>& glhs,
const List<label>& srhs, const List<specieCoeffs>& grhs
const List<label>& grhs
) )
: :
components_(componets), Reaction<ReactionThermo>(reaction),
pyrolisisGases_(pyrolisisGases), pyrolisisGases_(pyrolisisGases),
slhs_(slhs), glhs_(glhs),
srhs_(srhs),
grhs_(grhs) grhs_(grhs)
{} {}
Foam::solidReaction::solidReaction template<class ReactionThermo>
Foam::solidReaction<ReactionThermo>::solidReaction
( (
const solidReaction& r, const solidReaction<ReactionThermo>& r,
const speciesTable& componets,
const speciesTable& pyrolisisGases const speciesTable& pyrolisisGases
) )
: :
components_(componets), Reaction<ReactionThermo>(r),
pyrolisisGases_(pyrolisisGases), pyrolisisGases_(pyrolisisGases),
slhs_(r.slhs_), glhs_(r.glhs_),
srhs_(r.srhs_),
grhs_(r.grhs_) grhs_(r.grhs_)
{} {}
Foam::solidReaction::solidReaction template<class ReactionThermo>
( Foam::solidReaction<ReactionThermo>::solidReaction
const speciesTable& components,
Istream& is,
const speciesTable& pyrolisisGases
)
:
components_(components),
pyrolisisGases_(pyrolisisGases)
{
setLRhs(is);
}
Foam::label Foam::solidReaction::componentIndex
(
bool& isGas,
Istream& is
)
{
token t(is);
if (t.isWord())
{
word componentName = t.wordToken();
size_t i = componentName.find('=');
if (i != word::npos)
{
string exponentStr = componentName
(
i + 1,
componentName.size() - i - 1
);
componentName = componentName(0, i);
}
if (components_.contains(componentName))
{
isGas = false;
return (components_[componentName]);
}
else if (pyrolisisGases_.contains(componentName))
{
isGas = true;
return (pyrolisisGases_[componentName]);
}
else
{
FatalIOErrorIn
(
"solidReaction::componentIndex(bool&, Istream& is)",
is
)
<< "Cannot find component" << componentName
<< "in tables :" << pyrolisisGases_ << " or "
<< components_
<< exit(FatalIOError);
return -1;
}
}
else
{
FatalIOErrorIn("solidReaction::componentIndex(bool&, Istream& is)", is)
<< "Expected a word but found " << t.info()
<< exit(FatalIOError);
return -1;
}
}
void Foam::solidReaction::setLRhs(Istream& is)
{
DynamicList<label> dlsrhs;
label index = 0;
while (is)
{
bool isGas = false;
index = componentIndex(isGas, is);
if (index != -1)
{
dlsrhs.append(index);
token t(is);
if (t.isPunctuation())
{
if (t == token::ADD)
{
if (isGas)
{
grhs_ = dlsrhs.shrink();
dlsrhs.clear();
//is.putBack(t);
//return;
}
else
{
srhs_ = dlsrhs.shrink();
dlsrhs.clear(); //is.putBack(t);
//return;
}
}
else if (t == token::ASSIGN)
{
if (isGas)
{
Info << "Pyrolysis Gases should appear on lhs of the"
"reaction" << endl;
}
else
{
slhs_ = dlsrhs.shrink();
dlsrhs.clear();
}
}
else if (isGas)
{
grhs_ = dlsrhs.shrink();
is.putBack(t);
return;
}
else
{
srhs_ = dlsrhs.shrink();
is.putBack(t);
return;
}
}
else if (isGas)
{
grhs_ = dlsrhs.shrink();
is.putBack(t);
return;
}
else
{
srhs_ = dlsrhs.shrink();
is.putBack(t);
return;
}
}
else
{
FatalIOErrorIn("solidReaction::lsrhs(Istream& is)", is)
<< "Cannot find component in tables"
<< exit(FatalIOError);
}
}
FatalIOErrorIn("solidReaction::lsrhs(Istream& is)", is)
<< "Cannot continue reading reaction data from stream"
<< exit(FatalIOError);
}
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::solidReaction> Foam::solidReaction::New
( (
const speciesTable& species, const speciesTable& species,
Istream& is, const HashPtrTable<ReactionThermo>& thermoDatabase,
const speciesTable& pyrolisisGases Istream& is
) )
:
Reaction<ReactionThermo>(species, thermoDatabase, is),
pyrolisisGases_(),
glhs_(),
grhs_()
{ {
if (is.eof()) notImplemented
{
FatalIOErrorIn
( (
"solidReaction::New(const speciesTable& species," "template<class ReactionThermo>"
" const HashPtrTable& thermoDatabase, Istream&)", "Foam::solidReaction<ReactionThermo>::solidReaction"
is "("
) << "solidReaction type not specified" << nl << nl " const speciesTable& species,"
<< "Valid solidReaction types are :" << endl " const HashPtrTable<ReactionThermo>& thermoDatabase,"
<< IstreamConstructorTablePtr_->sortedToc() " Istream& is"
<< exit(FatalIOError); ")"
);
} }
const word reactionTypeName(is);
IstreamConstructorTable::iterator cstrIter template<class ReactionThermo>
= IstreamConstructorTablePtr_->find(reactionTypeName); Foam::solidReaction<ReactionThermo>::solidReaction
(
if (cstrIter == IstreamConstructorTablePtr_->end()) const speciesTable& species,
const HashPtrTable<ReactionThermo>& thermoDatabase,
const dictionary& dict
)
:
Reaction<ReactionThermo>(species, thermoDatabase, dict),
pyrolisisGases_(dict.parent().parent().lookup("gaseousSpecies")),
glhs_(),
grhs_()
{ {
FatalIOErrorIn this->setLRhs
( (
"solidReaction::New(const speciesTable& species," IStringStream(dict.lookup("reaction"))(),
" const HashPtrTable& thermoDatabase, Istream&)", pyrolisisGases_,
is glhs_,
) << "Unknown reaction type " grhs_
<< reactionTypeName << nl << nl
<< "Valid reaction types are :" << endl
<< IstreamConstructorTablePtr_->sortedToc()
<< exit(FatalIOError);
}
return autoPtr<solidReaction>
(
cstrIter()(species, is, pyrolisisGases)
); );
} }
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::solidReaction::write(Ostream& os) const template<class ReactionThermo>
const Foam::List<typename Foam::solidReaction<ReactionThermo>::specieCoeffs>&
Foam::solidReaction<ReactionThermo>::glhs() const
{ {
os << type() << nl << " "; return glhs_;
forAll(slhs_, i)
{
os << components_[slhs_[i]];
}
os << " = ";
forAll(srhs_, i)
{
os << components_[srhs_[i]];
}
os << " + ";
forAll(grhs_, i)
{
os << pyrolisisGases_[grhs_[i]];
}
os << endl << " ";
} }
Foam::scalar Foam::solidReaction::kf template<class ReactionThermo>
( const Foam::List<typename Foam::Reaction<ReactionThermo>::specieCoeffs>&
const scalar p, Foam::solidReaction<ReactionThermo>::grhs() const
const scalar T,
const scalarField& c
) const
{ {
return 0.0; return grhs_;
} }
Foam::scalar Foam::solidReaction::nReact() const template<class ReactionThermo>
const Foam::speciesTable& Foam::solidReaction<ReactionThermo>::
gasSpecies() const
{ {
return 1.0; return pyrolisisGases_;
}
template<class ReactionThermo>
void Foam::solidReaction<ReactionThermo>::write(Ostream& os) const
{
Reaction<ReactionThermo>::write(os);
} }

View File

@ -38,9 +38,7 @@ SourceFiles
#define solidReaction_H #define solidReaction_H
#include "speciesTable.H" #include "speciesTable.H"
#include "scalarField.H" #include "Reaction.H"
#include "typeInfo.H"
#include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -48,44 +46,40 @@ namespace Foam
{ {
// Forward declaration of friend functions and operators // Forward declaration of friend functions and operators
template<class ReactionThermo>
class solidReaction; class solidReaction;
inline Ostream& operator<<(Ostream&, const solidReaction&); template<class ReactionThermo>
inline Ostream& operator<<(Ostream&, const solidReaction<ReactionThermo>&);
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class solidReaction Declaration Class solidReaction Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
template<class ReactionThermo>
class solidReaction class solidReaction
:
public Reaction<ReactionThermo>
{ {
private: private:
// Private data // Private data
//- List of solid names present in reaction system typedef typename Reaction<ReactionThermo>::specieCoeffs specieCoeffs;
const speciesTable& components_;
//- List of gas species present in reaction system //- List of gas species present in reaction system
speciesTable pyrolisisGases_; speciesTable pyrolisisGases_;
//- Solid components index for the left-hand-side of the reaction //- Gas specie index for the left-hand-side of the reaction
List<label> slhs_; List<specieCoeffs> glhs_;
//- Solid components index for the right-hand-side of the reaction //- Gas specie index for the right-hand-side of the reaction
List<label> srhs_; List<specieCoeffs> grhs_;
//- Specie index for the right-hand-side of the reaction
List<label> grhs_;
// Private Member Functions // Private Member Functions
//- Set rhs and lhs of the reaction
void setLRhs(Istream&);
//- Look for the component index in the reaction
label componentIndex(bool& isGas, Istream& is);
//- Disallow default bitwise assignment //- Disallow default bitwise assignment
void operator=(const solidReaction&); void operator=(const solidReaction&);
@ -94,58 +88,7 @@ private:
public: public:
//- Runtime type information //- Runtime type information
TypeName("Reaction"); TypeName("SolidReaction");
// Declare run-time constructor selection tables
declareRunTimeSelectionTable
(
autoPtr,
solidReaction,
Istream,
(
const speciesTable& components,
Istream& is,
const speciesTable& pyrolysisGases
),
(components, is, pyrolysisGases)
);
// Public classes
//- Class used for the read-construction of PtrLists of reaction
class iNew
{
const speciesTable& components_;
speciesTable pyrolisisGases_;
public:
iNew
(
const speciesTable& components,
Istream& pyrolisisGases
)
:
components_(components),
pyrolisisGases_(pyrolisisGases)
{}
autoPtr<solidReaction> operator()(Istream& is) const
{
return autoPtr<solidReaction>
(
solidReaction::New
(
components_,
is,
pyrolisisGases_
)
);
}
};
// Constructors // Constructors
@ -153,48 +96,59 @@ public:
//- Construct from components //- Construct from components
solidReaction solidReaction
( (
const speciesTable& components, const Reaction<ReactionThermo>& reaction,
const speciesTable& pyrolisisGases, const speciesTable& pyrolisisGases,
const List<label>& slhs, const List<specieCoeffs>& glhs,
const List<label>& srhs, const List<specieCoeffs>& grhs
const List<label>& grhs
); );
//- Construct as copy given new speciesTable //- Construct as copy given new speciesTable
solidReaction solidReaction
( (
const solidReaction&, const solidReaction<ReactionThermo>&,
const speciesTable& components,
const speciesTable& pyrolisisGases const speciesTable& pyrolisisGases
); );
//- Construct from Istream //- Construct from Istream
solidReaction solidReaction
( (
const speciesTable& components, const speciesTable& pyrolisisGases,
Istream& is, const HashPtrTable<ReactionThermo>& thermoDatabase,
const speciesTable& pyrolisisGases Istream& is
); );
//- Construct and return a clone
virtual autoPtr<solidReaction > clone() const //- Construct from dictionary
{ solidReaction
return autoPtr<solidReaction >
( (
new solidReaction(*this) const speciesTable& species,
const HashPtrTable<ReactionThermo>& thermoDatabase,
const dictionary& dict
);
//- Construct and return a clone
virtual autoPtr<Reaction<ReactionThermo> > clone() const
{
return autoPtr<Reaction<ReactionThermo> >
(
new solidReaction<ReactionThermo>(*this)
); );
} }
//- Construct and return a clone with new speciesTable
// Selectors virtual autoPtr<Reaction<ReactionThermo> > clone
//- Return a pointer to a new patchField created on freestore from input
static autoPtr<solidReaction > New
( (
const speciesTable& components, const speciesTable& species
Istream&, ) const
const speciesTable& pyrolisisGases {
return autoPtr<Reaction<ReactionThermo> >
(
new solidReaction<ReactionThermo>(*this, species)
); );
}
//- Destructor //- Destructor
@ -206,23 +160,13 @@ public:
// Access // Access
inline const List<label>& slhs() const;
inline const List<label>& srhs() const;
inline const List<label>& grhs() const;
inline const speciesTable& pyrolisisGases() const; // - Acces to gas components of the reaction
virtual const List<specieCoeffs>& grhs() const;
virtual const List<specieCoeffs>& glhs() const;
// - Access to gas specie list
// solidReaction rate coefficients virtual const speciesTable& gasSpecies() const;
virtual scalar kf
(
const scalar p,
const scalar T,
const scalarField& c
) const;
virtual scalar nReact() const;
//- Write //- Write
@ -231,10 +175,10 @@ public:
// Ostream Operator // Ostream Operator
friend Ostream& operator<< friend Ostream& operator<< <ReactionThermo>
( (
Ostream&, Ostream&,
const solidReaction& const solidReaction<ReactionThermo>&
); );
}; };
@ -249,6 +193,12 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "solidReaction.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif #endif
// ************************************************************************* // // ************************************************************************* //

View File

@ -30,38 +30,13 @@ License
namespace Foam namespace Foam
{ {
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline const List<label>& solidReaction::slhs() const
{
return slhs_;
}
inline const List<label>& solidReaction::srhs() const
{
return srhs_;
}
inline const List<label>& solidReaction::grhs() const
{
return grhs_;
}
inline const speciesTable& solidReaction::pyrolisisGases() const
{
return pyrolisisGases_;
}
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
template<class ReactionThermo>
inline Ostream& operator<< inline Ostream& operator<<
( (
Ostream& os, Ostream& os,
const solidReaction& r const solidReaction<ReactionThermo>& r
) )
{ {
r.write(os); r.write(os);

View File

@ -75,13 +75,25 @@ public:
Istream& is Istream& is
); );
//- Construct from dictionary
inline solidArrheniusReactionRate
(
const speciesTable& species,
const dictionary& dict
);
//- Destructor
virtual ~solidArrheniusReactionRate()
{}
// Member Functions // Member Functions
//- Return the type name //- Return the type name
static word type() static word type()
{ {
return "SolidArrhenius"; return "Arrhenius";
} }
inline scalar operator() inline scalar operator()
@ -92,6 +104,10 @@ public:
) const; ) const;
//- Write to stream
inline void write(Ostream& os) const;
// Ostream Operator // Ostream Operator
inline friend Ostream& operator<< inline friend Ostream& operator<<

View File

@ -30,6 +30,7 @@ inline Foam::solidArrheniusReactionRate::solidArrheniusReactionRate
const scalar A, const scalar A,
const scalar Ta, const scalar Ta,
const scalar Tcrit const scalar Tcrit
//const scalar nReact
) )
: :
A_(A), A_(A),
@ -50,6 +51,18 @@ inline Foam::solidArrheniusReactionRate::solidArrheniusReactionRate
{} {}
inline Foam::solidArrheniusReactionRate::solidArrheniusReactionRate
(
const speciesTable&,
const dictionary& dict
)
:
A_(readScalar(dict.lookup("A"))),
Ta_(readScalar(dict.lookup("Ta"))),
Tcrit_(readScalar(dict.lookup("Tcrit")))
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline Foam::scalar Foam::solidArrheniusReactionRate::operator() inline Foam::scalar Foam::solidArrheniusReactionRate::operator()
@ -74,6 +87,14 @@ inline Foam::scalar Foam::solidArrheniusReactionRate::operator()
} }
inline void Foam::solidArrheniusReactionRate::write(Ostream& os) const
{
os.writeKeyword("A") << A_ << token::END_STATEMENT << nl;
os.writeKeyword("Ta") << Ta_ << token::END_STATEMENT << nl;
os.writeKeyword("Tcrit") << Tcrit_ << token::END_STATEMENT << nl;
}
inline Foam::Ostream& Foam::operator<< inline Foam::Ostream& Foam::operator<<
( (
Ostream& os, Ostream& os,

View File

@ -33,7 +33,9 @@ Description
#define makeSolidReactionThermo_H #define makeSolidReactionThermo_H
#include "solidReaction.H" #include "solidReaction.H"
#include "IrreversibleSolidReaction.H" #include "IrreversibleReaction.H"
#include "Reaction.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -43,32 +45,46 @@ namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeReaction(ReactionType, ReactionRate) \ #define makeSolidReaction(ReactionType, Thermo, ReactionRate) \
\ \
typedef solidReaction Reaction; \ typedef solidReaction<Thermo> solidReaction##Thermo; \
\ \
typedef ReactionType<ReactionRate> \ typedef Reaction<Thermo> Reaction##Thermo; \
ReactionType##ReactionRate; \ \
typedef ReactionType<solidReaction, Thermo, ReactionRate> \
ReactionType##Thermo##ReactionRate; \
\
defineTemplateRunTimeSelectionTable(Reaction##Thermo, Istream); \
defineTemplateRunTimeSelectionTable(Reaction##Thermo, dictionary); \
\
defineTemplateTypeNameAndDebug(solidReaction##Thermo, 0); \
defineTemplateTypeNameAndDebug(Reaction##Thermo, 0); \
\ \
template<> \ template<> \
const word ReactionType##ReactionRate::typeName \ const word ReactionType##Thermo##ReactionRate::typeName \
( \ ( \
ReactionType::typeName_() \ ReactionType::typeName_() \
+ ReactionRate::type() \ + ReactionRate::type() \
+ Reaction::typeName_() \ + solidReaction##Thermo::typeName_() \
); \ ); \
\ \
addToRunTimeSelectionTable \ addToRunTimeSelectionTable \
( \ ( \
Reaction, \ Reaction##Thermo, \
ReactionType##ReactionRate, \ ReactionType##Thermo##ReactionRate, \
Istream \ Istream \
); \
\
addToRunTimeSelectionTable \
( \
Reaction##Thermo, \
ReactionType##Thermo##ReactionRate, \
dictionary \
); );
#define makeSolidIRReactions(Thermo, ReactionRate) \
#define makeIRReactions(ReactionRate) \
\ \
makeReaction(IrreversibleSolidReaction, ReactionRate) makeSolidReaction(IrreversibleReaction, Thermo, ReactionRate)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -25,6 +25,7 @@ License
#include "makeSolidReaction.H" #include "makeSolidReaction.H"
#include "solidArrheniusReactionRate.H" #include "solidArrheniusReactionRate.H"
#include "solidThermoPhysicsTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -33,7 +34,13 @@ namespace Foam
// * * * * * * * * * * * * * Make Solid reactions * * * * * * * * * * * * // // * * * * * * * * * * * * * Make Solid reactions * * * * * * * * * * * * //
makeIRReactions(solidArrheniusReactionRate) makeSolidIRReactions(hConstSolidThermoPhysics, solidArrheniusReactionRate)
makeSolidIRReactions
(
hExponentialSolidThermoPhysics,
solidArrheniusReactionRate
)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -23,45 +23,43 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "reactingSolidMixture.H" #include "solidSpecie.H"
#include "fvMesh.H" #include "IOstreams.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ThermoSolidType> Foam::solidSpecie::solidSpecie(const dictionary& dict)
Foam::reactingSolidMixture<ThermoSolidType>::reactingSolidMixture
(
const dictionary& thermoDict,
const fvMesh& mesh
)
: :
multiComponentSolidMixture<ThermoSolidType> specie
( (
thermoDict, dict.dictName(),
mesh readScalar(dict.subDict("solidSpecie").lookup("nMoles")),
), scalar(1.0)
PtrList<solidReaction>
(
mesh.lookupObject<dictionary>
("chemistryProperties").lookup("reactions"),
solidReaction::iNew
(
this->components_,
mesh.lookupObject<dictionary>
("chemistryProperties").lookup("species")
)
) )
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ThermoSolidType> void Foam::solidSpecie::write(Ostream& os) const
void Foam::reactingSolidMixture<ThermoSolidType>::read {
( dictionary dict("solidSpecie");
const dictionary& thermoDict dict.add("nMoles", nMoles());
) os << indent << dict.dictName() << dict;
{} }
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<(Ostream& os, const solidSpecie& st)
{
os << st.name() << tab
<< st.nMoles();
os.check("Ostream& operator<<(Ostream& os, const solidSpecie& st)");
return os;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -22,103 +22,114 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::IrreversibleSolidReaction Foam::solidSpecie
Description Description
Simple extension of Reaction to handle reversible reactions Base class of the solid thermophysical property types.
SourceFiles SourceFiles
IrreversibleSolidReaction.C solidSpecieI.H
solidSpecie.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef IrreversibleSolidReaction_H #ifndef solidSpecie_H
#define IrreversibleSolidReaction_H #define solidSpecie_H
#include "solidReaction.H" #include "word.H"
#include "scalar.H"
#include "dictionary.H"
#include "specie.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
class Istream;
class Ostream;
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class IrreversibleSolidReaction Declaration Class solidSpecie Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
template<class ReactionRate> class solidSpecie
class IrreversibleSolidReaction
: :
public solidReaction public specie
{ {
// Private data
// Reaction rate
ReactionRate k_;
// Reaction order
scalar nReact_;
// Private Member Functions // Private Member Functions
//- Disallow default bitwise assignment //- Construct from components without name
void operator= inline solidSpecie(const scalar nMoles, const scalar molWeight);
(
const IrreversibleSolidReaction<ReactionRate>&
);
public: public:
//- Runtime type information //- Runtime type information
TypeName("irreversible"); ClassName("solidSpecie");
// Constructors // Constructors
//- Construct from components //- Construct from components with name
IrreversibleSolidReaction inline solidSpecie
( (
const solidReaction& reaction, const word& name,
const ReactionRate& reactionRate, const scalar nMoles,
const scalar nReact const scalar molWeight
); );
//- Construct as copy
inline solidSpecie(const solidSpecie&);
//- Construct from Istream //- Construct as named copy
IrreversibleSolidReaction inline solidSpecie(const word& name, const solidSpecie&);
(
const speciesTable& components,
Istream& is,
const speciesTable& pyrolysisGases
);
//- Construct from dictionary
//- Destructor solidSpecie(const dictionary& dict);
virtual ~IrreversibleSolidReaction()
{}
// Member Functions // Member Functions
// IrreversibleSolidReaction rate coefficients
//- Forward rate constant // I-O
virtual scalar kf
//- Write to Ostream
void write(Ostream& os) const;
// Member operators
inline void operator=(const solidSpecie&);
inline void operator+=(const solidSpecie&);
inline void operator-=(const solidSpecie&);
inline void operator*=(const scalar);
// Friend operators
inline friend solidSpecie operator+
( (
const scalar p, const solidSpecie&, const solidSpecie&
const scalar T, );
const scalarField& c inline friend solidSpecie operator-
) const; (
const solidSpecie&, const solidSpecie&
);
inline friend solidSpecie operator*(const scalar, const solidSpecie&);
//- Reaction order inline friend solidSpecie operator==
virtual scalar nReact() const; (
const solidSpecie&, const solidSpecie&
);
// Ostream Operator
//- Write friend Ostream& operator<<(Ostream&, const solidSpecie&);
virtual void write(Ostream&) const;
}; };
@ -128,9 +139,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository #include "solidSpecieI.H"
# include "IrreversibleSolidReaction.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -0,0 +1,148 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 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 "solidSpecie.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
inline solidSpecie::solidSpecie
(
const word& name,
const scalar nMoles,
const scalar molWeight
)
:
specie(name, nMoles, scalar(1))
{}
inline solidSpecie::solidSpecie
(
const scalar nMoles, const scalar molWeight
)
:
specie(nMoles, molWeight)
{}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
inline solidSpecie::solidSpecie(const solidSpecie& st)
:
specie(st.name(), st.nMoles(), scalar(1))
{}
inline solidSpecie::solidSpecie(const word& name, const solidSpecie& st)
:
specie(name, st.nMoles(), scalar(1))
{}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
inline void solidSpecie::operator=(const solidSpecie& st)
{
specie::operator=(st);
}
inline void solidSpecie::operator+=(const solidSpecie& st)
{
specie::operator+=(st);
}
inline void solidSpecie::operator-=(const solidSpecie& st)
{
specie::operator-=(st);
}
inline void solidSpecie::operator*=(const scalar s)
{
specie::operator*=(s);
}
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
inline solidSpecie operator+(const solidSpecie& st1, const solidSpecie& st2)
{
scalar sumNmoles = max(st1.nMoles() + st2.nMoles(), SMALL);
return solidSpecie
(
sumNmoles,
st1.nMoles()/sumNmoles*st1.W()
+ st2.nMoles()/sumNmoles*st2.W()
);
}
inline solidSpecie operator-(const solidSpecie& st1, const solidSpecie& st2)
{
scalar diffNmoles = st1.nMoles() - st2.nMoles();
if (mag(diffNmoles) < SMALL)
{
diffNmoles = SMALL;
}
return solidSpecie
(
diffNmoles,
st1.nMoles()/diffNmoles*st1.W()
- st2.nMoles()/diffNmoles*st2.W()
);
}
inline solidSpecie operator*(const scalar s, const solidSpecie& st)
{
return solidSpecie
(
s*st.nMoles(),
st.W()
);
}
inline solidSpecie operator==(const solidSpecie& st1, const solidSpecie& st2)
{
return st2 - st1;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -26,7 +26,7 @@ Class
Description Description
Constant properties Transport package. Constant properties Transport package.
Templated into a given thermodynamics package (needed for thermal Templated into a given Thermodynamics package (needed for thermal
conductivity). conductivity).
SourceFiles SourceFiles
@ -44,20 +44,20 @@ SourceFiles
namespace Foam namespace Foam
{ {
template<class thermo> class constAnIsoSolidTransport; template<class Thermo> class constAnIsoSolidTransport;
template<class thermo> template<class Thermo>
inline constAnIsoSolidTransport<thermo> operator* inline constAnIsoSolidTransport<Thermo> operator*
( (
const scalar, const scalar,
const constAnIsoSolidTransport<thermo>& const constAnIsoSolidTransport<Thermo>&
); );
template<class thermo> template<class Thermo>
Ostream& operator<< Ostream& operator<<
( (
Ostream&, Ostream&,
const constAnIsoSolidTransport<thermo>& const constAnIsoSolidTransport<Thermo>&
); );
@ -65,10 +65,10 @@ Ostream& operator<<
Class constAnIsoSolidTransport Declaration Class constAnIsoSolidTransport Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
template<class thermo> template<class Thermo>
class constAnIsoSolidTransport class constAnIsoSolidTransport
: :
public thermo public Thermo
{ {
// Private data // Private data
@ -79,7 +79,7 @@ class constAnIsoSolidTransport
// Private Member Functions // Private Member Functions
//- Construct from components //- Construct from components
inline constAnIsoSolidTransport(const thermo& t, const vector kappa); inline constAnIsoSolidTransport(const Thermo& t, const vector kappa);
public: public:
@ -93,18 +93,36 @@ public:
const constAnIsoSolidTransport& const constAnIsoSolidTransport&
); );
//- Construct from Istream //- Construct from dictionary
//constAnIsoSolidTransport(Istream&);
constAnIsoSolidTransport(const dictionary&); constAnIsoSolidTransport(const dictionary&);
// Selector from dictionary
inline static autoPtr<constAnIsoSolidTransport> New
(
const dictionary& dict
);
// Member functions // Member functions
//- Return the instantiated type name
static word typeName()
{
return "constAnIso<" + Thermo::typeName() + '>';
}
//- Isotropic thermal conductivity [W/mK] //- Isotropic thermal conductivity [W/mK]
inline scalar kappa(const scalar T) const; inline scalar kappa(const scalar p, const scalar T) const;
//- Un-isotropic thermal conductivity [W/mK] //- Un-isotropic thermal conductivity [W/mK]
inline vector Kappa(const scalar T) const; inline vector Kappa(const scalar p, const scalar T) const;
//- Dynamic viscosity [kg/ms]
inline scalar mu(const scalar p, const scalar T) const;
//- Thermal diffusivity of enthalpy [kg/ms]
inline vector alphah(const scalar p, const scalar T) const;
//- Write to Ostream //- Write to Ostream
void write(Ostream& os) const; void write(Ostream& os) const;
@ -121,7 +139,7 @@ public:
// Friend operators // Friend operators
friend constAnIsoSolidTransport operator* <thermo> friend constAnIsoSolidTransport operator* <Thermo>
( (
const scalar, const scalar,
const constAnIsoSolidTransport& const constAnIsoSolidTransport&
@ -130,7 +148,7 @@ public:
// Ostream Operator // Ostream Operator
friend Ostream& operator<< <thermo> friend Ostream& operator<< <Thermo>
( (
Ostream&, Ostream&,
const constAnIsoSolidTransport& const constAnIsoSolidTransport&

View File

@ -25,53 +25,89 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class thermo> template<class Thermo>
inline Foam::constAnIsoSolidTransport<thermo>::constAnIsoSolidTransport inline Foam::constAnIsoSolidTransport<Thermo>::constAnIsoSolidTransport
( (
const thermo& t, const Thermo& t,
const vector kappa const vector kappa
) )
: :
thermo(t), Thermo(t),
kappa_(kappa) kappa_(kappa)
{} {}
template<class thermo> template<class Thermo>
inline Foam::constAnIsoSolidTransport<thermo>::constAnIsoSolidTransport inline Foam::constAnIsoSolidTransport<Thermo>::constAnIsoSolidTransport
( (
const word& name, const word& name,
const constAnIsoSolidTransport& ct const constAnIsoSolidTransport& ct
) )
: :
thermo(name, ct), Thermo(name, ct),
kappa_(ct.kappa_) kappa_(ct.kappa_)
{} {}
template<class Thermo>
inline Foam::autoPtr<Foam::constAnIsoSolidTransport<Thermo> >
Foam::constAnIsoSolidTransport<Thermo>::New
(
const dictionary& dict
)
{
return autoPtr<constAnIsoSolidTransport<Thermo> >
(
new constAnIsoSolidTransport<Thermo>(dict)
);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class thermo> template<class Thermo>
inline Foam::scalar Foam::constAnIsoSolidTransport<thermo>:: inline Foam::scalar Foam::constAnIsoSolidTransport<Thermo>::
kappa(const scalar T) const kappa(const scalar p, const scalar T) const
{ {
return mag(kappa_); return mag(kappa_);
} }
template<class thermo> template<class Thermo>
inline Foam::vector Foam::constAnIsoSolidTransport<thermo>:: inline Foam::vector Foam::constAnIsoSolidTransport<Thermo>::
Kappa(const scalar T) const Kappa(const scalar p, const scalar T) const
{ {
return kappa_; return kappa_;
} }
template<class Thermo>
inline Foam::scalar Foam::constAnIsoSolidTransport<Thermo>::
mu(const scalar p, const scalar T) const
{
notImplemented
(
"Foam::scalar Foam::constAnIsoSolidTransport<Thermo>mu::"
"("
" const scalar p, const scalar T"
") const"
);
return scalar(0);
}
template<class Thermo>
inline Foam::vector Foam::constAnIsoSolidTransport<Thermo>::
alphah(const scalar p, const scalar T) const
{
return kappa_/this->Cpv(p, T);
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class thermo> template<class Thermo>
inline Foam::constAnIsoSolidTransport<thermo>& inline Foam::constAnIsoSolidTransport<Thermo>&
Foam::constAnIsoSolidTransport<thermo>::operator= Foam::constAnIsoSolidTransport<Thermo>::operator=
( (
const constAnIsoSolidTransport<thermo>& ct const constAnIsoSolidTransport<Thermo>& ct
) )
{ {
kappa_ = ct.kappa_; kappa_ = ct.kappa_;
@ -80,10 +116,10 @@ Foam::constAnIsoSolidTransport<thermo>::operator=
} }
template<class thermo> template<class Thermo>
inline void Foam::constAnIsoSolidTransport<thermo>::operator+= inline void Foam::constAnIsoSolidTransport<Thermo>::operator+=
( (
const constAnIsoSolidTransport<thermo>& ct const constAnIsoSolidTransport<Thermo>& ct
) )
{ {
scalar molr1 = this->nMoles(); scalar molr1 = this->nMoles();
@ -95,10 +131,10 @@ inline void Foam::constAnIsoSolidTransport<thermo>::operator+=
} }
template<class thermo> template<class Thermo>
inline void Foam::constAnIsoSolidTransport<thermo>::operator-= inline void Foam::constAnIsoSolidTransport<Thermo>::operator-=
( (
const constAnIsoSolidTransport<thermo>& ct const constAnIsoSolidTransport<Thermo>& ct
) )
{ {
scalar molr1 = this->nMoles(); scalar molr1 = this->nMoles();
@ -113,16 +149,16 @@ inline void Foam::constAnIsoSolidTransport<thermo>::operator-=
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
template<class thermo> template<class Thermo>
inline Foam::constAnIsoSolidTransport<thermo> Foam::operator* inline Foam::constAnIsoSolidTransport<Thermo> Foam::operator*
( (
const scalar s, const scalar s,
const constAnIsoSolidTransport<thermo>& ct const constAnIsoSolidTransport<Thermo>& ct
) )
{ {
return constAnIsoSolidTransport<thermo> return constAnIsoSolidTransport<Thermo>
( (
s*static_cast<const thermo&>(ct), s*static_cast<const Thermo&>(ct),
ct.kappa_ ct.kappa_
); );
} }

View File

@ -28,26 +28,26 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class thermo> template<class Thermo>
Foam::constIsoSolidTransport<thermo>::constIsoSolidTransport Foam::constIsoSolidTransport<Thermo>::constIsoSolidTransport
( (
const dictionary& dict const dictionary& dict
) )
: :
thermo(dict), Thermo(dict),
kappa_(readScalar(dict.subDict("transport").lookup("kappa"))) kappa_(readScalar(dict.subDict("transport").lookup("kappa")))
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class thermo> template<class Thermo>
void Foam::constIsoSolidTransport<thermo>::constIsoSolidTransport::write void Foam::constIsoSolidTransport<Thermo>::constIsoSolidTransport::write
( (
Ostream& os Ostream& os
) const ) const
{ {
thermo::write(os); Thermo::write(os);
dictionary dict("transport"); dictionary dict("transport");
dict.add("kappa", kappa_); dict.add("kappa", kappa_);
@ -57,14 +57,14 @@ void Foam::constIsoSolidTransport<thermo>::constIsoSolidTransport::write
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
template<class thermo> template<class Thermo>
Foam::Ostream& Foam::operator<< Foam::Ostream& Foam::operator<<
( (
Ostream& os, Ostream& os,
const constIsoSolidTransport<thermo>& ct const constIsoSolidTransport<Thermo>& ct
) )
{ {
operator<<(os, static_cast<const thermo&>(ct)); operator<<(os, static_cast<const Thermo&>(ct));
os << tab << ct.kappa_; os << tab << ct.kappa_;
os.check os.check

View File

@ -97,6 +97,12 @@ public:
//- Construct from Istream //- Construct from Istream
constIsoSolidTransport(const dictionary& dict); constIsoSolidTransport(const dictionary& dict);
// Selector from dictionary
inline static autoPtr<constIsoSolidTransport> New
(
const dictionary& dict
);
// Member functions // Member functions
@ -107,10 +113,17 @@ public:
} }
//- Isotropic thermal conductivity [W/mK] //- Isotropic thermal conductivity [W/mK]
inline scalar kappa(const scalar T) const; inline scalar kappa(const scalar p, const scalar T) const;
//- Un-isotropic thermal conductivity [W/mK] //- Un-isotropic thermal conductivity [W/mK]
inline vector Kappa(const scalar T) const; inline vector Kappa(const scalar p, const scalar T) const;
//- Dynamic viscosity [kg/ms]
inline scalar mu(const scalar p, const scalar T) const;
//- Thermal diffusivity of enthalpy [kg/ms]
inline scalar alphah(const scalar p, const scalar T) const;
//- Write to Ostream //- Write to Ostream
void write(Ostream& os) const; void write(Ostream& os) const;

View File

@ -49,23 +49,58 @@ inline Foam::constIsoSolidTransport<thermo>::constIsoSolidTransport
{} {}
template<class Thermo>
inline Foam::autoPtr<Foam::constIsoSolidTransport<Thermo> >
Foam::constIsoSolidTransport<Thermo>::New
(
const dictionary& dict
)
{
return autoPtr<constIsoSolidTransport<Thermo> >
(
new constIsoSolidTransport<Thermo>(dict)
);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class thermo> template<class thermo>
inline Foam::scalar Foam::constIsoSolidTransport<thermo>:: inline Foam::scalar Foam::constIsoSolidTransport<thermo>::
kappa(const scalar T) const kappa(const scalar p, const scalar T) const
{ {
return kappa_; return kappa_;
} }
template<class thermo> template<class thermo>
inline Foam::vector Foam::constIsoSolidTransport<thermo>:: inline Foam::vector Foam::constIsoSolidTransport<thermo>::
Kappa(const scalar T) const Kappa(const scalar p, const scalar T) const
{ {
return vector(kappa_, kappa_, kappa_); return vector(kappa_, kappa_, kappa_);
} }
template<class thermo>
inline Foam::scalar Foam::constIsoSolidTransport<thermo>::
mu(const scalar p, const scalar T) const
{
notImplemented
(
"Foam::scalar Foam::constIsoSolidTransport<thermo>mu::"
"("
" const scalar p, const scalar T"
") const"
);
return scalar(0);
}
template<class thermo>
inline Foam::scalar Foam::constIsoSolidTransport<thermo>::
alphah(const scalar p, const scalar T) const
{
return kappa_/this->Cpv(p, T);
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class thermo> template<class thermo>

View File

@ -103,10 +103,15 @@ public:
const exponentialSolidTransport& const exponentialSolidTransport&
); );
//- Construct from dictionary //- Construct from dictionary
exponentialSolidTransport(const dictionary&); exponentialSolidTransport(const dictionary&);
// Selector from dictionary
inline static autoPtr<exponentialSolidTransport> New
(
const dictionary& dict
);
// Member functions // Member functions
@ -117,10 +122,16 @@ public:
} }
//- Thermal conductivity [W/mK] //- Thermal conductivity [W/mK]
inline scalar kappa(const scalar T) const; inline scalar kappa(const scalar p, const scalar T) const;
//- Thermal conductivity [W/mK] //- Thermal conductivity [W/mK]
inline vector Kappa(const scalar T) const; inline vector Kappa(const scalar p, const scalar T) const;
//- Dynamic viscosity [kg/ms]
inline scalar mu(const scalar p, const scalar T) const;
//- Thermal diffusivity of enthalpy [kg/ms]
inline scalar alphah(const scalar p, const scalar T) const;
//- Write to Ostream //- Write to Ostream
void write(Ostream& os) const; void write(Ostream& os) const;

View File

@ -55,12 +55,25 @@ inline Foam::exponentialSolidTransport<thermo>::exponentialSolidTransport
{} {}
template<class Thermo>
inline Foam::autoPtr<Foam::exponentialSolidTransport<Thermo> >
Foam::exponentialSolidTransport<Thermo>::New
(
const dictionary& dict
)
{
return autoPtr<exponentialSolidTransport<Thermo> >
(
new exponentialSolidTransport<Thermo>(dict)
);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class thermo> template<class thermo>
inline Foam::scalar Foam::exponentialSolidTransport<thermo>::kappa inline Foam::scalar Foam::exponentialSolidTransport<thermo>::kappa
( (
const scalar T const scalar p, const scalar T
) const ) const
{ {
return (kappa0_*pow(T/Tref_, n0_)); return (kappa0_*pow(T/Tref_, n0_));
@ -70,7 +83,7 @@ inline Foam::scalar Foam::exponentialSolidTransport<thermo>::kappa
template<class thermo> template<class thermo>
inline Foam::vector Foam::exponentialSolidTransport<thermo>::Kappa inline Foam::vector Foam::exponentialSolidTransport<thermo>::Kappa
( (
const scalar T const scalar p, const scalar T
) const ) const
{ {
const scalar kappa(kappa0_*pow(T/Tref_, n0_)); const scalar kappa(kappa0_*pow(T/Tref_, n0_));
@ -78,6 +91,28 @@ inline Foam::vector Foam::exponentialSolidTransport<thermo>::Kappa
} }
template<class thermo>
inline Foam::scalar Foam::exponentialSolidTransport<thermo>::
mu(const scalar p, const scalar T) const
{
notImplemented
(
"Foam::scalar Foam::exponentialSolidTransport<thermo>mu::"
"("
" const scalar p, const scalar T"
") const"
);
return scalar(0);
}
template<class thermo>
inline Foam::scalar Foam::exponentialSolidTransport<thermo>::
alphah(const scalar p, const scalar T) const
{
return kappa(p, T)/this->Cpv(p, T);
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //

View File

@ -1,7 +1,6 @@
solidThermo/solidThermo.C solidThermo/solidThermo.C
solidThermo/solidThermos.C solidThermo/solidThermos.C
mixtures/basicSolidMixture/basicSolidMixture.C
solidReactionThermo/solidReactionThermo.C solidReactionThermo/solidReactionThermo.C
solidReactionThermo/solidReactionThermos.C solidReactionThermo/solidReactionThermos.C

View File

@ -3,11 +3,13 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidSpecie/lnInclude -I$(LIB_SRC)/thermophysicalModels/solidSpecie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude
LIB_LIBS = \ LIB_LIBS = \
-lmeshTools \ -lmeshTools \
-lfiniteVolume \ -lfiniteVolume \
-lspecie \ -lspecie \
-lsolidSpecie \ -lsolidSpecie \
-lfluidThermophysicalModels -lfluidThermophysicalModels \
-lreactionThermophysicalModels

View File

@ -1,105 +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 "basicSolidMixture.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::basicSolidMixture::basicSolidMixture
(
const wordList& solidNames,
const fvMesh& mesh
)
:
components_(solidNames),
Y_(components_.size())
{
forAll(components_, i)
{
IOobject header
(
"Y" + components_[i],
mesh.time().timeName(),
mesh,
IOobject::NO_READ
);
// check if field exists and can be read
if (header.headerOk())
{
Y_.set
(
i,
new volScalarField
(
IOobject
(
"Y" + components_[i],
mesh.time().timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
)
);
}
else
{
volScalarField Ydefault
(
IOobject
(
"Ydefault",
mesh.time().timeName(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
mesh
);
Y_.set
(
i,
new volScalarField
(
IOobject
(
"Y" + components_[i],
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
Ydefault
)
);
}
}
}
// ************************************************************************* //

View File

@ -1,214 +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::basicSolidMixture
Description
Foam::basicSolidMixture
\*---------------------------------------------------------------------------*/
#ifndef basicSolidMixture_H
#define basicSolidMixture_H
#include "volFields.H"
#include "speciesTable.H"
#include "PtrList.H"
#include "error.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class basicSolidMixture Declaration
\*---------------------------------------------------------------------------*/
class basicSolidMixture
{
protected:
// Protected data
typedef speciesTable solidsTable;
//- The names of the solids
solidsTable components_;
//- Solid mass fractions
PtrList<volScalarField> Y_;
public:
//- The base class of the mixture
typedef basicSolidMixture basicMixtureType;
// Constructors
//- Construct from word list and mesh
basicSolidMixture
(
const wordList& solidNames,
const fvMesh&
);
//- Destructor
virtual ~basicSolidMixture()
{}
// Member Functions
//- Return the solid table
const solidsTable& components() const
{
return components_;
}
//- Return the mass-fraction fields
inline PtrList<volScalarField>& Y();
//- Return the const mass-fraction fields
inline const PtrList<volScalarField>& Y() const;
//- Return the mass-fraction field for a specie given by index
inline volScalarField& Y(const label i);
//- Return the const mass-fraction field for a specie given by index
inline const volScalarField& Y(const label i) const;
//- Return the mass-fraction field for a specie given by name
inline volScalarField& Y(const word& specieName);
//- Return the const mass-fraction field for a specie given by name
inline const volScalarField& Y(const word& specieName) const;
//- Does the mixture include this specie?
inline bool contains(const word& specieName) const;
// Per specie thermo properties
//- Heat capacity at constant pressure [J/(kg K)]
virtual scalar Cp
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
//- Heat capacity at constant volume [J/(kg K)]
virtual scalar Cv
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
//- Absolute enthalpy [J/kg]
virtual scalar Ha
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
//- Sensible enthalpy [J/kg]
virtual scalar Hs
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
//- Chemical enthalpy [J/kg]
virtual scalar Hc(const label specieI) const = 0;
//- Density [Kg/m3]
virtual scalar rho
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
// Per specie transport properties
//- Thermal conductivity [W/m/K]
virtual scalar kappa
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
//- An-isotropic thermal conductivity [W/m/K]
virtual vector Kappa
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
//- Thermal diffusivity of enthalpy/internal energy [kg/m/s]
virtual scalar alpha
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
// Cell based properties with on the run mixture calculation
//- Density
virtual scalar rho(scalar p, scalar T, label celli) const = 0;
//- Thermal conductivity
virtual scalar kappa(scalar p, scalar T, label celli) const = 0;
//- Specific heat capacity
virtual scalar Cp(scalar p, scalar T, label celli) const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "basicSolidMixtureI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,76 +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/>.
\*---------------------------------------------------------------------------*/
inline Foam::PtrList<Foam::volScalarField>& Foam::basicSolidMixture::Y()
{
return Y_;
}
inline const Foam::PtrList<Foam::volScalarField>& Foam::basicSolidMixture::Y()
const
{
return Y_;
}
inline Foam::volScalarField& Foam::basicSolidMixture::Y(const label i)
{
return Y_[i];
}
inline const Foam::volScalarField& Foam::basicSolidMixture::Y
(
const label i
) const
{
return Y_[i];
}
inline Foam::volScalarField& Foam::basicSolidMixture::Y(const word& specieName)
{
return Y_[components_[specieName]];
}
inline const Foam::volScalarField& Foam::basicSolidMixture::Y
(
const word& specieName
) const
{
return Y_[components_[specieName]];
}
inline bool Foam::basicSolidMixture::contains(const word& specieName) const
{
return components_.contains(specieName);
}
// ************************************************************************* //

View File

@ -1,108 +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/>.
Description
Mixture instantiation
\*---------------------------------------------------------------------------*/
#include "basicMixture.H"
#include "makeBasicMixture.H"
#include "rhoConst.H"
#include "hConstThermo.H"
#include "hExponentialThermo.H"
#include "constIsoSolidTransport.H"
#include "constAnIsoSolidTransport.H"
#include "exponentialSolidTransport.H"
#include "sensibleInternalEnergy.H"
#include "sensibleEnthalpy.H"
#include "thermo.H"
#include "pureSolidMixture.H"
#include "multiComponentSolidMixture.H"
#include "reactingSolidMixture.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */
makeBasicMixture
(
pureSolidMixture,
constIsoSolidTransport,
sensibleEnthalpy,
hConstThermo,
rhoConst
);
makeBasicMixture
(
pureSolidMixture,
constAnIsoSolidTransport,
sensibleEnthalpy,
hConstThermo,
rhoConst
);
makeBasicMixture
(
pureSolidMixture,
exponentialSolidTransport,
sensibleEnthalpy,
hExponentialThermo,
rhoConst
);
makeBasicMixture
(
multiComponentSolidMixture,
constIsoSolidTransport,
sensibleEnthalpy,
hConstThermo,
rhoConst
);
makeBasicMixture
(
reactingSolidMixture,
constIsoSolidTransport,
sensibleEnthalpy,
hConstThermo,
rhoConst
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -1,363 +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 "multiComponentSolidMixture.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class ThermoType>
const ThermoType& Foam::multiComponentSolidMixture<ThermoType>::
constructSolidData
(
const dictionary& thermoSolidDict
)
{
forAll(components_, i)
{
solidData_.set
(
i,
new ThermoType
(
thermoSolidDict.subDict(components_[i] + "Coeffs")
)
);
}
return solidData_[0];
}
template<class ThermoType>
void Foam::multiComponentSolidMixture<ThermoType>::correctMassFractions()
{
volScalarField Yt("Yt", Y_[0]);
for (label n=1; n<Y_.size(); n++)
{
Yt += Y_[n];
}
forAll(Y_, n)
{
Y_[n] /= Yt;
}
}
template<class ThermoType>
Foam::scalar Foam::multiComponentSolidMixture<ThermoType>::X
(
label specieI, label celli, scalar p, scalar T
) const
{
scalar rhoInv = 0.0;
forAll(solidData_, i)
{
rhoInv += Y_[i][celli]/solidData_[i].rho(p, T);
}
scalar X = Y_[specieI][celli]/solidData_[specieI].rho(p, T);
return (X/rhoInv);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ThermoType>
Foam::multiComponentSolidMixture<ThermoType>::multiComponentSolidMixture
(
const dictionary& thermoSolidDict,
const fvMesh& mesh
)
:
basicSolidMixture
(
thermoSolidDict.lookup("solidComponents"),
mesh
),
solidData_(components_.size()),
mixture_("mixture", constructSolidData(thermoSolidDict)),
mixtureVol_("mixture", constructSolidData(thermoSolidDict))
{
correctMassFractions();
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ThermoType>
const ThermoType& Foam::multiComponentSolidMixture<ThermoType>::cellVolMixture
(
const scalar p,
const scalar T,
const label celli
) const
{
scalar rhoInv = 0.0;
forAll(solidData_, i)
{
rhoInv += Y_[i][celli]/solidData_[i].rho(p, T);
}
mixtureVol_ = Y_[0][celli]/solidData_[0].rho(p, T)/rhoInv*solidData_[0];
for (label n=1; n<Y_.size(); n++)
{
mixtureVol_ +=
Y_[n][celli]/solidData_[n].rho(p, T)/rhoInv*solidData_[n];
}
return mixtureVol_;
}
template<class ThermoType>
const ThermoType& Foam::multiComponentSolidMixture<ThermoType>::cellMixture
(
const label celli
) const
{
mixture_ = Y_[0][celli]*solidData_[0];
for (label n=1; n<Y_.size(); n++)
{
mixture_ += Y_[n][celli]*solidData_[n];
}
return mixture_;
}
template<class ThermoType>
const ThermoType& Foam::multiComponentSolidMixture<ThermoType>::
patchFaceVolMixture
(
const scalar p,
const scalar T,
const label patchi,
const label facei
) const
{
scalar rhoInv = 0.0;
forAll(solidData_, i)
{
rhoInv += Y_[i].boundaryField()[patchi][facei]/solidData_[i].rho(p, T);
}
mixtureVol_ =
Y_[0].boundaryField()[patchi][facei]
/ solidData_[0].rho(p, T)
/ rhoInv
* solidData_[0];
for (label n=1; n<Y_.size(); n++)
{
mixtureVol_ +=
Y_[n].boundaryField()[patchi][facei]
/ solidData_[n].rho(p,T)
/ rhoInv
* solidData_[n];
}
return mixtureVol_;
}
template<class ThermoType>
const ThermoType& Foam::multiComponentSolidMixture<ThermoType>::
patchFaceMixture
(
const label patchi,
const label facei
) const
{
mixture_ =
Y_[0].boundaryField()[patchi][facei]*solidData_[0];
for (label n=1; n<Y_.size(); n++)
{
mixture_ += Y_[n].boundaryField()[patchi][facei]*solidData_[n];
}
return mixture_;
}
template<class ThermoType>
Foam::scalar Foam::multiComponentSolidMixture<ThermoType>::Cp
(
const label specieI, const scalar p, const scalar T
) const
{
return solidData_[specieI].Cp(p, T);
}
template<class ThermoType>
Foam::scalar Foam::multiComponentSolidMixture<ThermoType>::Cv
(
const label specieI, const scalar p, const scalar T
) const
{
return solidData_[specieI].Cv(p, T);
}
template<class ThermoType>
Foam::scalar Foam::multiComponentSolidMixture<ThermoType>::Ha
(
const label specieI, const scalar p, const scalar T
) const
{
return solidData_[specieI].Ha(p, T);
}
template<class ThermoType>
Foam::scalar Foam::multiComponentSolidMixture<ThermoType>::Hs
(
const label specieI, const scalar p, const scalar T
) const
{
return solidData_[specieI].Hs(p, T);
}
template<class ThermoType>
Foam::scalar Foam::multiComponentSolidMixture<ThermoType>::Hc
(
const label specieI
) const
{
return solidData_[specieI].Hc();
}
template<class ThermoType>
Foam::scalar Foam::multiComponentSolidMixture<ThermoType>::rho
(
const label specieI, const scalar p, const scalar T
) const
{
return solidData_[specieI].rho(p, T);
}
template<class ThermoType>
Foam::scalar Foam::multiComponentSolidMixture<ThermoType>::kappa
(
const label specieI, const scalar p, const scalar T
) const
{
return solidData_[specieI].kappa(T);
}
template<class ThermoType>
Foam::vector Foam::multiComponentSolidMixture<ThermoType>::Kappa
(
const label specieI, const scalar p, const scalar T
) const
{
return solidData_[specieI].Kappa(T);
}
template<class ThermoType>
Foam::scalar Foam::multiComponentSolidMixture<ThermoType>::alpha
(
const label specieI, const scalar p, const scalar T
) const
{
return solidData_[specieI].kappa(T)/solidData_[specieI].Cpv(p, T);
}
template<class ThermoType>
Foam::scalar Foam::multiComponentSolidMixture<ThermoType>::rho
(
scalar p, scalar T, label celli
) const
{
scalar tmp = 0.0;
forAll(solidData_, i)
{
tmp += solidData_[i].rho(p, T)*X(i, celli, p, T);
}
return tmp;
}
template<class ThermoType>
Foam::scalar Foam::multiComponentSolidMixture<ThermoType>::kappa
(
scalar p, scalar T, label celli
) const
{
scalar tmp = 0.0;
forAll(solidData_, i)
{
tmp += solidData_[i].kappa(T)*X(i, celli, p, T);
}
return tmp;
}
template<class ThermoType>
Foam::scalar Foam::multiComponentSolidMixture<ThermoType>::Cp
(
scalar p, scalar T, label celli
) const
{
scalar tmp = 0.0;
forAll(solidData_, i)
{
tmp += solidData_[i].Cp(p, T)*Y_[i][celli];
}
return tmp;
}
template<class ThermoType>
void Foam::multiComponentSolidMixture<ThermoType>::read
(
const dictionary& thermoDict
)
{
forAll(components_, i)
{
solidData_[i] =
ThermoType(thermoDict.subDict(components_[i] + "Coeffs"));
}
}
// ************************************************************************* //

View File

@ -1,233 +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::multiComponentSolidMixture
Description
Foam::multiComponentSolidMixture
\*---------------------------------------------------------------------------*/
#ifndef multiComponentSolidMixture_H
#define multiComponentSolidMixture_H
#include "PtrList.H"
#include "autoPtr.H"
#include "basicSolidMixture.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class multiComponentSolidMixture Declaration
\*---------------------------------------------------------------------------*/
template<class ThermoType>
class multiComponentSolidMixture
:
public basicSolidMixture
{
// Private data
//- Solid data
PtrList<ThermoType> solidData_;
//- Temporary storage for the mass cell/face mixture thermo data
mutable ThermoType mixture_;
//- Temporary storage for the volume weighted
// cell/face mixture thermo data
mutable ThermoType mixtureVol_;
// Private Member Functions
//- Correct the mass fractions to sum to 1
void correctMassFractions();
//- Return molar fraction for specieI in celli
scalar X(label specieI, label celli, scalar p, scalar T) const;
//- Construct solid data
const ThermoType& constructSolidData(const dictionary&);
public:
//- The type of thermodynamics this mixture is instantiated for
typedef ThermoType thermoType;
// Constructors
//- Construct from dictionary and mesh
multiComponentSolidMixture(const dictionary&, const fvMesh&);
//- Destructor
virtual ~multiComponentSolidMixture()
{}
// Member Functions
const ThermoType& cellMixture(const label celli) const;
const ThermoType& patchFaceMixture
(
const label patchi,
const label facei
) const;
const ThermoType& cellVolMixture
(
const scalar p,
const scalar T,
const label celli
) const;
const ThermoType& patchFaceVolMixture
(
const scalar p,
const scalar T,
const label patchi,
const label facei
) const;
//- Return the raw solid data
const PtrList<ThermoType>& solidData() const
{
return solidData_;
}
//- Read dictionary
void read(const dictionary&);
// Per specie thermo properties
//- Heat capacity at constant pressure [J/(kg K)]
virtual scalar Cp
(
const label specieI,
const scalar p,
const scalar T
) const;
//- Heat capacity at constant volume [J/(kg K)]
virtual scalar Cv
(
const label specieI,
const scalar p,
const scalar T
) const;
//- Absolute enthalpy [J/kg]
virtual scalar Ha
(
const label specieI,
const scalar p,
const scalar T
) const;
//- Sensible enthalpy [J/kg]
virtual scalar Hs
(
const label specieI,
const scalar p,
const scalar T
) const;
//- Chemical enthalpy [J/kg]
virtual scalar Hc(const label specieI) const;
//- Density [Kg/m3]
virtual scalar rho
(
const label specieI,
const scalar p,
const scalar T
) const;
// Per specie transport properties
//- Thermal conductivity [W/m/K]
virtual scalar kappa
(
const label specieI,
const scalar p,
const scalar T
) const;
//- An-isotropic thermal conductivity [W/m/K]
virtual vector Kappa
(
const label specieI,
const scalar p,
const scalar T
) const;
//- Thermal diffusivity of enthalpy/internal energy [kg/m/s]
virtual scalar alpha
(
const label specieI,
const scalar p,
const scalar T
) const;
// Cell based properties with on the run mixture calculation.
//- Density
virtual scalar rho(scalar p, scalar T, label celli) const;
//- Thermal conductivity
virtual scalar kappa(scalar p, scalar T, label celli) const;
//- Specific heat capacity
virtual scalar Cp(scalar p, scalar T, label celli) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "multiComponentSolidMixture.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,68 +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 "pureSolidMixture.H"
#include "fvMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ThermoType>
pureSolidMixture<ThermoType>::pureSolidMixture
(
const dictionary& thermoDict,
const fvMesh& mesh
)
:
basicMixture(thermoDict, mesh),
mixture_(thermoDict.subDict("mixture"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class ThermoType>
pureSolidMixture<ThermoType>::~pureSolidMixture()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ThermoType>
void pureSolidMixture<ThermoType>::read(const dictionary& thermoDict)
{
mixture_ = ThermoType(thermoDict.subDict("mixture"));
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

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/>.
Class
Foam::pureSolidMixture
Description
Foam::pureSolidMixture
SourceFiles
pureSolidMixture.C
\*---------------------------------------------------------------------------*/
#ifndef pureSolidMixture_H
#define pureSolidMixture_H
#include "basicMixture.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class pureSolidMixture Declaration
\*---------------------------------------------------------------------------*/
template<class ThermoType>
class pureSolidMixture
:
public basicMixture
{
// Private data
ThermoType mixture_;
//- Construct as copy (not implemented)
pureSolidMixture(const pureSolidMixture<ThermoType>&);
public:
//- The type of thermodynamics this mixture is instantiated for
typedef ThermoType thermoType;
// Constructors
//- Construct from dictionary and mesh
pureSolidMixture(const dictionary&, const fvMesh&);
//- Destructor
virtual ~pureSolidMixture();
// Member functions
const ThermoType& cellMixture(const label) const
{
return mixture_;
}
const ThermoType& cellVolMixture
(
const scalar,
const scalar,
const label
) const
{
return mixture_;
}
const ThermoType& patchFaceMixture
(
const label,
const label
) const
{
return mixture_;
}
const ThermoType& patchFaceVolMixture
(
const scalar,
const scalar,
const label,
const label
) const
{
return mixture_;
}
//- Read dictionary
void read(const dictionary&);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
#ifdef NoRepository
# include "pureSolidMixture.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,103 +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::reactingSolidMixture
Description
Foam::reactingSolidMixture
SourceFiles
reactingSolidMixture.C
\*---------------------------------------------------------------------------*/
#ifndef reactingSolidMixture_H
#define reactingSolidMixture_H
#include "multiComponentSolidMixture.H"
#include "solidReaction.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class reactingSolidMixture Declaration
\*---------------------------------------------------------------------------*/
template<class ThermoSolidType>
class reactingSolidMixture
:
public multiComponentSolidMixture<ThermoSolidType>,
public PtrList<solidReaction>
{
// Private Member Functions
//- Disallow default bitwise copy construct
reactingSolidMixture(const reactingSolidMixture&);
//- Disallow default bitwise assignment
void operator=(const reactingSolidMixture&);
public:
//- The type of thermo package this mixture is instantiated for
typedef ThermoSolidType thermoType;
// Constructors
//- Construct from dictionary and mesh
reactingSolidMixture(const dictionary&, const fvMesh&);
//- Destructor
virtual ~reactingSolidMixture()
{}
// Member functions
//- Read dictionary
void read(const dictionary&);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "reactingSolidMixture.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,127 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 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/>.
InClass
Foam::solidThermo
Description
Macros for creating reacting solid thermo packages
\*---------------------------------------------------------------------------*/
#ifndef makeReactingSolidThermo_H
#define makeReactingSolidThermo_H
#include "addToRunTimeSelectionTable.H"
#include "SpecieMixture.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeSolidReactionMixtureThermo(BaseThermo,Cthermo,Mixture,ThermoPhys) \
\
typedef SpecieMixture \
< \
Mixture \
< \
ThermoPhys \
> \
> SpecieMixture##Mixture##ThermoPhys; \
\
typedef \
heThermo \
< \
BaseThermo, \
SpecieMixture##Mixture##ThermoPhys \
> heThermo##Mixture##ThermoPhys; \
\
typedef \
Cthermo \
< \
BaseThermo, \
SpecieMixture##Mixture##ThermoPhys \
> Cthermo##Mixture##ThermoPhys; \
\
\
defineTemplateTypeNameAndDebugWithName \
( \
Cthermo##Mixture##ThermoPhys, \
( \
#Cthermo"<"#Mixture"<" \
+ ThermoPhys::typeName() \
+ ">>" \
).c_str(), \
0 \
); \
\
addToRunTimeSelectionTable \
( \
basicThermo, \
Cthermo##Mixture##ThermoPhys, \
fvMesh \
); \
\
addToRunTimeSelectionTable \
( \
BaseThermo, \
Cthermo##Mixture##ThermoPhys, \
fvMesh \
); \
\
addToRunTimeSelectionTable \
( \
BaseThermo, \
Cthermo##Mixture##ThermoPhys, \
dictionary \
);
#define makeReactingSolidThermo(BaseThermo,CThermo,Mixture,Transport,Type,Thermo,EqnOfState,Specie) \
\
typedef \
Transport \
< \
species::thermo \
< \
Thermo \
< \
EqnOfState \
< \
Specie \
> \
>, \
Type \
> \
> Transport##Type##Thermo##EqnOfState##Specie; \
\
makeSolidReactionMixtureThermo \
( \
BaseThermo, \
CThermo, \
Mixture, \
Transport##Type##Thermo##EqnOfState##Specie \
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -35,7 +35,7 @@ SourceFiles
#ifndef solidReactionThermo_H #ifndef solidReactionThermo_H
#define solidReactionThermo_H #define solidReactionThermo_H
#include "basicSolidMixture.H" #include "basicMultiComponentMixture.H"
#include "solidThermo.H" #include "solidThermo.H"
#include "autoPtr.H" #include "autoPtr.H"
#include "runTimeSelectionTables.H" #include "runTimeSelectionTables.H"
@ -109,10 +109,11 @@ public:
// Member functions // Member functions
//- Return the composition of the multi-component mixture //- Return the composition of the multi-component mixture
virtual basicSolidMixture& composition() = 0; virtual basicMultiComponentMixture& composition() = 0;
//- Return the composition of the multi-component mixture //- Return the composition of the multi-component mixture
virtual const basicSolidMixture& composition() const = 0; virtual const basicMultiComponentMixture& composition() const = 0;
}; };

View File

@ -23,18 +23,21 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "makeSolidThermo.H" #include "makeReactingSolidThermo.H"
#include "solidReactionThermo.H" #include "solidReactionThermo.H"
#include "heSolidThermo.H" #include "heSolidThermo.H"
#include "specie.H" #include "solidSpecie.H"
#include "rhoConst.H" #include "rhoConst.H"
#include "hConstThermo.H" #include "hConstThermo.H"
#include "hExponentialThermo.H" #include "hExponentialThermo.H"
#include "constIsoSolidTransport.H" #include "constIsoSolidTransport.H"
#include "constAnIsoSolidTransport.H" #include "constAnIsoSolidTransport.H"
#include "exponentialSolidTransport.H" #include "exponentialSolidTransport.H"
#include "reactingSolidMixture.H"
#include "reactingMixture.H"
#include "multiComponentMixture.H"
#include "sensibleEnthalpy.H" #include "sensibleEnthalpy.H"
#include "thermo.H" #include "thermo.H"
@ -46,16 +49,29 @@ namespace Foam
/* * * * * * * * * * * * * * * * * Enthalpy-based * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * Enthalpy-based * * * * * * * * * * * * * */
makeSolidThermo makeReactingSolidThermo
( (
solidReactionThermo, solidReactionThermo,
heSolidThermo, heSolidThermo,
reactingSolidMixture, reactingMixture,
constIsoSolidTransport, constIsoSolidTransport,
sensibleEnthalpy, sensibleEnthalpy,
hConstThermo, hConstThermo,
rhoConst, rhoConst,
specie solidSpecie
);
makeReactingSolidThermo
(
solidThermo,
heSolidThermo,
multiComponentMixture,
constIsoSolidTransport,
sensibleEnthalpy,
hConstThermo,
rhoConst,
solidSpecie
); );

View File

@ -56,7 +56,7 @@ void Foam::heSolidThermo<BasicSolidThermo, MixtureType>::calculate()
rhoCells[celli] = volMixture_.rho(pCells[celli], TCells[celli]); rhoCells[celli] = volMixture_.rho(pCells[celli], TCells[celli]);
alphaCells[celli] = alphaCells[celli] =
volMixture_.kappa(TCells[celli]) volMixture_.kappa(pCells[celli], TCells[celli])
/ /
mixture_.Cpv(pCells[celli], TCells[celli]); mixture_.Cpv(pCells[celli], TCells[celli]);
} }
@ -86,10 +86,12 @@ void Foam::heSolidThermo<BasicSolidThermo, MixtureType>::calculate()
facei facei
); );
ph[facei] = mixture_.HE(pp[facei], pT[facei]); ph[facei] = mixture_.HE(pp[facei], pT[facei]);
prho[facei] = volMixture_.rho(pp[facei], pT[facei]); prho[facei] = volMixture_.rho(pp[facei], pT[facei]);
palpha[facei] = palpha[facei] =
volMixture_.kappa(pT[facei]) volMixture_.kappa(pp[facei], pT[facei])
/ mixture_.Cpv(pp[facei], pT[facei]); / mixture_.Cpv(pp[facei], pT[facei]);
} }
} }
@ -111,8 +113,9 @@ void Foam::heSolidThermo<BasicSolidThermo, MixtureType>::calculate()
pT[facei] = mixture_.THE(ph[facei], pp[facei] ,pT[facei]); pT[facei] = mixture_.THE(ph[facei], pp[facei] ,pT[facei]);
prho[facei] = volMixture_.rho(pp[facei], pT[facei]); prho[facei] = volMixture_.rho(pp[facei], pT[facei]);
palpha[facei] = palpha[facei] =
volMixture_.kappa(pT[facei]) volMixture_.kappa(pp[facei], pT[facei])
/ mixture_.Cpv(pp[facei], pT[facei]); / mixture_.Cpv(pp[facei], pT[facei]);
} }
} }
@ -204,7 +207,7 @@ Foam::heSolidThermo<BasicSolidThermo, MixtureType>::Kappa() const
pCells[celli], pCells[celli],
TCells[celli], TCells[celli],
celli celli
).Kappa(TCells[celli]); ).Kappa(pCells[celli], TCells[celli]);
} }
forAll(Kappa.boundaryField(), patchi) forAll(Kappa.boundaryField(), patchi)
@ -222,7 +225,7 @@ Foam::heSolidThermo<BasicSolidThermo, MixtureType>::Kappa() const
pT[facei], pT[facei],
patchi, patchi,
facei facei
).Kappa(pT[facei]); ).Kappa(pp[facei], pT[facei]);
} }
} }
@ -252,7 +255,7 @@ Foam::heSolidThermo<BasicSolidThermo, MixtureType>::Kappa
Tp[facei], Tp[facei],
patchi, patchi,
facei facei
).Kappa(Tp[facei]); ).Kappa(pp[facei], Tp[facei]);
} }
return tKappa; return tKappa;

View File

@ -32,31 +32,55 @@ Description
#ifndef makeSolidThermo_H #ifndef makeSolidThermo_H
#define makesolidThermo_H #define makesolidThermo_H
#include "makeThermo.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeSolidThermo(BaseThermo,Cthermo,Mixture,Transport,Type,Thermo,EqnOfState,Specie)\ #define makeSolidThermo(BaseThermo,Cthermo,Mixture,Transport,Type,Thermo,EqnOfState,Specie)\
\ \
makeThermoTypedefs \
( \
BaseThermo, \
Cthermo, \
Mixture, \
Transport, \
Type, \
Thermo, \
EqnOfState, \
Specie \
) \
\ \
addToRunTimeSelectionTable \ typedef \
Transport \
< \
species::thermo \
< \
Thermo \
< \
EqnOfState \
< \
Specie \
> \
>, \
Type \
> \
> Transport##Type##Thermo##EqnOfState##Specie; \
\
typedef \
heThermo \
< \
BaseThermo, \
Mixture<Transport##Type##Thermo##EqnOfState##Specie> \
> heThermo##Mixture##Transport##Type##Thermo##EqnOfState##Specie; \
\
typedef \
Cthermo \
< \
BaseThermo, \
Mixture<Transport##Type##Thermo##EqnOfState##Specie> \
> Cthermo##Mixture##Transport##Type##Thermo##EqnOfState##Specie; \
\
\
defineTemplateTypeNameAndDebugWithName \
( \ ( \
basicThermo, \
Cthermo##Mixture##Transport##Type##Thermo##EqnOfState##Specie, \ Cthermo##Mixture##Transport##Type##Thermo##EqnOfState##Specie, \
fvMesh \ ( \
#Cthermo"<"#Mixture"<" \
+ Transport##Type##Thermo##EqnOfState##Specie::typeName() \
+ ">>" \
).c_str(), \
0 \
); \ ); \
\ \
\
addToRunTimeSelectionTable \ addToRunTimeSelectionTable \
( \ ( \
BaseThermo, \ BaseThermo, \

View File

@ -40,7 +40,6 @@ SourceFiles
#include "fvMesh.H" #include "fvMesh.H"
#include "IOdictionary.H" #include "IOdictionary.H"
#include "autoPtr.H" #include "autoPtr.H"
#include "basicSolidMixture.H"
#include "basicThermo.H" #include "basicThermo.H"
#include "autoPtr.H" #include "autoPtr.H"

View File

@ -27,16 +27,14 @@ License
#include "solidThermo.H" #include "solidThermo.H"
#include "heSolidThermo.H" #include "heSolidThermo.H"
#include "specie.H" #include "solidSpecie.H"
#include "rhoConst.H" #include "rhoConst.H"
#include "hConstThermo.H" #include "hConstThermo.H"
#include "hExponentialThermo.H" #include "hExponentialThermo.H"
#include "constIsoSolidTransport.H" #include "constIsoSolidTransport.H"
#include "constAnIsoSolidTransport.H" #include "constAnIsoSolidTransport.H"
#include "exponentialSolidTransport.H" #include "exponentialSolidTransport.H"
#include "pureSolidMixture.H" #include "pureMixture.H"
#include "multiComponentSolidMixture.H"
#include "reactingSolidMixture.H"
#include "sensibleEnthalpy.H" #include "sensibleEnthalpy.H"
#include "sensibleInternalEnergy.H" #include "sensibleInternalEnergy.H"
#include "thermo.H" #include "thermo.H"
@ -53,51 +51,38 @@ makeSolidThermo
( (
solidThermo, solidThermo,
heSolidThermo, heSolidThermo,
pureSolidMixture, pureMixture,
constIsoSolidTransport, constIsoSolidTransport,
sensibleEnthalpy, sensibleEnthalpy,
hConstThermo, hConstThermo,
rhoConst, rhoConst,
specie solidSpecie
); );
makeSolidThermo makeSolidThermo
( (
solidThermo, solidThermo,
heSolidThermo, heSolidThermo,
pureSolidMixture, pureMixture,
constAnIsoSolidTransport, constAnIsoSolidTransport,
sensibleEnthalpy, sensibleEnthalpy,
hConstThermo, hConstThermo,
rhoConst, rhoConst,
specie solidSpecie
); );
makeSolidThermo makeSolidThermo
( (
solidThermo, solidThermo,
heSolidThermo, heSolidThermo,
pureSolidMixture, pureMixture,
exponentialSolidTransport, exponentialSolidTransport,
sensibleEnthalpy, sensibleEnthalpy,
hExponentialThermo, hExponentialThermo,
rhoConst, rhoConst,
specie solidSpecie
); );
makeSolidThermo
(
solidThermo,
heSolidThermo,
multiComponentSolidMixture,
constIsoSolidTransport,
sensibleEnthalpy,
hConstThermo,
rhoConst,
specie
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam } // End namespace Foam

View File

@ -27,60 +27,94 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ReactionThermo, class ReactionRate> template
Foam::IrreversibleReaction<ReactionThermo, ReactionRate>::IrreversibleReaction <
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
Foam::IrreversibleReaction<ReactionType, ReactionThermo, ReactionRate>::
IrreversibleReaction
( (
const Reaction<ReactionThermo>& reaction, const ReactionType<ReactionThermo>& reaction,
const ReactionRate& k const ReactionRate& k
) )
: :
Reaction<ReactionThermo>(reaction), ReactionType<ReactionThermo>(reaction),
k_(k) k_(k)
{} {}
template<class ReactionThermo, class ReactionRate> template
Foam::IrreversibleReaction<ReactionThermo, ReactionRate>::IrreversibleReaction <
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
Foam::IrreversibleReaction<ReactionType, ReactionThermo, ReactionRate>::
IrreversibleReaction
( (
const speciesTable& species, const speciesTable& species,
const HashPtrTable<ReactionThermo>& thermoDatabase, const HashPtrTable<ReactionThermo>& thermoDatabase,
Istream& is Istream& is
) )
: :
Reaction<ReactionThermo>(species, thermoDatabase, is), ReactionType<ReactionThermo>(species, thermoDatabase, is),
k_(species, is) k_(species, is)
{} {}
template<class ReactionThermo, class ReactionRate> template
Foam::IrreversibleReaction<ReactionThermo, ReactionRate>::IrreversibleReaction <
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
Foam::IrreversibleReaction<ReactionType, ReactionThermo, ReactionRate>::
IrreversibleReaction
( (
const speciesTable& species, const speciesTable& species,
const HashPtrTable<ReactionThermo>& thermoDatabase, const HashPtrTable<ReactionThermo>& thermoDatabase,
const dictionary& dict const dictionary& dict
) )
: :
Reaction<ReactionThermo>(species, thermoDatabase, dict), ReactionType<ReactionThermo>(species, thermoDatabase, dict),
k_(species, dict) k_(species, dict)
{} {}
template<class ReactionThermo, class ReactionRate> template
Foam::IrreversibleReaction<ReactionThermo, ReactionRate>::IrreversibleReaction <
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
Foam::IrreversibleReaction<ReactionType, ReactionThermo, ReactionRate>::
IrreversibleReaction
( (
const IrreversibleReaction<ReactionThermo, ReactionRate>& irr, const IrreversibleReaction<ReactionType, ReactionThermo,ReactionRate>& irr,
const speciesTable& species const speciesTable& species
) )
: :
Reaction<ReactionThermo>(irr, species), ReactionType<ReactionThermo>(irr, species),
k_(irr.k_) k_(irr.k_)
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ReactionThermo, class ReactionRate> template
Foam::scalar Foam::IrreversibleReaction<ReactionThermo, ReactionRate>::kf <
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
Foam::scalar Foam::IrreversibleReaction
<
ReactionType,
ReactionThermo,
ReactionRate
>::kf
( (
const scalar p, const scalar p,
const scalar T, const scalar T,
@ -91,13 +125,19 @@ Foam::scalar Foam::IrreversibleReaction<ReactionThermo, ReactionRate>::kf
} }
template<class ReactionThermo, class ReactionRate> template
void Foam::IrreversibleReaction<ReactionThermo, ReactionRate>::write <
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
void Foam::IrreversibleReaction<ReactionType, ReactionThermo, ReactionRate>::
write
( (
Ostream& os Ostream& os
) const ) const
{ {
Reaction<ReactionThermo>::write(os); ReactionType<ReactionThermo>::write(os);
k_.write(os); k_.write(os);
} }

View File

@ -47,10 +47,15 @@ namespace Foam
Class IrreversibleReaction Declaration Class IrreversibleReaction Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
template<class ReactionThermo, class ReactionRate> template
<
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
class IrreversibleReaction class IrreversibleReaction
: :
public Reaction<ReactionThermo> public ReactionType<ReactionThermo>
{ {
// Private data // Private data
@ -62,7 +67,12 @@ class IrreversibleReaction
//- Disallow default bitwise assignment //- Disallow default bitwise assignment
void operator= void operator=
( (
const IrreversibleReaction<ReactionThermo, ReactionRate>& const IrreversibleReaction
<
ReactionType,
ReactionThermo,
ReactionRate
>&
); );
@ -77,14 +87,19 @@ public:
//- Construct from components //- Construct from components
IrreversibleReaction IrreversibleReaction
( (
const Reaction<ReactionThermo>& reaction, const ReactionType<ReactionThermo>& reaction,
const ReactionRate& reactionRate const ReactionRate& reactionRate
); );
//- Construct as copy given new speciesTable //- Construct as copy given new speciesTable
IrreversibleReaction IrreversibleReaction
( (
const IrreversibleReaction<ReactionThermo, ReactionRate>&, const IrreversibleReaction
<
ReactionType,
ReactionThermo,
ReactionRate
>&,
const speciesTable& species const speciesTable& species
); );
@ -109,7 +124,12 @@ public:
{ {
return autoPtr<Reaction<ReactionThermo> > return autoPtr<Reaction<ReactionThermo> >
( (
new IrreversibleReaction<ReactionThermo, ReactionRate>(*this) new IrreversibleReaction
<
ReactionType,
ReactionThermo,
ReactionRate
>(*this)
); );
} }
@ -121,7 +141,12 @@ public:
{ {
return autoPtr<Reaction<ReactionThermo> > return autoPtr<Reaction<ReactionThermo> >
( (
new IrreversibleReaction<ReactionThermo, ReactionRate> new IrreversibleReaction
<
ReactionType,
ReactionThermo,
ReactionRate
>
( (
*this, *this,
species species

View File

@ -27,24 +27,44 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ReactionThermo, class ReactionRate> template
Foam::NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>:: <
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
Foam::NonEquilibriumReversibleReaction
<
ReactionType,
ReactionThermo,
ReactionRate
>::
NonEquilibriumReversibleReaction NonEquilibriumReversibleReaction
( (
const Reaction<ReactionThermo>& reaction, const ReactionType<ReactionThermo>& reaction,
const ReactionRate& forwardReactionRate, const ReactionRate& forwardReactionRate,
const ReactionRate& reverseReactionRate const ReactionRate& reverseReactionRate
) )
: :
Reaction<ReactionThermo>(reaction), ReactionType<ReactionThermo>(reaction),
fk_(forwardReactionRate), fk_(forwardReactionRate),
rk_(reverseReactionRate) rk_(reverseReactionRate)
{} {}
template<class ReactionThermo, class ReactionRate> template
Foam::NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>:: <
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
Foam::NonEquilibriumReversibleReaction
<
ReactionType,
ReactionThermo,
ReactionRate
>::
NonEquilibriumReversibleReaction NonEquilibriumReversibleReaction
( (
const speciesTable& species, const speciesTable& species,
@ -52,14 +72,24 @@ NonEquilibriumReversibleReaction
Istream& is Istream& is
) )
: :
Reaction<ReactionThermo>(species, thermoDatabase, is), ReactionType<ReactionThermo>(species, thermoDatabase, is),
fk_(species, is), fk_(species, is),
rk_(species, is) rk_(species, is)
{} {}
template<class ReactionThermo, class ReactionRate> template
Foam::NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>:: <
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
Foam::NonEquilibriumReversibleReaction
<
ReactionType,
ReactionThermo,
ReactionRate
>::
NonEquilibriumReversibleReaction NonEquilibriumReversibleReaction
( (
const speciesTable& species, const speciesTable& species,
@ -67,21 +97,36 @@ NonEquilibriumReversibleReaction
const dictionary& dict const dictionary& dict
) )
: :
Reaction<ReactionThermo>(species, thermoDatabase, dict), ReactionType<ReactionThermo>(species, thermoDatabase, dict),
fk_(species, dict.subDict("forward")), fk_(species, dict.subDict("forward")),
rk_(species, dict.subDict("reverse")) rk_(species, dict.subDict("reverse"))
{} {}
template<class ReactionThermo, class ReactionRate> template
Foam::NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>:: <
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
Foam::NonEquilibriumReversibleReaction
<
ReactionType,
ReactionThermo,
ReactionRate
>::
NonEquilibriumReversibleReaction NonEquilibriumReversibleReaction
( (
const NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>& nerr, const NonEquilibriumReversibleReaction
<
ReactionType,
ReactionThermo,
ReactionRate
>& nerr,
const speciesTable& species const speciesTable& species
) )
: :
Reaction<ReactionThermo>(nerr, species), ReactionType<ReactionThermo>(nerr, species),
fk_(nerr.fk_), fk_(nerr.fk_),
rk_(nerr.rk_) rk_(nerr.rk_)
{} {}
@ -89,9 +134,19 @@ NonEquilibriumReversibleReaction
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ReactionThermo, class ReactionRate> template
<
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
Foam::scalar Foam::scalar
Foam::NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::kf Foam::NonEquilibriumReversibleReaction
<
ReactionType,
ReactionThermo,
ReactionRate
>::kf
( (
const scalar p, const scalar p,
const scalar T, const scalar T,
@ -102,9 +157,19 @@ Foam::NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::kf
} }
template<class ReactionThermo, class ReactionRate> template
<
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
Foam::scalar Foam::scalar
Foam::NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::kr Foam::NonEquilibriumReversibleReaction
<
ReactionType,
ReactionThermo,
ReactionRate
>::kr
( (
const scalar, const scalar,
const scalar p, const scalar p,
@ -116,9 +181,19 @@ Foam::NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::kr
} }
template<class ReactionThermo, class ReactionRate> template
<
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
Foam::scalar Foam::scalar
Foam::NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::kr Foam::NonEquilibriumReversibleReaction
<
ReactionType,
ReactionThermo,
ReactionRate
>::kr
( (
const scalar p, const scalar p,
const scalar T, const scalar T,
@ -129,13 +204,23 @@ Foam::NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::kr
} }
template<class ReactionThermo, class ReactionRate> template
void Foam::NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::write <
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
void Foam::NonEquilibriumReversibleReaction
<
ReactionType,
ReactionThermo,
ReactionRate
>::write
( (
Ostream& os Ostream& os
) const ) const
{ {
Reaction<ReactionThermo>::write(os); ReactionType<ReactionThermo>::write(os);
os << indent << "forward" << nl; os << indent << "forward" << nl;
os << indent << token::BEGIN_BLOCK << nl; os << indent << token::BEGIN_BLOCK << nl;

View File

@ -47,10 +47,15 @@ namespace Foam
Class NonEquilibriumReversibleReaction Declaration Class NonEquilibriumReversibleReaction Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
template<class ReactionThermo, class ReactionRate> template
<
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
class NonEquilibriumReversibleReaction class NonEquilibriumReversibleReaction
: :
public Reaction<ReactionThermo> public ReactionType<ReactionThermo>
{ {
// Private data // Private data
@ -64,7 +69,7 @@ class NonEquilibriumReversibleReaction
void operator= void operator=
( (
const NonEquilibriumReversibleReaction const NonEquilibriumReversibleReaction
<ReactionThermo, ReactionRate>& <ReactionType, ReactionThermo, ReactionRate>&
); );
@ -79,7 +84,7 @@ public:
//- Construct from components //- Construct from components
NonEquilibriumReversibleReaction NonEquilibriumReversibleReaction
( (
const Reaction<ReactionThermo>& reaction, const ReactionType<ReactionThermo>& reaction,
const ReactionRate& forwardReactionRate, const ReactionRate& forwardReactionRate,
const ReactionRate& reverseReactionRate const ReactionRate& reverseReactionRate
); );
@ -88,7 +93,7 @@ public:
NonEquilibriumReversibleReaction NonEquilibriumReversibleReaction
( (
const NonEquilibriumReversibleReaction const NonEquilibriumReversibleReaction
<ReactionThermo, ReactionRate>&, <ReactionType, ReactionThermo, ReactionRate>&,
const speciesTable& species const speciesTable& species
); );
@ -109,25 +114,25 @@ public:
); );
//- Construct and return a clone //- Construct and return a clone
virtual autoPtr<Reaction<ReactionThermo> > clone() const virtual autoPtr<ReactionType<ReactionThermo> > clone() const
{ {
return autoPtr<Reaction<ReactionThermo> > return autoPtr<ReactionType<ReactionThermo> >
( (
new NonEquilibriumReversibleReaction new NonEquilibriumReversibleReaction
<ReactionThermo, ReactionRate>(*this) <ReactionType, ReactionThermo, ReactionRate>(*this)
); );
} }
//- Construct and return a clone with new speciesTable //- Construct and return a clone with new speciesTable
virtual autoPtr<Reaction<ReactionThermo> > clone virtual autoPtr<ReactionType<ReactionThermo> > clone
( (
const speciesTable& species const speciesTable& species
) const ) const
{ {
return autoPtr<Reaction<ReactionThermo> > return autoPtr<ReactionType<ReactionThermo> >
( (
new NonEquilibriumReversibleReaction new NonEquilibriumReversibleReaction
<ReactionThermo, ReactionRate> <ReactionType, ReactionThermo, ReactionRate>
(*this, species) (*this, species)
); );
} }

View File

@ -63,6 +63,25 @@ Foam::string Foam::Reaction<ReactionThermo>::reactionStr() const
} }
} }
for (label i = 0; i < glhs().size(); ++i)
{
reaction << " + ";
if (i > 0)
{
reaction << " + ";
}
if (mag(glhs()[i].stoichCoeff - 1) > SMALL)
{
reaction << glhs()[i].stoichCoeff;
}
reaction << species_[glhs()[i].index];
if (mag(glhs()[i].exponent - glhs()[i].stoichCoeff) > SMALL)
{
reaction << "^" << glhs()[i].exponent;
}
}
reaction << " = "; reaction << " = ";
for (label i = 0; i < rhs_.size(); ++i) for (label i = 0; i < rhs_.size(); ++i)
@ -82,17 +101,36 @@ Foam::string Foam::Reaction<ReactionThermo>::reactionStr() const
} }
} }
for (label i = 0; i < grhs().size(); ++i)
{
reaction << " + ";
if (i > 0)
{
reaction << " + ";
}
if (mag(grhs()[i].stoichCoeff - 1) > SMALL)
{
reaction << grhs()[i].stoichCoeff;
}
reaction << species_[grhs()[i].index];
if (mag(grhs()[i].exponent - grhs()[i].stoichCoeff) > SMALL)
{
reaction << "^" << grhs()[i].exponent;
}
}
return reaction.str(); return reaction.str();
} }
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ReactionThermo> template<class ReactionThermo>
void Foam::Reaction<ReactionThermo>::setThermo void Foam::Reaction<ReactionThermo>::setThermo
( (
const HashPtrTable<ReactionThermo>& thermoDatabase const HashPtrTable<ReactionThermo>& thermoDatabase
) )
{
if (rhs_.size() > 0)
{ {
ReactionThermo::operator= ReactionThermo::operator=
( (
@ -106,6 +144,7 @@ void Foam::Reaction<ReactionThermo>::setThermo
rhs_[i].stoichCoeff*(*thermoDatabase[species_[rhs_[i].index]]) rhs_[i].stoichCoeff*(*thermoDatabase[species_[rhs_[i].index]])
); );
} }
}
forAll(lhs_, i) forAll(lhs_, i)
{ {
@ -117,6 +156,9 @@ void Foam::Reaction<ReactionThermo>::setThermo
} }
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ReactionThermo> template<class ReactionThermo>
Foam::Reaction<ReactionThermo>::Reaction Foam::Reaction<ReactionThermo>::Reaction
( (
@ -159,7 +201,6 @@ Foam::Reaction<ReactionThermo>::specieCoeffs::specieCoeffs
) )
{ {
token t(is); token t(is);
if (t.isNumber()) if (t.isNumber())
{ {
stoichCoeff = t.number(); stoichCoeff = t.number();
@ -189,9 +230,16 @@ Foam::Reaction<ReactionThermo>::specieCoeffs::specieCoeffs
specieName = specieName(0, i); specieName = specieName(0, i);
} }
if (species.contains(specieName))
{
index = species[specieName]; index = species[specieName];
} }
else else
{
index = -1;
}
}
else
{ {
FatalIOErrorIn("Reaction<ReactionThermo>::lrhs(Istream& is)", is) FatalIOErrorIn("Reaction<ReactionThermo>::lrhs(Istream& is)", is)
<< "Expected a word but found " << t.info() << "Expected a word but found " << t.info()
@ -201,16 +249,23 @@ Foam::Reaction<ReactionThermo>::specieCoeffs::specieCoeffs
template<class ReactionThermo> template<class ReactionThermo>
void Foam::Reaction<ReactionThermo>::setLRhs(Istream& is) void Foam::Reaction<ReactionThermo>::setLRhs
(
Istream& is,
const speciesTable& species,
List<specieCoeffs>& lhs,
List<specieCoeffs>& rhs
)
{ {
DynamicList<specieCoeffs> dlrhs; DynamicList<specieCoeffs> dlrhs;
while (is) while (is.good())
{ {
dlrhs.append(specieCoeffs(species_, is)); dlrhs.append(specieCoeffs(species, is));
if (dlrhs.last().index != -1)
{
token t(is); token t(is);
if (t.isPunctuation()) if (t.isPunctuation())
{ {
if (t == token::ADD) if (t == token::ADD)
@ -218,23 +273,57 @@ void Foam::Reaction<ReactionThermo>::setLRhs(Istream& is)
} }
else if (t == token::ASSIGN) else if (t == token::ASSIGN)
{ {
lhs_ = dlrhs.shrink(); lhs = dlrhs.shrink();
dlrhs.clear(); dlrhs.clear();
} }
else else
{ {
rhs_ = dlrhs.shrink(); rhs = dlrhs.shrink();
is.putBack(t); is.putBack(t);
return; return;
} }
} }
else else
{ {
rhs_ = dlrhs.shrink(); rhs = dlrhs.shrink();
is.putBack(t); is.putBack(t);
return; return;
} }
} }
else
{
dlrhs.remove();
if (is.good())
{
token t(is);
if (t.isPunctuation())
{
if (t == token::ADD)
{
}
else if (t == token::ASSIGN)
{
lhs = dlrhs.shrink();
dlrhs.clear();
}
else
{
rhs = dlrhs.shrink();
is.putBack(t);
return;
}
}
}
else
{
if (!dlrhs.empty())
{
rhs = dlrhs.shrink();
}
return;
}
}
}
FatalIOErrorIn("Reaction<ReactionThermo>::setLRhs(Istream& is)", is) FatalIOErrorIn("Reaction<ReactionThermo>::setLRhs(Istream& is)", is)
<< "Cannot continue reading reaction data from stream" << "Cannot continue reading reaction data from stream"
@ -254,7 +343,7 @@ Foam::Reaction<ReactionThermo>::Reaction
name_("un-named-reaction" + Foam::name(getNewReactionID())), name_("un-named-reaction" + Foam::name(getNewReactionID())),
species_(species) species_(species)
{ {
setLRhs(is); setLRhs(is, species, lhs_, rhs_);
setThermo(thermoDatabase); setThermo(thermoDatabase);
} }
@ -271,7 +360,13 @@ Foam::Reaction<ReactionThermo>::Reaction
name_(dict.dictName()), name_(dict.dictName()),
species_(species) species_(species)
{ {
setLRhs(IStringStream(dict.lookup("reaction"))()); setLRhs
(
IStringStream(dict.lookup("reaction"))(),
species_,
lhs_,
rhs_
);
setThermo(thermoDatabase); setThermo(thermoDatabase);
} }
@ -410,4 +505,48 @@ Foam::scalar Foam::Reaction<ReactionThermo>::kr
} }
template<class ReactionThermo>
const Foam::speciesTable& Foam::Reaction<ReactionThermo>::species() const
{
return species_;
}
template<class ReactionThermo>
const Foam::speciesTable& Foam::Reaction<ReactionThermo>::gasSpecies() const
{
notImplemented
(
"const speciesTable& gasSpecies() const"
" for this reaction"
);
return *reinterpret_cast<speciesTable*>(0);
}
template<class ReactionThermo>
const Foam::List<typename Foam::Reaction<ReactionThermo>::specieCoeffs>&
Foam::Reaction<ReactionThermo>::glhs() const
{
notImplemented
(
"inline const List<typename Reaction<ReactionThermo>::specieCoeffs>&"
"Reaction<ReactionThermo>::glhs()"
);
return *reinterpret_cast<List<specieCoeffs>*>(0);
}
template<class ReactionThermo>
const Foam::List<typename Foam::Reaction<ReactionThermo>::specieCoeffs>&
Foam::Reaction<ReactionThermo>::grhs() const
{
notImplemented
(
"inline const List<typename Reaction<ReactionThermo>::specieCoeffs>&"
"Reaction<ReactionThermo>::grhs()"
);
return *reinterpret_cast<List<specieCoeffs>*>(0);
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -136,9 +136,6 @@ private:
//- Return string representation of reaction //- Return string representation of reaction
string reactionStr() const; string reactionStr() const;
//- Construct the left- and right-hand-side reaction coefficients
void setLRhs(Istream&);
//- Construct reaction thermo //- Construct reaction thermo
void setThermo(const HashPtrTable<ReactionThermo>& thermoDatabase); void setThermo(const HashPtrTable<ReactionThermo>& thermoDatabase);
@ -245,7 +242,7 @@ public:
); );
//- Construct and return a clone //- Construct and return a clone
virtual autoPtr<Reaction<ReactionThermo> > clone() const virtual autoPtr<Reaction<ReactionThermo> > clone() const //
{ {
return autoPtr<Reaction<ReactionThermo> > return autoPtr<Reaction<ReactionThermo> >
( (
@ -297,9 +294,29 @@ public:
inline word& name(); inline word& name();
inline const word& name() const; inline const word& name() const;
// - Access to basic components of the reaction
inline const List<specieCoeffs>& lhs() const; inline const List<specieCoeffs>& lhs() const;
inline const List<specieCoeffs>& rhs() const; inline const List<specieCoeffs>& rhs() const;
// - Access to gas components of the reaction
virtual const List<specieCoeffs>& grhs() const;
virtual const List<specieCoeffs>& glhs() const;
// - Access to specie list
const speciesTable& species() const;
// - Access to gas specie list
virtual const speciesTable& gasSpecies() const;
//- Construct the left- and right-hand-side reaction coefficients
void setLRhs
(
Istream&,
const speciesTable&,
List<specieCoeffs>& lhs,
List<specieCoeffs>& rhs
);
// Reaction rate coefficients // Reaction rate coefficients

View File

@ -67,6 +67,9 @@ Reaction<ReactionThermo>::rhs() const
template<class ReactionThermo> template<class ReactionThermo>
inline Ostream& operator<<(Ostream& os, const Reaction<ReactionThermo>& r) inline Ostream& operator<<(Ostream& os, const Reaction<ReactionThermo>& r)
{ {
//os.writeKeyword("reaction")
// << r.reactionStr()<< token::END_STATEMENT <<nl;
os << r.type() << nl << " "; os << r.type() << nl << " ";
forAll(r.lhs_, i) forAll(r.lhs_, i)

View File

@ -27,60 +27,94 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ReactionThermo, class ReactionRate> template
Foam::ReversibleReaction<ReactionThermo, ReactionRate>::ReversibleReaction <
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
Foam::ReversibleReaction<ReactionType, ReactionThermo, ReactionRate>::
ReversibleReaction
( (
const Reaction<ReactionThermo>& reaction, const ReactionType<ReactionThermo>& reaction,
const ReactionRate& k const ReactionRate& k
) )
: :
Reaction<ReactionThermo>(reaction), ReactionType<ReactionThermo>(reaction),
k_(k) k_(k)
{} {}
template<class ReactionThermo, class ReactionRate> template
Foam::ReversibleReaction<ReactionThermo, ReactionRate>::ReversibleReaction <
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
Foam::ReversibleReaction<ReactionType, ReactionThermo, ReactionRate>::
ReversibleReaction
( (
const speciesTable& species, const speciesTable& species,
const HashPtrTable<ReactionThermo>& thermoDatabase, const HashPtrTable<ReactionThermo>& thermoDatabase,
Istream& is Istream& is
) )
: :
Reaction<ReactionThermo>(species, thermoDatabase, is), ReactionType<ReactionThermo>(species, thermoDatabase, is),
k_(species, is) k_(species, is)
{} {}
template<class ReactionThermo, class ReactionRate> template
Foam::ReversibleReaction<ReactionThermo, ReactionRate>::ReversibleReaction <
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
Foam::ReversibleReaction<ReactionType, ReactionThermo, ReactionRate>::
ReversibleReaction
( (
const speciesTable& species, const speciesTable& species,
const HashPtrTable<ReactionThermo>& thermoDatabase, const HashPtrTable<ReactionThermo>& thermoDatabase,
const dictionary& dict const dictionary& dict
) )
: :
Reaction<ReactionThermo>(species, thermoDatabase, dict), ReactionType<ReactionThermo>(species, thermoDatabase, dict),
k_(species, dict) k_(species, dict)
{} {}
template<class ReactionThermo, class ReactionRate> template
Foam::ReversibleReaction<ReactionThermo, ReactionRate>::ReversibleReaction <
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
Foam::ReversibleReaction<ReactionType, ReactionThermo, ReactionRate>::
ReversibleReaction
( (
const ReversibleReaction<ReactionThermo, ReactionRate>& rr, const ReversibleReaction<ReactionType, ReactionThermo, ReactionRate>& rr,
const speciesTable& species const speciesTable& species
) )
: :
Reaction<ReactionThermo>(rr, species), ReactionType<ReactionThermo>(rr, species),
k_(rr.k_) k_(rr.k_)
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ReactionThermo, class ReactionRate> template
Foam::scalar Foam::ReversibleReaction<ReactionThermo, ReactionRate>::kf <
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
Foam::scalar Foam::ReversibleReaction
<
ReactionType,
ReactionThermo,
ReactionRate
>::kf
( (
const scalar p, const scalar p,
const scalar T, const scalar T,
@ -91,8 +125,18 @@ Foam::scalar Foam::ReversibleReaction<ReactionThermo, ReactionRate>::kf
} }
template<class ReactionThermo, class ReactionRate> template
Foam::scalar Foam::ReversibleReaction<ReactionThermo, ReactionRate>::kr <
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
Foam::scalar Foam::ReversibleReaction
<
ReactionType,
ReactionThermo,
ReactionRate
>::kr
( (
const scalar kfwd, const scalar kfwd,
const scalar p, const scalar p,
@ -104,8 +148,18 @@ Foam::scalar Foam::ReversibleReaction<ReactionThermo, ReactionRate>::kr
} }
template<class ReactionThermo, class ReactionRate> template
Foam::scalar Foam::ReversibleReaction<ReactionThermo, ReactionRate>::kr <
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
Foam::scalar Foam::ReversibleReaction
<
ReactionType,
ReactionThermo,
ReactionRate
>::kr
( (
const scalar p, const scalar p,
const scalar T, const scalar T,
@ -116,8 +170,18 @@ Foam::scalar Foam::ReversibleReaction<ReactionThermo, ReactionRate>::kr
} }
template<class ReactionThermo, class ReactionRate> template
void Foam::ReversibleReaction<ReactionThermo, ReactionRate>::write <
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
void Foam::ReversibleReaction
<
ReactionType,
ReactionThermo,
ReactionRate
>::write
( (
Ostream& os Ostream& os
) const ) const

View File

@ -47,10 +47,15 @@ namespace Foam
Class ReversibleReaction Declaration Class ReversibleReaction Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
template<class ReactionThermo, class ReactionRate> template
<
template<class> class ReactionType,
class ReactionThermo,
class ReactionRate
>
class ReversibleReaction class ReversibleReaction
: :
public Reaction<ReactionThermo> public ReactionType<ReactionThermo>
{ {
// Private data // Private data
@ -60,7 +65,15 @@ class ReversibleReaction
// Private Member Functions // Private Member Functions
//- Disallow default bitwise assignment //- Disallow default bitwise assignment
void operator=(const ReversibleReaction<ReactionThermo, ReactionRate>&); void operator=
(
const ReversibleReaction
<
ReactionType,
ReactionThermo,
ReactionRate
>&
);
public: public:
@ -74,14 +87,19 @@ public:
//- Construct from components //- Construct from components
ReversibleReaction ReversibleReaction
( (
const Reaction<ReactionThermo>& reaction, const ReactionType<ReactionThermo>& reaction,
const ReactionRate& k const ReactionRate& k
); );
//- Construct as copy given new speciesTable //- Construct as copy given new speciesTable
ReversibleReaction ReversibleReaction
( (
const ReversibleReaction<ReactionThermo, ReactionRate>&, const ReversibleReaction
<
ReactionType,
ReactionThermo,
ReactionRate
>&,
const speciesTable& species const speciesTable& species
); );
@ -102,23 +120,29 @@ public:
); );
//- Construct and return a clone //- Construct and return a clone
virtual autoPtr<Reaction<ReactionThermo> > clone() const virtual autoPtr<ReactionType<ReactionThermo> > clone() const
{ {
return autoPtr<Reaction<ReactionThermo> > return autoPtr<ReactionType<ReactionThermo> >
( (
new ReversibleReaction<ReactionThermo, ReactionRate>(*this) new ReversibleReaction
<
ReactionType,
ReactionThermo,
ReactionRate
>(*this)
); );
} }
//- Construct and return a clone with new speciesTable //- Construct and return a clone with new speciesTable
virtual autoPtr<Reaction<ReactionThermo> > clone virtual autoPtr<ReactionType<ReactionThermo> > clone
( (
const speciesTable& species const speciesTable& species
) const ) const
{ {
return autoPtr<Reaction<ReactionThermo> > return autoPtr<ReactionType<ReactionThermo> >
( (
new ReversibleReaction<ReactionThermo, ReactionRate> new ReversibleReaction
<ReactionType, ReactionThermo, ReactionRate>
( (
*this, *this,
species species
@ -154,8 +178,8 @@ public:
) const; ) const;
//- Reverse rate constant. //- Reverse rate constant.
// Note this evaluates the forward rate constant and divides by the // Note this evaluates the forward rate constant and divides by
// equilibrium constant // the equilibrium constant
virtual scalar kr virtual scalar kr
( (
const scalar p, const scalar p,

View File

@ -61,7 +61,7 @@ namespace Foam
\ \
typedef Reaction<Thermo> Reaction##Thermo; \ typedef Reaction<Thermo> Reaction##Thermo; \
\ \
typedef ReactionType<Thermo, ReactionRate> \ typedef ReactionType<Reaction, Thermo, ReactionRate> \
ReactionType##Thermo##ReactionRate; \ ReactionType##Thermo##ReactionRate; \
\ \
template<> \ template<> \

View File

@ -66,12 +66,6 @@ class specie
scalar molWeight_; scalar molWeight_;
// Private Member Functions
//- Construct from components without name
inline specie(const scalar nMoles, const scalar molWeight);
public: public:
//- Runtime type information //- Runtime type information
@ -94,6 +88,10 @@ public:
// Constructors // Constructors
//- Construct from components without name
inline specie(const scalar nMoles, const scalar molWeight);
//- Construct from components with name //- Construct from components with name
inline specie inline specie
( (

View File

@ -17,7 +17,7 @@ FoamFile
dimensions [0 0 0 1 0 0 0]; dimensions [0 0 0 1 0 0 0];
internalField uniform 298.15; internalField uniform 500;//298.15;
boundaryField boundaryField
{ {

View File

@ -11,13 +11,13 @@ FoamFile
format ascii; format ascii;
class volScalarField; class volScalarField;
location "0"; location "0";
object Ydefault; object char;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0]; dimensions [0 0 0 0 0 0 0];
internalField uniform 1; internalField uniform 0.5;
boundaryField boundaryField
{ {

View File

@ -11,7 +11,7 @@ FoamFile
format ascii; format ascii;
class volScalarField; class volScalarField;
location "0"; location "0";
object Yv; object v;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -8,7 +8,7 @@
FoamFile FoamFile
{ {
version 2.0; version 2.0;
format binary; format ascii;
class dictionary; class dictionary;
location "constant"; location "constant";
object chemistryProperties; object chemistryProperties;
@ -31,39 +31,4 @@ odeCoeffs
eps 0.05; eps 0.05;
} }
species
(
gas
);
reactions
(
irreversibleSolidArrheniusReaction
v = gas + char
(7.83e10 15274.57 400 4.86)
);
gas
{
specie
{
nMoles 1;
molWeight 18.0153;
}
thermodynamics
{
Tlow 200;
Thigh 5000;
Tcommon 1000;
highCpCoeffs ( 2.67215 0.00305629 -8.73026e-07 1.20100e-10 -6.39162e-15 -29899.2 6.86282 );
lowCpCoeffs ( 3.38684 0.00347498 -6.35470e-06 6.96858e-09 -2.50659e-12 -30208.1 2.59023 );
}
transport
{
As 1.67212e-06;
Ts 170.672;
}
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -1,21 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class regIOobject;
location "constant/polyMesh";
object faceZones;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
0
()
// ************************************************************************* //

View File

@ -1,21 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class regIOobject;
location "constant/polyMesh";
object pointZones;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
0
()
// ************************************************************************* //

View File

@ -0,0 +1,23 @@
species
(
v
char
);
gaseousSpecies
(
gas
);
reactions
{
charReaction
{
type irreversibleArrheniusSolidReaction;
reaction "v^4.86 = char + gas";
A 7.83e10;
Ta 15274.57;
Tcrit 400;
}
}

View File

@ -8,14 +8,53 @@
FoamFile FoamFile
{ {
version 2.0; version 2.0;
format ascii; format binary;
class regIOobject; class dictionary;
location "constant/polyMesh"; location "constant";
object cellZones; object thermo.solid;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
0 v
() {
solidSpecie
{
nMoles 1;
}
transport
{
kappa 0.135;
}
thermodynamics
{
Cp 696;
Hf -1.41e6;
}
equationOfState
{
rho 114.7;
}
};
char
{
solidSpecie
{
nMoles 1;
}
transport
{
kappa 0.4;
}
thermodynamics
{
Cp 611;
Hf 0;
}
equationOfState
{
rho 11.5;
}
};
// ************************************************************************* // // ************************************************************************* //

View File

@ -17,61 +17,42 @@ FoamFile
thermoType thermoType
{ {
type heSolidThermo; type heSolidThermo;
mixture reactingSolidMixture; mixture reactingMixture;
transport constIso; transport constIso;
thermo hConst; thermo hConst;
equationOfState rhoConst; equationOfState rhoConst;
specie specie; specie solidSpecie;
energy sensibleEnthalpy; energy sensibleEnthalpy;
} }
solidComponents chemistryReader foamChemistryReader;
(
v char
);
vCoeffs foamChemistryFile "$FOAM_CASE/constant/panelRegion/reactions";
foamChemistryThermoFile "$FOAM_CASE/constant/panelRegion/thermo.solid";
gas
{ {
specie specie
{ {
nMoles 1; nMoles 1;
molWeight 100; molWeight 18.0153;
}
transport
{
kappa 0.135;
} }
thermodynamics thermodynamics
{ {
Cp 696; Tlow 200;
Hf -1.41e6; Thigh 5000;
Tcommon 1000;
highCpCoeffs ( 2.67215 0.00305629 -8.73026e-07 1.20100e-10 -6.39162e-15 -29899.2 6.86282 );
lowCpCoeffs ( 3.38684 0.00347498 -6.35470e-06 6.96858e-09 -2.50659e-12 -30208.1 2.59023 );
} }
equationOfState transport
{ {
rho 114.7; As 1.67212e-06;
Ts 170.672;
}
} }
};
charCoeffs
{
specie
{
nMoles 1;
molWeight 50;
}
transport
{
kappa 0.4;
}
thermodynamics
{
Cp 611;
Hf 0;
}
equationOfState
{
rho 11.5;
}
};
// ************************************************************************* // // ************************************************************************* //

View File

@ -17,20 +17,19 @@ FoamFile
thermoType thermoType
{ {
type heSolidThermo; type heSolidThermo;
mixture pureSolidMixture; mixture pureMixture;
transport constIso; transport constIso;
thermo hConst; thermo hConst;
equationOfState rhoConst; equationOfState rhoConst;
specie specie; specie solidSpecie;
energy sensibleEnthalpy; energy sensibleEnthalpy;
} }
mixture mixture
{ {
specie solidSpecie
{ {
nMoles 1; nMoles 1;
molWeight 12;
} }
transport transport
@ -50,17 +49,16 @@ mixture
} }
} }
solidComponents species
( (
pmma char pmma char
); );
pmmaCoeffs pmma
{ {
specie solidSpecie
{ {
nMoles 1; nMoles 1;
molWeight 100;
} }
transport transport
@ -80,13 +78,13 @@ pmmaCoeffs
} }
} }
charCoeffs char
{ {
specie solidSpecie
{ {
nMoles 1; nMoles 1;
molWeight 50;
} }
transport transport
{ {
kappa 0.4; kappa 0.4;

View File

@ -17,20 +17,19 @@ FoamFile
thermoType thermoType
{ {
type heSolidThermo; type heSolidThermo;
mixture pureSolidMixture; mixture pureMixture;
transport constIso; transport constIso;
thermo hConst; thermo hConst;
equationOfState rhoConst; equationOfState rhoConst;
specie specie; specie solidSpecie;
energy sensibleEnthalpy; energy sensibleEnthalpy;
} }
mixture mixture
{ {
specie solidSpecie
{ {
nMoles 1; nMoles 1;
molWeight 12;
} }
transport transport
@ -50,17 +49,16 @@ mixture
} }
} }
solidComponents species
( (
pmma char pmma char
); );
pmmaCoeffs pmma
{ {
specie solidSpecie
{ {
nMoles 1; nMoles 1;
molWeight 100;
} }
transport transport
@ -80,9 +78,9 @@ pmmaCoeffs
} }
} }
charCoeffs char
{ {
specie solidSpecie
{ {
nMoles 1; nMoles 1;
molWeight 50; molWeight 50;

View File

@ -17,20 +17,19 @@ FoamFile
thermoType thermoType
{ {
type heSolidThermo; type heSolidThermo;
mixture pureSolidMixture; mixture pureMixture;
transport constIso; transport constIso;
thermo hConst; thermo hConst;
equationOfState rhoConst; equationOfState rhoConst;
specie specie; specie solidSpecie;
energy sensibleEnthalpy; energy sensibleEnthalpy;
} }
mixture mixture
{ {
specie solidSpecie
{ {
nMoles 1; nMoles 1;
molWeight 12;
} }
transport transport
@ -50,17 +49,16 @@ mixture
} }
} }
solidComponents species
( (
pmma char pmma char
); );
pmmaCoeffs pmma
{ {
specie solidSpecie
{ {
nMoles 1; nMoles 1;
molWeight 100;
} }
transport transport
@ -80,9 +78,9 @@ pmmaCoeffs
} }
} }
charCoeffs char
{ {
specie solidSpecie
{ {
nMoles 1; nMoles 1;
molWeight 50; molWeight 50;

View File

@ -59,7 +59,7 @@ dictionaryReplacement
} }
} }
Ypmma pmma
{ {
internalField uniform 0.5; internalField uniform 0.5;
@ -75,7 +75,7 @@ dictionaryReplacement
} }
Ychar char
{ {
internalField uniform 0.5; internalField uniform 0.5;

View File

@ -50,7 +50,7 @@ dictionaryReplacement
} }
} }
Ypmma pmma
{ {
internalField uniform 0.5; internalField uniform 0.5;
@ -66,7 +66,7 @@ dictionaryReplacement
} }
Ychar char
{ {
internalField uniform 0.5; internalField uniform 0.5;

View File

@ -50,7 +50,7 @@ dictionaryReplacement
} }
} }
Ypmma pmma
{ {
internalField uniform 0.5; internalField uniform 0.5;
@ -66,7 +66,7 @@ dictionaryReplacement
} }
Ychar char
{ {
internalField uniform 0.5; internalField uniform 0.5;