28 #include "surfaceInterpolate.H" 40 namespace regionModels
42 namespace pyrolysisModels
54 void reactingOneDim::readReactingOneDimControls()
74 readReactingOneDimControls();
88 readReactingOneDimControls();
114 QrBf[
patchi] =
max(QrBf[patchi], scalar(0.0));
122 label localPyrolysisFacei = 0;
132 const scalar Qr0 = Qrp[facei];
133 point Cf0 = Cf[facei];
135 scalar kappaInt = 0.0;
138 const label celli = cells[
k];
139 const point& Cf1 = cellC[celli];
140 const scalar
delta =
mag(Cf1 - Cf0);
142 Qr_[celli] = Qr0*
exp(-kappaInt);
167 surfaceScalarField::Boundary& phiGasBf =
170 label totalFaceId = 0;
181 scalar massInt = 0.0;
184 const label celli = cells[
k];
185 massInt += RRiGas[celli]*cellVol[celli];
186 phiHsGas_[celli] += massInt*HsiGas[celli];
189 phiGasp[facei] += massInt;
193 Info<<
" Gas : " << gasTable[gasI]
194 <<
" on patch : " << patchi
195 <<
" mass produced at face(local) : " 197 <<
" is : " << massInt
198 <<
" [kg/s] " <<
endl;
284 for (
label i=0; i<
Ys_.size()-1; i++)
386 reactingOneDim::reactingOneDim
388 const word& modelType,
390 const word& regionType
485 reactingOneDim::reactingOneDim
487 const word& modelType,
490 const word& regionType
611 Info<<
"\nPyrolysis region: " <<
type() <<
"added mass : " 612 << massAdded <<
endl;
621 scalar
DiNum = -GREAT;
723 Info<<
"pyrolysis min/max(T) = " 735 Info<<
indent <<
"Total gas mass produced [kg] = " 737 <<
indent <<
"Total solid mass lost [kg] = " 739 <<
indent <<
"Total pyrolysis gases [kg/s] = " 741 <<
indent <<
"Total heat release rate [J/s] = "
virtual scalar solidRegionDiffNo() const
Mean diffusion number of the solid region.
bool useChemistrySolvers_
Use chemistry solvers (ode or sequential)
const dictionary & solution() const
Return the solution dictionary.
solidReactionThermo & solidThermo_
Reference to solid thermo.
volScalarField chemistrySh_
Heat release [J/s/m3].
#define forAll(list, i)
Loop across all elements in list.
Base class for pyrolysis models.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
virtual tmp< volScalarField > kappa() const =0
Thermal diffusivity for temperature of mixture [J/m/s/K].
Ostream & indent(Ostream &os)
Indent stream.
const Time & time() const
Return the reference to the time database.
dimensionedScalar addedGasMass_
Cumulative mass generation of the gas phase [kg].
const double e
Elementary charge.
A list of keyword definitions, which are a keyword followed by any number of values (e...
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
tmp< fvMatrix< Type > > Sp(const DimensionedField< scalar, volMesh > &, const GeometricField< Type, fvPatchField, volMesh > &)
const surfaceVectorField & Cf() const
Return face centres as surfaceVectorField.
scalar totalGasMassFlux_
Total mass gas flux at the pyrolysing walls [kg/s].
defineTypeNameAndDebug(noPyrolysis, 0)
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
static autoPtr< basicSolidChemistryModel > New(const fvMesh &mesh, const word &phaseName=word::null)
Selector.
scalar maxDiff_
Maximum diffussivity.
Ostream & endl(Ostream &os)
Add newline and flush stream.
tmp< labelField > moveMesh(const scalarList &deltaV, const scalar minDelta=0.0)
Move mesh points according to change in cell volumes.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
virtual tmp< volScalarField > a(const label bandI=0) const
Absorption coefficient (net)
const Internal::FieldType & primitiveField() const
Return a const-reference to the internal field.
dimensioned< Type > domainIntegrate(const GeometricField< Type, fvPatchField, volMesh > &vf)
const Type & value() const
Return const reference to value.
virtual scalar maxDiff() const
Return max diffusivity allowed in the solid.
label k
Boltzmann constant.
const absorptionEmissionModel & absorptionEmission() const
Access to absorptionEmission model.
void calculateMassTransfer()
Mass check.
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
PtrList< volScalarField > & Y()
Return the mass-fraction fields.
virtual bool read()
Read control parameters.
virtual basicSpecieMixture & composition()=0
Return the composition of the multi-component mixture.
autoPtr< radiation::radiationModel > radiation_
Pointer to radiation model.
scalar minimumDelta_
Minimum delta for combustion.
Macros for easy insertion into run-time selection tables.
bool moving() const
Is mesh moving.
virtual volScalarField & he()=0
Enthalpy/Internal energy [J/kg].
const fvMesh & regionMesh() const
Return the region mesh database.
dimensionedScalar totalHeatRR_
Total heat release rate [J/s].
void solveSpeciesMass()
Solve solid species mass conservation.
virtual volScalarField & p()
Pressure [Pa].
const dictionary & coeffs() const
Return the model coefficients dictionary.
dictionary()
Construct top-level dictionary null.
virtual const volScalarField & T() const
Return const temperature [K].
virtual tmp< volScalarField > rho() const
Density [kg/m^3].
Switch moveMesh_
Flag to allow mesh movement.
autoPtr< basicSolidChemistryModel > solidChemistry_
Reference to the solid chemistry model.
const dimensionSet dimVolume(pow3(dimLength))
static autoPtr< radiationModel > New(const volScalarField &T)
Return a reference to the selected radiation model.
Type gSum(const FieldField< Field, Type > &f)
surfaceScalarField phiGas_
Total gas mass flux to the primary region [kg/m2/s].
dimensionedScalar exp(const dimensionedScalar &ds)
virtual tmp< volScalarField > kappa() const
Return the region thermal conductivity [W/m/k].
const Boundary & boundaryField() const
Return const-reference to the boundary field.
virtual void preEvolveRegion()
Pre-evolve region.
A class for handling words, derived from string.
Calculate the laplacian of the given field.
labelListList boundaryFaceCells_
Global cell IDs.
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
virtual const surfaceScalarField & phiGas() const
Return the total gas mass flux to primary region [kg/m2/s].
virtual void info()
Provide some feedback.
const vectorField & cellCentres() const
Volume integrate volField creating a volField.
A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
Switch infoOutput_
Active information output.
virtual ~reactingOneDim()
Destructor.
volScalarField phiHsGas_
Sensible enthalpy gas flux [J/m2/s].
const dimensionSet & dimensions() const
Return dimensions.
Calculate the divergence of the given field.
virtual const tmp< volScalarField > Cp() const
Return specific heat capacity [J/kg/K].
void solveEnergy()
Solve energy.
virtual const volScalarField & T() const
Temperature [K].
volScalarField Qr_
Coupled region radiative heat flux [W/m2].
Switch active_
Active flag.
void updateMesh(const scalarField &mass0)
Update/move mesh based on change in mass.
scalar deltaTValue() const
Return time step value.
virtual tmp< volScalarField > Cp() const =0
Heat capacity at constant pressure [J/kg/K].
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
const surfaceScalarField & nMagSf() const
Return the face area magnitudes / [m2].
const dimensionSet dimEnergy
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.
dimensionedScalar lostSolidMass_
Cumulative lost mass of the condensed phase [kg].
virtual scalar addMassSources(const label patchi, const label facei)
External hook to add mass to the primary region.
void updateQr()
Update radiative flux in pyrolysis region.
dimensionedScalar deltaT() const
Return time step.
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
Boundary & boundaryFieldRef()
Return a reference to the boundary field.
A wordList with hashed indices for faster lookup by name.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
virtual tmp< volScalarField > kappaRad() const
Return the region absorptivity [1/m].
const Time & time_
Reference to the time database.
void max(const dimensioned< Type > &)
const surfaceScalarField & deltaCoeffs() const
Return reference to cell-centre difference coefficients.
virtual const volScalarField & alpha() const
Thermal diffusivity for enthalpy of mixture [kg/m/s].
Mesh data needed to do the Finite Volume discretisation.
virtual void evolveRegion()
Evolve the pyrolysis equations.
void updateFields()
Update submodels.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const DimensionedField< scalar, volMesh > & V() const
Return cell volumes.
void updatePhiGas()
Update enthalpy flux for pyrolysis gases.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
A special matrix type and solver, designed for finite volume solutions of scalar equations.
const volScalarField & rho() const
Fields.
void correctBoundaryConditions()
Correct boundary field.
label nNonOrthCorr_
Number of non-orthogonal correctors.
dimensioned< scalar > mag(const dimensioned< Type > &)
PtrList< volScalarField > & Ys_
List of solid components.
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
const dictionary & controlDict() const
void solveContinuity()
Solve continuity equation.
labelList intCoupledPatchIDs_
List of patch IDs internally coupled with the primary region.
A class for managing temporary objects.
virtual void correct()=0
Update properties.
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
volScalarField rho_
Density [kg/m3].
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
bool gasHSource_
Add gas enthalpy source term.
virtual void preEvolveRegion()
Pre-evolve region.
labelList primaryPatchIDs_
List of patch IDs on the primary region coupled to this region.
const word & name() const
Return reference to name.
bool read()
Read control parameters from dictionary.
bool QrHSource_
Add in depth radiation source term.
addToRunTimeSelectionTable(pyrolysisModel, noPyrolysis, mesh)
volScalarField Yt(0.0 *Y[0])
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
#define InfoInFunction
Report an information message using Foam::Info.