43namespace pyrolysisModels
55void 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++)
368 const word& modelType,
370 const word& regionType
390 h_(solidThermo_->
he()),
452 totalGasMassFlux_(0.0),
456 useChemistrySolvers_(true)
467 const word& modelType,
470 const word& regionType
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] = "
volScalarField Yt(0.0 *Y[0])
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
const dimensionSet & dimensions() const
Return dimensions.
const Internal::FieldType & primitiveField() const
Return a const-reference to the internal field.
void max(const dimensioned< Type > &dt)
Use the maximum of the field and specified value.
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
void correctBoundaryConditions()
Correct boundary field.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
scalar deltaTValue() const noexcept
Return time step value.
dimensionedScalar deltaT() const
Return time step.
const dictionary & controlDict() const
Return read access to the controlDict dictionary.
Chemistry model for solid thermodynamics.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
const Type & value() const
Return const reference to value.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
void relax(const scalar alpha)
Relax matrix (for steady-state solution).
SolverPerformance< Type > solve(const dictionary &)
Solve returning the solution statistics.
Mesh data needed to do the Finite Volume discretisation.
const DimensionedField< scalar, volMesh > & V() const
Return cell volumes.
const word & name() const
Return reference to name.
const surfaceVectorField & Cf() const
Return face centres as surfaceVectorField.
A wordList with hashed named lookup, which can be faster in some situations than using the normal lis...
void updateMesh()
Update for new mesh topology.
const vectorField & cellCentres() const
Top level model for radiation modelling.
virtual void preEvolveRegion()
Pre-evolve thermal baffle.
Base class for pyrolysis models.
virtual bool read()
Read control parameters.
Reacting, 1-D pyrolysis model NOTE: The moveMesh option can only be applied to solid reaction such as...
volScalarField rho_
Density [kg/m3].
void solveSpeciesMass()
Solve solid species mass conservation.
bool qrHSource_
Add in depth radiation source term.
virtual scalar solidRegionDiffNo() const
Mean diffusion number of the solid region.
scalar maxDiff_
Maximum diffusivity.
void solveContinuity()
Solve continuity equation.
const volScalarField & rho() const
Fields.
virtual tmp< volScalarField > kappa() const
Return the region thermal conductivity [W/m/k].
dimensionedScalar lostSolidMass_
Cumulative lost mass of the condensed phase [kg].
void updateqr()
Update radiative flux in pyrolysis region.
scalar minimumDelta_
Minimum delta for combustion.
bool useChemistrySolvers_
Use chemistry solvers (ode or sequential)
autoPtr< solidReactionThermo > solidThermo_
Reference to solid thermo.
PtrList< volScalarField > & Ys_
List of solid components.
volScalarField phiHsGas_
Sensible enthalpy gas flux [J/m2/s].
virtual const volScalarField & T() const
Return const temperature [K].
void solveEnergy()
Solve energy.
dimensionedScalar addedGasMass_
Cumulative mass generation of the gas phase [kg].
virtual tmp< volScalarField > kappaRad() const
Return the region absorptivity [1/m].
volScalarField qr_
Coupled region radiative heat flux [W/m2].
virtual const tmp< volScalarField > Cp() const
Return specific heat capacity [J/kg/K].
virtual scalar addMassSources(const label patchi, const label facei)
External hook to add mass to the primary region.
void updatePhiGas()
Update enthalpy flux for pyrolysis gases.
virtual ~reactingOneDim()
Destructor.
autoPtr< basicSolidChemistryModel > solidChemistry_
Reference to the solid chemistry model.
void updateMesh(const scalarField &mass0)
Update/move mesh based on change in mass.
virtual void preEvolveRegion()
Pre-evolve region.
autoPtr< radiation::radiationModel > radiation_
Pointer to radiation model.
dimensionedScalar totalHeatRR_
Total heat release rate [J/s].
void updateFields()
Update submodels.
surfaceScalarField phiGas_
Total gas mass flux to the primary region [kg/m2/s].
virtual void info()
Provide some feedback.
virtual const surfaceScalarField & phiGas() const
Return the total gas mass flux to primary region [kg/m2/s].
virtual scalar maxDiff() const
Return max diffusivity allowed in the solid.
bool gasHSource_
Add gas enthalpy source term.
void calculateMassTransfer()
Mass check.
label nNonOrthCorr_
Number of non-orthogonal correctors.
bool read()
Read control parameters from dictionary.
volScalarField chemistryQdot_
Heat release rate [J/s/m3].
virtual void evolveRegion()
Evolve the pyrolysis equations.
tmp< labelField > moveMesh(const scalarList &deltaV, const scalar minDelta=0.0)
Move mesh points according to change in cell volumes.
const surfaceScalarField & nMagSf() const
Return the face area magnitudes / [m2].
Switch moveMesh_
Flag to allow mesh movement.
labelListList boundaryFaceCells_
Global cell IDs.
Switch active_
Active flag.
const Time & time_
Reference to the time database.
const Time & time() const
Return the reference to the time database.
const dictionary & solution() const
Return the solution dictionary.
Switch infoOutput_
Active information output.
labelList primaryPatchIDs_
List of patch IDs on the primary region coupled to this region.
const dictionary & coeffs() const
Return the model coefficients dictionary.
const fvMesh & regionMesh() const
Return the region mesh database.
labelList intCoupledPatchIDs_
List of patch IDs internally coupled with the primary region.
Foam::solidReactionThermo.
Selector class for relaxation factors, solver type and solution.
Base class for solution control classes.
virtual const surfaceScalarField & deltaCoeffs() const
Return reference to cell-centre difference coefficients.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
basicSpecieMixture & composition
PtrList< volScalarField > & Y
autoPtr< radiation::radiationModel > radiation(radiation::radiationModel::New(T))
Calculate the divergence of the given field.
Calculate the laplacian of the given field.
Volume integrate volField creating a volField.
#define DebugInFunction
Report an information message using Foam::Info.
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.
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
dimensioned< Type > domainIntegrate(const GeometricField< Type, fvPatchField, volMesh > &vf)
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Type gSum(const FieldField< Field, Type > &f)
dimensionedScalar exp(const dimensionedScalar &ds)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
const dimensionSet dimEnergy
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
messageStream Info
Information stream (stdout output on master, null elsewhere)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Ostream & indent(Ostream &os)
Indent stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
static constexpr const zero Zero
Global zero (0)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
Type gMin(const FieldField< Field, Type > &f)
const dimensionSet dimVolume(pow3(dimLength))
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce (copy) and return value.
Type gMax(const FieldField< Field, Type > &f)
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.
#define forAllReverse(list, i)
Reverse loop across all elements in list.