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);
153 tmp<volScalarField> tHsiGas =
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++)
366reactingOneDim::reactingOneDim
368 const word& modelType,
370 const word& regionType
373 pyrolysisModel(modelType,
mesh, regionType),
390 h_(solidThermo_->
he()),
452 totalGasMassFlux_(0.0),
456 useChemistrySolvers_(true)
465reactingOneDim::reactingOneDim
467 const word& modelType,
470 const word& regionType
473 pyrolysisModel(modelType,
mesh,
dict, regionType),
490 h_(solidThermo_->
he()),
552 totalGasMassFlux_(0.0),
556 useChemistrySolvers_(true)
591 Info<<
"\nPyrolysis region: " <<
type() <<
"added mass : "
601 scalar
DiNum = -GREAT;
699 Info<<
"pyrolysis min/max(T) = "
708 Info<<
indent <<
"Total gas mass produced [kg] = "
710 <<
indent <<
"Total solid mass lost [kg] = "
714 <<
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.
DimensionedField< scalar, volMesh > Internal
void clamp_min(const Type &lower)
Impose lower (floor) clamp on the field values (in-place).
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
GeometricBoundaryField< scalar, fvPatchField, volMesh > Boundary
const Internal::FieldType & primitiveField() const noexcept
Return a const-reference to the internal field values.
void correctBoundaryConditions()
Correct boundary field.
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
@ NO_READ
Nothing to be read.
@ READ_IF_PRESENT
Reading is optional [identical to LAZY_READ].
@ MUST_READ
Reading required.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
@ AUTO_WRITE
Automatically write from objectRegistry::writeObject().
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 noexcept
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.
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, IOobjectOption::readOption readOpt=IOobjectOption::MUST_READ) const
Find entry and assign to T val. FatalIOError if it is found and the number of tokens is incorrect,...
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T, or return the given default value. FatalIOError if it is found and the number of...
const Type & value() const noexcept
Return const reference to value.
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.
const vectorField & cellCentres() const
Top level model for radiation modelling.
Base class for pyrolysis models.
static autoPtr< pyrolysisModel > New(const fvMesh &mesh, const word ®ionType="pyrolysis")
Return a reference to the selected pyrolysis model.
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.
scalar totalGasMassFlux_
Total mass gas flux at the pyrolysing walls [kg/s].
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 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 Time & time() const noexcept
Return the reference to the time database.
const fvMesh & regionMesh() const
Return the region mesh database.
virtual void preEvolveRegion()
Pre-evolve region.
labelList intCoupledPatchIDs_
List of patch IDs internally coupled with the primary region.
const dictionary & coeffs() const noexcept
Return the model coefficients dictionary.
Foam::solidReactionThermo.
Selector class for relaxation factors, solver type and solution.
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
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.
Namespace for handling debugging switches.
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)
Namespace for radiation modelling.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
Type gSum(const FieldField< Field, Type > &f)
dimensionedScalar exp(const dimensionedScalar &ds)
List< label > labelList
A List of labels.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
const dimensionSet dimEnergy
fvMatrix< scalar > fvScalarMatrix
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
messageStream Info
Information stream (stdout output on master, null elsewhere).
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
hashedWordList speciesTable
A table of species as a hashedWordList.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
T returnReduce(const T &value, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
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)
Field< vector > vectorField
Specialisation of Field<T> for vector.
vector point
Point is a vector.
MinMax< Type > gMinMax(const FieldField< Field, Type > &f)
static constexpr const zero Zero
Global zero (0).
const dimensionSet dimVolume(pow3(dimLength))
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
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.