32 template<
class ThermoType>
36 const fluidThermo& thermo
39 if (
isA<singleStepReactingMixture<ThermoType>>(thermo))
41 return dynamic_cast<const singleStepReactingMixture<ThermoType>&
> 49 <<
"Inconsistent thermo package for " << thermo.type()
50 <<
"Please select a thermo package based on " 53 return dynamic_cast<const singleStepReactingMixture<ThermoType>&
> 64 template<
class ThermoType>
78 mesh_.time().timeName(),
86 nuSoot_(
readScalar(coeffsDict_.lookup(
"nuSoot"))),
87 Wsoot_(
readScalar(coeffsDict_.lookup(
"Wsoot"))),
91 coeffsDict_.lookupOrDefault<
word>(
"mappingField",
"none")
95 mixture_(checkThermo(thermo_))
99 const scalarList& specieStoichCoeffs(mixture_.specieStoichCoeffs());
101 scalar totalMol = 0.0;
104 label speciei = reaction.
rhs()[i].index;
105 totalMol +=
mag(specieStoichCoeffs[speciei]);
115 const label speciei = reaction.
rhs()[i].index;
116 Xi[i] =
mag(specieStoichCoeffs[speciei])/totalMol;
117 Wm += Xi[i]*mixture_.speciesData()[speciei].W();
120 const scalar XSoot = nuSoot_/totalMol;
123 sootMax_ = XSoot*Wsoot_/Wm;
125 Info <<
"Maximum soot mass concentrations: " << sootMax_ <<
nl;
127 if (mappingFieldName_ ==
"none")
129 const label index = reaction.
rhs()[0].index;
130 mappingFieldName_ = mixture_.Y(index).name();
133 const label mapFieldIndex = mixture_.species()[mappingFieldName_];
135 mapFieldMax_ = mixture_.Yprod0()[mapFieldIndex];
142 template<
class ThermoType>
149 template<
class ThermoType>
155 soot_ = sootMax_*(mapField/mapFieldMax_);
virtual ~mixtureFractionSoot()
Destructor.
bool isA(const Type &t)
Check if a dynamic_cast to typeid is possible.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
mixtureFractionSoot(const dictionary &dict, const fvMesh &mesh, const word &modelType)
Construct from components.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Single step reacting mixture.
dictionary subOrEmptyDict(const word &, const bool mustRead=false) const
Find and return a sub-dictionary as a copy, or.
virtual void correct()
Main update/correction routine.
const List< specieCoeffs > & rhs() const
Simple extension of ReactionThermo to handle reaction kinetics in addition to the equilibrium thermod...
psiReactionThermo & thermo
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type.
Base class for soor models.
A class for handling words, derived from string.
Fundamental fluid thermodynamic properties.
This soot model is purely an state model. The ammount of soot produced is determined by a single step...
word dictName("noiseDict")
Info<< "Creating reaction model\n"<< endl;autoPtr< combustionModels::psiCombustionModel > reaction(combustionModels::psiCombustionModel::New(mesh))
Mesh data needed to do the Finite Volume discretisation.
dimensioned< scalar > mag(const dimensioned< Type > &)
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...