37 namespace combustionModels
42 template<
class ReactionThermo,
class ThermoType>
45 const word& modelType,
48 const word& combustionProperties
58 reactionRateFlameArea_
71 this->
thermo().phasePropertyName(
"ft"),
83 Cv_(this->coeffs().getScalar(
"Cv")),
88 ftVarMin_(this->coeffs().getScalar(
"ftVarMin"))
94 template<
class ReactionThermo,
class ThermoType>
101 template<
class ReactionThermo,
class ThermoType>
102 void FSD<ReactionThermo, ThermoType>::calculateSourceNorm()
104 this->singleMixturePtr_->fresCorrect();
106 const label fuelI = this->singleMixturePtr_->fuelIndex();
115 (
s*YFuel - (YO2 - YO2OxiStream_))/(
s*YFuelFuelStream_ + YO2OxiStream_);
127 (ft_*cAux*mgft)().weightedAverage(this->
mesh().V())
128 /((ft_*cAux)().weightedAverage(this->
mesh().V()) + SMALL)
142 reactionRateFlameArea_->correct(
sigma);
144 const volScalarField& omegaFuel = reactionRateFlameArea_->omega();
147 const scalar ftStoich =
148 YO2OxiStream_.value()
150 s.value()*YFuelFuelStream_.value() + YO2OxiStream_.value()
155 this->
thermo().phasePropertyName(
"Pc"),
160 auto& pc = tPc.ref();
164 this->
thermo().phasePropertyName(
"omegaFuelBar"),
169 auto& omegaFuelBar = tomegaFuel.ref();
192 scalar deltaFt = 1.0/ftDim_;
196 if (ft_[celli] > ftMin_ && ft_[celli] < ftMax_)
198 scalar ftCell = ft_[celli];
200 if (ftVar[celli] > ftVarMin_)
202 scalar ftVarc = ftVar[celli];
204 max(ftCell*(ftCell*(1.0 - ftCell)/ftVarc - 1.0), 0.0);
205 scalar
b =
max(a/ftCell - a, 0.0);
207 for (
int i=1; i<ftDim_; i++)
209 scalar ft = i*deltaFt;
210 pc[celli] +=
pow(ft, a-1.0)*
pow(1.0 - ft,
b - 1.0)*deltaFt;
213 for (
int i=1; i<ftDim_; i++)
215 scalar ft = i*deltaFt;
216 omegaFuelBar[celli] +=
217 omegaFuel[celli]/omegaF[celli]
221 /(2.0*
sqr(0.01*omegaF[celli]))
224 *
pow(1.0 - ft,
b - 1.0)
227 omegaFuelBar[celli] /=
max(pc[celli], 1
e-4);
231 omegaFuelBar[celli] =
232 omegaFuel[celli]/omegaF[celli]
233 *
exp(-
sqr(ftCell - ftStoich)/(2.0*
sqr(0.01*omegaF[celli])));
238 omegaFuelBar[celli] = 0.0;
245 List<label> productsIndex(2, label(-1));
248 forAll(this->singleMixturePtr_->specieProd(), specieI)
250 if (this->singleMixturePtr_->specieProd()[specieI] < 0)
252 productsIndex[i] = specieI;
260 scalar YprodTotal = 0;
263 YprodTotal += this->singleMixturePtr_->Yprod0()[productsIndex[j]];
268 if (ft_[celli] < ftStoich)
270 pc[celli] = ft_[celli]*(YprodTotal/ftStoich);
274 pc[celli] = (1.0 - ft_[celli])*(YprodTotal/(1.0 - ftStoich));
280 this->
thermo().phasePropertyName(
"products"),
285 auto& products = tproducts.ref();
289 label specieI = productsIndex[j];
296 max(scalar(1) - products/
max(pc, scalar(1
e-5)), scalar(0))
299 pc =
min(C_*
c, scalar(1));
303 this->wFuel_ == mgft*pc*omegaFuelBar;
307 template<
class ReactionThermo,
class ThermoType>
314 calculateSourceNorm();
319 template<
class ReactionThermo,
class ThermoType>
324 this->coeffs().readEntry(
"Cv", Cv_);
325 this->coeffs().readEntry(
"ftVarMin", ftVarMin_);
326 reactionRateFlameArea_->read(this->coeffs());
Flame Surface Dennsity (FDS) combustion model.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
const Type & lookupObject(const word &name, const bool recursive=false) const
Lookup and return const reference to the object of the given Type. Fatal if not found or the wrong ty...
virtual bool read()
Update properties.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
compressible::turbulenceModel & turb
const dimensionSet dimless
Dimensionless.
dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties)
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
psiReactionThermo & thermo
const dimensionSet dimVolume(pow3(dimLength))
const dimensionedScalar e
Elementary charge.
dimensionedScalar exp(const dimensionedScalar &ds)
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Calculate the gradient of the given field.
static const word propertiesName
Default name of the turbulence properties dictionary.
A class for handling words, derived from Foam::string.
LESModel< EddyDiffusivity< turbulenceModel > > LESModel
Typedefs for turbulence, RAS and LES models for compressible flow based on the standard laminar trans...
const objectRegistry & db() const noexcept
Return the local objectRegistry.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
static tmp< GeometricField< scalar, fvPatchField, volMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=fvPatchField< scalar >::calculatedType())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions and patch type. [Takes current timeN...
Calculate the divergence of the given field.
Abstract base class for turbulence models (RAS, LES and laminar).
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
virtual bool read()
Update properties from given dictionary.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const dimensionedScalar c
Speed of light in a vacuum.
Automatically write from objectRegistry::writeObject()
virtual void correct()
Correct combustion rate.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Base class for combustion models using singleStepReactingMixture.
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Defines the attributes of an object for which implicit objectRegistry management is supported...
Request registration (bool: true)
Do not request registration (bool: false)
static autoPtr< reactionRateFlameArea > New(const dictionary &dict, const fvMesh &mesh, const combustionModel &combModel)
virtual ~FSD()
Destructor.
const dimensionSet & dimensions() const noexcept
Return dimensions.
static constexpr const zero Zero
Global zero (0)