Go to the documentation of this file.
41 namespace regionModels
43 namespace pyrolysisModels
55 void reactingOneDim::readReactingOneDimControls()
72 readReactingOneDimControls();
84 readReactingOneDimControls();
108 qrBf[patchi] =
max(qrBf[patchi], scalar(0));
116 label localPyrolysisFacei = 0;
126 const scalar qr0 = qrp[facei];
127 point Cf0 = Cf[facei];
129 scalar kappaInt = 0.0;
132 const label celli =
cells[
k];
133 const point& Cf1 = cellC[celli];
134 const scalar
delta =
mag(Cf1 - Cf0);
136 qr_[celli] = qr0*
exp(-kappaInt);
162 label totalFaceId = 0;
173 scalar massInt = 0.0;
176 const label celli =
cells[
k];
177 massInt += RRiGas[celli]*cellVol[celli];
178 phiHsGas_[celli] += massInt*HsiGas[celli];
181 phiGasp[facei] += massInt;
185 Info<<
" Gas : " << gasTable[gasI]
186 <<
" on patch : " << patchi
187 <<
" mass produced at face(local) : "
189 <<
" is : " << massInt
190 <<
" [kg/s] " <<
endl;
211 Info<<
"Initial/final volumes = " <<
gSum(deltaV) <<
endl;
258 for (label i=0; i<
Ys_.size()-1; i++)
366 reactingOneDim::reactingOneDim
368 const word& modelType,
370 const word& regionType
389 Ys_(solidThermo_->composition().Y()),
390 h_(solidThermo_->he()),
452 totalGasMassFlux_(0.0),
456 useChemistrySolvers_(
true)
465 reactingOneDim::reactingOneDim
467 const word& modelType,
470 const word& regionType
489 Ys_(solidThermo_->composition().Y()),
490 h_(solidThermo_->he()),
552 totalGasMassFlux_(0.0),
556 useChemistrySolvers_(
true)
591 Info<<
"\nPyrolysis region: " <<
type() <<
"added mass : "
592 << massAdded <<
endl;
601 scalar
DiNum = -GREAT;
697 Info<<
"pyrolysis min/max(T) = "
709 Info<<
indent <<
"Total gas mass produced [kg] = "
711 <<
indent <<
"Total solid mass lost [kg] = "
715 <<
indent <<
"Total heat release rate [J/s] = "
Base class for pyrolysis models.
int debug
Static debugging option.
autoPtr< solidReactionThermo > solidThermo_
Reference to solid thermo.
virtual ~reactingOneDim()
Destructor.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
virtual tmp< volScalarField > kappa() const
Return the region thermal conductivity [W/m/k].
A class for handling words, derived from Foam::string.
virtual void preEvolveRegion()
Pre-evolve region.
virtual const surfaceScalarField & phiGas() const
Return the total gas mass flux to primary region [kg/m2/s].
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
void solveSpeciesMass()
Solve solid species mass conservation.
scalar maxDiff_
Maximum diffusivity.
dimensionedScalar deltaT() const
Return time step.
A class for managing temporary objects.
bool useChemistrySolvers_
Use chemistry solvers (ode or sequential)
static constexpr const zero Zero
Global zero (0)
const dimensionSet dimEnergy
dimensioned< Type > domainIntegrate(const GeometricField< Type, fvPatchField, volMesh > &vf)
dictionary()
Default construct, a top-level empty dictionary.
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
void updatePhiGas()
Update enthalpy flux for pyrolysis gases.
const Internal::FieldType & primitiveField() const
Return a const-reference to the internal field.
bool read(const char *buf, int32_t &val)
Same as readInt32.
Calculate the divergence of the given field.
const Time & time() const
Return the reference to the time database.
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
void solveContinuity()
Solve continuity equation.
virtual scalar solidRegionDiffNo() const
Mean diffusion number of the solid region.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const Type & value() const
Return const reference to value.
dimensionedScalar addedGasMass_
Cumulative mass generation of the gas phase [kg].
Type gSum(const FieldField< Field, Type > &f)
dimensionedScalar exp(const dimensionedScalar &ds)
volScalarField rho_
Density [kg/m3].
bool gasHSource_
Add gas enthalpy source term.
virtual const surfaceScalarField & deltaCoeffs() const
Return reference to cell-centre difference coefficients.
void updateFields()
Update submodels.
volScalarField chemistryQdot_
Heat release rate [J/s/m3].
scalar deltaTValue() const noexcept
Return time step value.
#define forAll(list, i)
Loop across all elements in list.
labelListList boundaryFaceCells_
Global cell IDs.
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
defineTypeNameAndDebug(noPyrolysis, 0)
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
void calculateMassTransfer()
Mass check.
tmp< labelField > moveMesh(const scalarList &deltaV, const scalar minDelta=0.0)
Move mesh points according to change in cell volumes.
virtual scalar maxDiff() const
Return max diffusivity allowed in the solid.
A wordList with hashed named lookup, which can be faster in some situations than using the normal lis...
volScalarField Yt(0.0 *Y[0])
static autoPtr< radiationModel > New(const volScalarField &T)
Return a reference to the selected radiation model.
Base class for solution control classes.
messageStream Info
Information stream (stdout output on master, null elsewhere)
#define DebugInFunction
Report an information message using Foam::Info.
label nNonOrthCorr_
Number of non-orthogonal correctors.
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
virtual const volScalarField & T() const
Return const temperature [K].
const fvMesh & regionMesh() const
Return the region mesh database.
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
PtrList< volScalarField > & Ys_
List of solid components.
bool read()
Read control parameters from dictionary.
const volScalarField & rho() const
Fields.
virtual void preEvolveRegion()
Pre-evolve region.
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
virtual bool read()
Read control parameters.
scalar minimumDelta_
Minimum delta for combustion.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
virtual tmp< volScalarField > kappaRad() const
Return the region absorptivity [1/m].
const dictionary & solution() const
Return the solution dictionary.
dimensionedScalar totalHeatRR_
Total heat release rate [J/s].
const surfaceScalarField & nMagSf() const
Return the face area magnitudes / [m2].
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const dictionary & controlDict() const
Return read access to the controlDict dictionary.
Switch infoOutput_
Active information output.
Macros for easy insertion into run-time selection tables.
virtual scalar addMassSources(const label patchi, const label facei)
External hook to add mass to the primary region.
Mesh data needed to do the Finite Volume discretisation.
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
static tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
Ostream & indent(Ostream &os)
Indent stream.
void correctBoundaryConditions()
Correct boundary field.
virtual void evolveRegion()
Evolve the pyrolysis equations.
static autoPtr< basicSolidChemistryModel > New(solidReactionThermo &thermo)
Selector.
surfaceScalarField phiGas_
Total gas mass flux to the primary region [kg/m2/s].
const vectorField & cellCentres() const
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
const Time & time_
Reference to the time database.
Calculate the laplacian of the given field.
volScalarField phiHsGas_
Sensible enthalpy gas flux [J/m2/s].
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
void updateMesh(const scalarField &mass0)
Update/move mesh based on change in mass.
bool qrHSource_
Add in depth radiation source term.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
dimensionedScalar lostSolidMass_
Cumulative lost mass of the condensed phase [kg].
label k
Boltzmann constant.
virtual void info()
Provide some feedback.
const dimensionedScalar e
Elementary charge.
Volume integrate volField creating a volField.
autoPtr< radiation::radiationModel > radiation_
Pointer to radiation model.
bool moving() const noexcept
Is mesh moving.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
SolverPerformance< Type > solve(const dictionary &)
Solve returning the solution statistics.
Switch moveMesh_
Flag to allow mesh movement.
volScalarField qr_
Coupled region radiative heat flux [W/m2].
labelList intCoupledPatchIDs_
List of patch IDs internally coupled with the primary region.
void max(const dimensioned< Type > &dt)
Use the maximum of the field and specified value.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
const dictionary & coeffs() const
Return the model coefficients dictionary.
void solveEnergy()
Solve energy.
autoPtr< basicSolidChemistryModel > solidChemistry_
Reference to the solid chemistry model.
static autoPtr< solidReactionThermo > New(const fvMesh &, const word &phaseName=word::null)
Standard selection based on fvMesh.
Type gMin(const FieldField< Field, Type > &f)
const dimensionSet dimVolume(pow3(dimLength))
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
const surfaceVectorField & Cf() const
Return face centres as surfaceVectorField.
void updateqr()
Update radiative flux in pyrolysis region.
addToRunTimeSelectionTable(pyrolysisModel, noPyrolysis, mesh)
Type gMax(const FieldField< Field, Type > &f)
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual const tmp< volScalarField > Cp() const
Return specific heat capacity [J/kg/K].
const word & name() const
Return reference to name.
const DimensionedField< scalar, volMesh > & V() const
Return cell volumes.
labelList primaryPatchIDs_
List of patch IDs on the primary region coupled to this region.