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);
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++)
366 reactingOneDim::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)
465 reactingOneDim::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;
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] = "
virtual const volScalarField & T() const
Return const temperature [K].
void clamp_min(const Type &lower)
Impose lower (floor) clamp on the field values (in-place)
bool useChemistrySolvers_
Use chemistry solvers (ode or sequential)
const Type & value() const noexcept
Return const reference to value.
volScalarField chemistryQdot_
Heat release rate [J/s/m3].
const Internal::FieldType & primitiveField() const noexcept
Return a const-reference to the internal field values.
Ostream & indent(Ostream &os)
Indent stream.
dimensionedScalar addedGasMass_
Cumulative mass generation of the gas phase [kg].
scalar deltaTValue() const noexcept
Return time step value.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
const surfaceVectorField & Cf() const
Return face centres as surfaceVectorField.
Foam::solidReactionThermo.
Type gMin(const FieldField< Field, Type > &f)
basicSpecieMixture & composition
virtual tmp< volScalarField > kappa() const
Return the region thermal conductivity [W/m/k].
defineTypeNameAndDebug(noPyrolysis, 0)
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)
virtual const surfaceScalarField & phiGas() const
Return the total gas mass flux to primary region [kg/m2/s].
constexpr char nl
The newline '\n' character (0x0a)
scalar maxDiff_
Maximum diffusivity.
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.
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.
dimensioned< Type > domainIntegrate(const GeometricField< Type, fvPatchField, volMesh > &vf)
autoPtr< solidReactionThermo > solidThermo_
Reference to solid thermo.
GeometricBoundaryField< scalar, fvsPatchField, surfaceMesh > Boundary
Type of boundary fields.
label k
Boltzmann constant.
Chemistry model for solid thermodynamics.
const DimensionedField< scalar, volMesh > & V() const
Return cell volumes.
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
DimensionedField< scalar, volMesh > Internal
The internal field type from which this GeometricField is derived.
void calculateMassTransfer()
Mass check.
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
hashedWordList speciesTable
A table of species as a hashedWordList.
virtual bool read()
Read control parameters.
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
autoPtr< radiation::radiationModel > radiation_
Pointer to radiation model.
scalar minimumDelta_
Minimum delta for combustion.
Macros for easy insertion into run-time selection tables.
dimensionedScalar totalHeatRR_
Total heat release rate [J/s].
void solveSpeciesMass()
Solve solid species mass conservation.
#define forAll(list, i)
Loop across all elements in list.
dictionary()
Default construct, a top-level empty dictionary.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
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...
Switch moveMesh_
Flag to allow mesh movement.
autoPtr< basicSolidChemistryModel > solidChemistry_
Reference to the solid chemistry model.
const volScalarField & rho() const
Fields.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
const dimensionSet dimVolume(pow3(dimLength))
const dimensionedScalar e
Elementary charge.
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 void preEvolveRegion()
Pre-evolve region.
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
#define DebugInFunction
Report an information message using Foam::Info.
Calculate the laplacian of the given field.
labelListList boundaryFaceCells_
Global cell IDs.
const dictionary & solution() const
Return the solution dictionary.
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
const dictionary & coeffs() const noexcept
Return the model coefficients dictionary.
const fvMesh & regionMesh() const
Return the region mesh database.
virtual void info()
Provide some feedback.
virtual scalar maxDiff() const
Return max diffusivity allowed in the solid.
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.
Top level model for radiation modelling.
virtual ~reactingOneDim()
Destructor.
volScalarField phiHsGas_
Sensible enthalpy gas flux [J/m2/s].
const vectorField & cellCentres() const
const dictionary & controlDict() const noexcept
Return read access to the controlDict dictionary.
void updateqr()
Update radiative flux in pyrolysis region.
bool qrHSource_
Add in depth radiation source term.
Calculate the divergence of the given field.
virtual scalar solidRegionDiffNo() const
Mean diffusion number of the solid region.
virtual const tmp< volScalarField > Cp() const
Return specific heat capacity [J/kg/K].
void solveEnergy()
Solve energy.
SolverPerformance< Type > solve(const dictionary &)
Solve returning the solution statistics.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
const surfaceScalarField & nMagSf() const
Return the face area magnitudes / [m2].
Switch active_
Active flag.
int debug
Static debugging option.
Type gMax(const FieldField< Field, Type > &f)
void updateMesh(const scalarField &mass0)
Update/move mesh based on change in mass.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
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.
bool moving() const noexcept
Is mesh moving.
virtual tmp< volScalarField > kappaRad() const
Return the region absorptivity [1/m].
const word & name() const
Return reference to name.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
const Time & time_
Reference to the time database.
PtrList< volScalarField > & Y
Mesh data needed to do the Finite Volume discretisation.
virtual void evolveRegion()
Evolve the pyrolysis equations.
void updateFields()
Update submodels.
void updatePhiGas()
Update enthalpy flux for pyrolysis gases.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
void correctBoundaryConditions()
Correct boundary field.
messageStream Info
Information stream (stdout output on master, null elsewhere)
label nNonOrthCorr_
Number of non-orthogonal correctors.
PtrList< volScalarField > & Ys_
List of solid components.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
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 dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
List< label > labelList
A List of labels.
void solveContinuity()
Solve continuity equation.
labelList intCoupledPatchIDs_
List of patch IDs internally coupled with the primary region.
A class for managing temporary objects.
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
volScalarField rho_
Density [kg/m3].
Defines the attributes of an object for which implicit objectRegistry management is supported...
bool gasHSource_
Add gas enthalpy source term.
virtual void preEvolveRegion()
Pre-evolve region.
volScalarField qr_
Coupled region radiative heat flux [W/m2].
labelList primaryPatchIDs_
List of patch IDs on the primary region coupled to this region.
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
virtual const surfaceScalarField & deltaCoeffs() const
Return reference to cell-centre difference coefficients.
dimensionedScalar deltaT() const
Return time step.
bool read()
Read control parameters from dictionary.
const Time & time() const noexcept
Return the reference to the time database.
autoPtr< radiation::radiationModel > radiation(radiation::radiationModel::New(T))
addToRunTimeSelectionTable(pyrolysisModel, noPyrolysis, mesh)
volScalarField Yt(0.0 *Y[0])
const dimensionSet & dimensions() const noexcept
Return dimensions.
static constexpr const zero Zero
Global zero (0)