reactingOneDim.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
9  Copyright (C) 2016-2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "reactingOneDim.H"
31 #include "fvm.H"
32 #include "fvcDiv.H"
33 #include "fvcVolumeIntegrate.H"
34 #include "fvcLaplacian.H"
36 
37 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38 
39 namespace Foam
40 {
41 namespace regionModels
42 {
43 namespace pyrolysisModels
44 {
45 
46 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
47 
48 defineTypeNameAndDebug(reactingOneDim, 0);
49 
50 addToRunTimeSelectionTable(pyrolysisModel, reactingOneDim, mesh);
51 addToRunTimeSelectionTable(pyrolysisModel, reactingOneDim, dictionary);
52 
53 // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
54 
55 void reactingOneDim::readReactingOneDimControls()
56 {
57  const dictionary& solution = this->solution().subDict("SIMPLE");
58  solution.readEntry("nNonOrthCorr", nNonOrthCorr_);
59  time().controlDict().readEntry("maxDi", maxDiff_);
60  coeffs().readEntry("minimumDelta", minimumDelta_);
61  gasHSource_ = coeffs().lookupOrDefault("gasHSource", false);
62  coeffs().readEntry("qrHSource", qrHSource_);
64  coeffs().lookupOrDefault("useChemistrySolvers", true);
65 }
66 
67 
69 {
71  {
72  readReactingOneDimControls();
73  return true;
74  }
75 
76  return false;
77 }
78 
79 
81 {
83  {
84  readReactingOneDimControls();
85  return true;
86  }
87 
88  return false;
89 }
90 
91 
93 {
94  // Update local qr from coupled qr field
95  qr_ == dimensionedScalar(qr_.dimensions(), Zero);
96 
97  // Retrieve field from coupled region using mapped boundary conditions
99 
100  volScalarField::Boundary& qrBf = qr_.boundaryFieldRef();
101 
103  {
104  const label patchi = intCoupledPatchIDs_[i];
105 
106  // qr is positive going in the solid
107  // If the surface is emitting the radiative flux is set to zero
108  qrBf[patchi] = max(qrBf[patchi], scalar(0));
109  }
110 
111  const vectorField& cellC = regionMesh().cellCentres();
112 
114 
115  // Propagate qr through 1-D regions
116  label localPyrolysisFacei = 0;
118  {
119  const label patchi = intCoupledPatchIDs_[i];
120 
121  const scalarField& qrp = qr_.boundaryField()[patchi];
122  const vectorField& Cf = regionMesh().Cf().boundaryField()[patchi];
123 
124  forAll(qrp, facei)
125  {
126  const scalar qr0 = qrp[facei];
127  point Cf0 = Cf[facei];
128  const labelList& cells = boundaryFaceCells_[localPyrolysisFacei++];
129  scalar kappaInt = 0.0;
130  forAll(cells, k)
131  {
132  const label celli = cells[k];
133  const point& Cf1 = cellC[celli];
134  const scalar delta = mag(Cf1 - Cf0);
135  kappaInt += kappa()[celli]*delta;
136  qr_[celli] = qr0*exp(-kappaInt);
137  Cf0 = Cf1;
138  }
139  }
140  }
141 }
142 
143 
145 {
146  phiHsGas_ == dimensionedScalar(phiHsGas_.dimensions(), Zero);
147  phiGas_ == dimensionedScalar(phiGas_.dimensions(), Zero);
148 
149  const speciesTable& gasTable = solidChemistry_->gasTable();
150 
151  forAll(gasTable, gasI)
152  {
153  tmp<volScalarField> tHsiGas =
154  solidChemistry_->gasHs(solidThermo_->p(), solidThermo_->T(), gasI);
155 
156  const volScalarField& HsiGas = tHsiGas();
157 
158  const volScalarField::Internal& RRiGas = solidChemistry_->RRg(gasI);
159 
160  surfaceScalarField::Boundary& phiGasBf = phiGas_.boundaryFieldRef();
161 
162  label totalFaceId = 0;
164  {
165  const label patchi = intCoupledPatchIDs_[i];
166 
167  scalarField& phiGasp = phiGasBf[patchi];
168  const scalarField& cellVol = regionMesh().V();
169 
170  forAll(phiGasp, facei)
171  {
172  const labelList& cells = boundaryFaceCells_[totalFaceId++];
173  scalar massInt = 0.0;
175  {
176  const label celli = cells[k];
177  massInt += RRiGas[celli]*cellVol[celli];
178  phiHsGas_[celli] += massInt*HsiGas[celli];
179  }
180 
181  phiGasp[facei] += massInt;
182 
183  if (debug)
184  {
185  Info<< " Gas : " << gasTable[gasI]
186  << " on patch : " << patchi
187  << " mass produced at face(local) : "
188  << facei
189  << " is : " << massInt
190  << " [kg/s] " << endl;
191  }
192  }
193  }
194  }
195 }
196 
197 
199 {
200  if (qrHSource_)
201  {
202  updateqr();
203  }
204 
205  //Note: Commented out as the sensible gas energy is included in energy eq.
206  //updatePhiGas();
207 }
208 
209 
211 {
212  Info<< "Initial/final volumes = " << gSum(deltaV) << endl;
213 
214  // Move the mesh
215  const labelList moveMap = moveMesh(deltaV, minimumDelta_);
216 
217  // Flag any cells that have not moved as non-reacting
218  forAll(moveMap, i)
219  {
220  if (moveMap[i] == 1)
221  {
222  solidChemistry_->setCellReacting(i, false);
223  }
224  }
225 }
226 
227 
229 {
230  if (debug)
231  {
232  InfoInFunction << endl;
233  }
234 
235  if (!moveMesh_)
236  {
237  fvScalarMatrix rhoEqn
238  (
239  fvm::ddt(rho_) == -solidChemistry_->RRg()
240  );
241 
242  rhoEqn.solve();
243  }
244  else
245  {
246  const scalarField deltaV
247  (
249  );
250 
251  updateMesh(deltaV);
252  }
253 }
254 
255 
257 {
258  if (debug)
259  {
260  InfoInFunction << endl;
261  }
262 
263  volScalarField Yt(0.0*Ys_[0]);
264 
265  for (label i=0; i<Ys_.size()-1; i++)
266  {
267  volScalarField& Yi = Ys_[i];
268 
269  fvScalarMatrix YiEqn
270  (
271  fvm::ddt(rho_, Yi) == solidChemistry_->RRs(i)
272  );
273 
274  if (regionMesh().moving())
275  {
276  surfaceScalarField phiYiRhoMesh
277  (
279  );
280 
281  YiEqn -= fvc::div(phiYiRhoMesh);
282 
283  }
284 
285  YiEqn.solve(regionMesh().solver("Yi"));
286  Yi.max(0.0);
287  Yt += Yi;
288  }
289 
290  Ys_[Ys_.size() - 1] = 1.0 - Yt;
291 
292 }
293 
294 
296 {
297  if (debug)
298  {
299  InfoInFunction << endl;
300  }
301 
303 
304  fvScalarMatrix hEqn
305  (
306  fvm::ddt(rho_, h_)
309  - fvc::laplacian(kappa(), T())
310  ==
312  + solidChemistry_->RRsHs()
313  );
314 
315 /*
316  NOTE: gas Hs is included in hEqn
317 
318  if (gasHSource_)
319  {
320  const surfaceScalarField phiGas(fvc::interpolate(phiHsGas_));
321  hEqn += fvc::div(phiGas);
322  }
323 */
324 
325  if (qrHSource_)
326  {
328  hEqn += fvc::div(phiqr);
329  }
330 
331 /*
332  NOTE: The moving mesh option is only correct for reaction such as
333  Solid -> Gas, thus the ddt term is compesated exaclty by chemistrySh and
334  the mesh flux is not necessary.
335 
336  if (regionMesh().moving())
337  {
338  surfaceScalarField phihMesh
339  (
340  fvc::interpolate(rho_*h_)*regionMesh().phi()
341  );
342 
343  hEqn -= fvc::div(phihMesh);
344  }
345 */
346  hEqn.relax();
347  hEqn.solve();
348 }
349 
350 
352 {
353  /*
354  totalGasMassFlux_ = 0;
355  forAll(intCoupledPatchIDs_, i)
356  {
357  const label patchi = intCoupledPatchIDs_[i];
358  totalGasMassFlux_ += gSum(phiGas_.boundaryField()[patchi]);
359  }
360  */
361 
362  if (infoOutput_)
363  {
365 
366  addedGasMass_ +=
368  lostSolidMass_ +=
370  }
371 }
372 
373 
374 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
375 
376 reactingOneDim::reactingOneDim
377 (
378  const word& modelType,
379  const fvMesh& mesh,
380  const word& regionType
381 )
382 :
383  pyrolysisModel(modelType, mesh, regionType),
384  solidThermo_(solidReactionThermo::New(regionMesh())),
385  solidChemistry_(basicSolidChemistryModel::New(solidThermo_())),
386  radiation_(radiation::radiationModel::New(solidThermo_->T())),
387  rho_
388  (
389  IOobject
390  (
391  "rho",
392  regionMesh().time().timeName(),
393  regionMesh(),
396  ),
397  solidThermo_->rho()
398  ),
399  Ys_(solidThermo_->composition().Y()),
400  h_(solidThermo_->he()),
401  nNonOrthCorr_(-1),
402  maxDiff_(10),
403  minimumDelta_(1e-4),
404 
405  phiGas_
406  (
407  IOobject
408  (
409  "phiGas",
410  time().timeName(),
411  regionMesh(),
414  ),
415  regionMesh(),
417  ),
418 
419  phiHsGas_
420  (
421  IOobject
422  (
423  "phiHsGas",
424  time().timeName(),
425  regionMesh(),
428  ),
429  regionMesh(),
431  ),
432 
433  chemistryQdot_
434  (
435  IOobject
436  (
437  "chemistryQdot",
438  time().timeName(),
439  regionMesh(),
442  ),
443  regionMesh(),
445  ),
446 
447  qr_
448  (
449  IOobject
450  (
451  "qr",
452  time().timeName(),
453  regionMesh(),
456  ),
457  regionMesh()
458  ),
459 
460  lostSolidMass_(dimensionedScalar(dimMass, Zero)),
461  addedGasMass_(dimensionedScalar(dimMass, Zero)),
462  totalGasMassFlux_(0.0),
463  totalHeatRR_(dimensionedScalar(dimEnergy/dimTime, Zero)),
464  gasHSource_(false),
465  qrHSource_(false),
466  useChemistrySolvers_(true)
467 {
468  if (active_)
469  {
470  read();
471  }
472 }
473 
474 
475 reactingOneDim::reactingOneDim
476 (
477  const word& modelType,
478  const fvMesh& mesh,
479  const dictionary& dict,
480  const word& regionType
481 )
482 :
483  pyrolysisModel(modelType, mesh, dict, regionType),
484  solidThermo_(solidReactionThermo::New(regionMesh())),
485  solidChemistry_(basicSolidChemistryModel::New(solidThermo_())),
486  radiation_(radiation::radiationModel::New(solidThermo_->T())),
487  rho_
488  (
489  IOobject
490  (
491  "rho",
492  regionMesh().time().timeName(),
493  regionMesh(),
496  ),
497  solidThermo_->rho()
498  ),
499  Ys_(solidThermo_->composition().Y()),
500  h_(solidThermo_->he()),
501  nNonOrthCorr_(-1),
502  maxDiff_(10),
503  minimumDelta_(1e-4),
504 
505  phiGas_
506  (
507  IOobject
508  (
509  "phiGas",
510  time().timeName(),
511  regionMesh(),
514  ),
515  regionMesh(),
517  ),
518 
519  phiHsGas_
520  (
521  IOobject
522  (
523  "phiHsGas",
524  time().timeName(),
525  regionMesh(),
528  ),
529  regionMesh(),
531  ),
532 
533  chemistryQdot_
534  (
535  IOobject
536  (
537  "chemistryQdot",
538  time().timeName(),
539  regionMesh(),
542  ),
543  regionMesh(),
545  ),
546 
547  qr_
548  (
549  IOobject
550  (
551  "qr",
552  time().timeName(),
553  regionMesh(),
556  ),
557  regionMesh()
558  ),
559 
560  lostSolidMass_(dimensionedScalar(dimMass, Zero)),
561  addedGasMass_(dimensionedScalar(dimMass, Zero)),
562  totalGasMassFlux_(0.0),
563  totalHeatRR_(dimensionedScalar(dimEnergy/dimTime, Zero)),
564  gasHSource_(false),
565  qrHSource_(false),
566  useChemistrySolvers_(true)
567 {
568  if (active_)
569  {
570  read(dict);
571  }
572 }
573 
574 
575 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
576 
578 {}
579 
580 
581 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
582 
583 scalar reactingOneDim::addMassSources(const label patchi, const label facei)
584 {
585  label index = 0;
587  {
588  if (primaryPatchIDs_[i] == patchi)
589  {
590  index = i;
591  break;
592  }
593  }
594 
595  const label localPatchId = intCoupledPatchIDs_[index];
596 
597  const scalar massAdded = phiGas_.boundaryField()[localPatchId][facei];
598 
599  if (debug)
600  {
601  Info<< "\nPyrolysis region: " << type() << "added mass : "
602  << massAdded << endl;
603  }
604 
605  return massAdded;
606 }
607 
608 
610 {
611  scalar DiNum = -GREAT;
612 
613  if (regionMesh().nInternalFaces() > 0)
614  {
615  surfaceScalarField KrhoCpbyDelta
616  (
620  );
621 
622  DiNum = max(KrhoCpbyDelta.primitiveField())*time().deltaTValue();
623  }
624 
625  return DiNum;
626 }
627 
628 
630 {
631  return maxDiff_;
632 }
633 
634 
636 {
637  return rho_;
638 }
639 
640 
642 {
643  return solidThermo_->T();
644 }
645 
646 
648 {
649  return solidThermo_->Cp();
650 }
651 
652 
654 {
655  return radiation_->absorptionEmission().a();
656 }
657 
658 
660 {
661  return solidThermo_->kappa();
662 }
663 
664 
666 {
667  return phiGas_;
668 }
669 
670 
672 {
674 }
675 
676 
678 {
679  Info<< "\nEvolving pyrolysis in region: " << regionMesh().name() << endl;
680 
682  {
683  solidChemistry_->solve(time().deltaTValue());
684  }
685  else
686  {
687  solidChemistry_->calculate();
688  }
689 
690  solveContinuity();
691 
692  chemistryQdot_ = solidChemistry_->Qdot()();
693 
694  updateFields();
695 
697 
698  for (int nonOrth=0; nonOrth<=nNonOrthCorr_; nonOrth++)
699  {
700  solveEnergy();
701  }
702 
704 
705  solidThermo_->correct();
706 
707  Info<< "pyrolysis min/max(T) = "
708  << gMin(solidThermo_->T().primitiveField())
709  << ", "
710  << gMax(solidThermo_->T().primitiveField())
711  << endl;
712 }
713 
714 
716 {
717  Info<< "\nPyrolysis in region: " << regionMesh().name() << endl;
718 
719  Info<< indent << "Total gas mass produced [kg] = "
720  << addedGasMass_.value() << nl
721  << indent << "Total solid mass lost [kg] = "
722  << lostSolidMass_.value() << nl
723  //<< indent << "Total pyrolysis gases [kg/s] = "
724  //<< totalGasMassFlux_ << nl
725  << indent << "Total heat release rate [J/s] = "
726  << totalHeatRR_.value() << nl;
727 }
728 
729 
730 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
731 
732 } // End namespace Foam
733 } // End namespace regionModels
734 } // End namespace pyrolysisModels
735 
736 // ************************************************************************* //
Foam::regionModels::pyrolysisModels::pyrolysisModel
Base class for pyrolysis models.
Definition: pyrolysisModel.H:62
Foam::expressions::patchExpr::debug
int debug
Static debugging option.
Foam::regionModels::pyrolysisModels::reactingOneDim::solidThermo_
autoPtr< solidReactionThermo > solidThermo_
Reference to solid thermo.
Definition: reactingOneDim.H:83
Foam::IOobject::NO_WRITE
Definition: IOobject.H:130
Foam::regionModels::pyrolysisModels::reactingOneDim::~reactingOneDim
virtual ~reactingOneDim()
Destructor.
Definition: reactingOneDim.C:577
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:104
InfoInFunction
#define InfoInFunction
Report an information message using Foam::Info.
Definition: messageStream.H:316
Foam::IOobject::AUTO_WRITE
Definition: IOobject.H:129
Foam::regionModels::pyrolysisModels::reactingOneDim::kappa
virtual tmp< volScalarField > kappa() const
Return the region thermal conductivity [W/m/k].
Definition: reactingOneDim.C:659
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::regionModels::pyrolysisModels::reactingOneDim::preEvolveRegion
virtual void preEvolveRegion()
Pre-evolve region.
Definition: reactingOneDim.C:671
Foam::regionModels::pyrolysisModels::reactingOneDim::phiGas
virtual const surfaceScalarField & phiGas() const
Return the total gas mass flux to primary region [kg/m2/s].
Definition: reactingOneDim.C:665
Foam::regionModels::pyrolysisModels::reactingOneDim::solveSpeciesMass
void solveSpeciesMass()
Solve solid species mass conservation.
Definition: reactingOneDim.C:256
Foam::regionModels::pyrolysisModels::reactingOneDim::maxDiff_
scalar maxDiff_
Maximum diffusivity.
Definition: reactingOneDim.H:110
Foam::TimeState::deltaT
dimensionedScalar deltaT() const
Return time step.
Definition: TimeStateI.H:54
Foam::tmp< volScalarField >
Foam::regionModels::pyrolysisModels::reactingOneDim::useChemistrySolvers_
bool useChemistrySolvers_
Use chemistry solvers (ode or sequential)
Definition: reactingOneDim.H:162
Foam::Zero
static constexpr const zero Zero
Global zero.
Definition: zero.H:128
Foam::dimEnergy
const dimensionSet dimEnergy
Foam::polyMesh::moving
bool moving() const
Is mesh moving.
Definition: polyMesh.H:513
Foam::fvc::domainIntegrate
dimensioned< Type > domainIntegrate(const GeometricField< Type, fvPatchField, volMesh > &vf)
Definition: fvcVolumeIntegrate.C:88
Foam::dictionary::dictionary
dictionary()
Construct top-level dictionary null.
Definition: dictionary.C:81
Foam::constant::atomic::alpha
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Definition: readThermalProperties.H:212
Foam::regionModels::pyrolysisModels::reactingOneDim::updatePhiGas
void updatePhiGas()
Update enthalpy flux for pyrolysis gases.
Definition: reactingOneDim.C:144
Foam::GeometricField::primitiveField
const Internal::FieldType & primitiveField() const
Return a const-reference to the internal field.
Definition: GeometricFieldI.H:53
Foam::read
bool read(const char *buf, int32_t &val)
Same as readInt32.
Definition: int32.H:108
Foam::regionModels::pyrolysisModels::reactingOneDim::h_
volScalarField & h_
Definition: reactingOneDim.H:101
fvcDiv.H
Calculate the divergence of the given field.
Foam::regionModels::regionModel::time
const Time & time() const
Return the reference to the time database.
Definition: regionModelI.H:39
Foam::fvc::div
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcDiv.C:49
Foam::regionModels::pyrolysisModels::reactingOneDim::solveContinuity
void solveContinuity()
Solve continuity equation.
Definition: reactingOneDim.C:228
Foam::regionModels::pyrolysisModels::reactingOneDim::solidRegionDiffNo
virtual scalar solidRegionDiffNo() const
Mean diffusion number of the solid region.
Definition: reactingOneDim.C:609
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:337
Foam::dimensioned::value
const Type & value() const
Return const reference to value.
Definition: dimensionedType.C:404
Foam::regionModels::pyrolysisModels::reactingOneDim::addedGasMass_
dimensionedScalar addedGasMass_
Cumulative mass generation of the gas phase [kg].
Definition: reactingOneDim.H:144
Foam::gSum
Type gSum(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:594
Foam::exp
dimensionedScalar exp(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:261
Foam::dictionary::lookupOrDefault
T lookupOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Definition: dictionary.H:1241
Foam::regionModels::pyrolysisModels::reactingOneDim::rho_
volScalarField rho_
Density [kg/m3].
Definition: reactingOneDim.H:95
Foam::regionModels::pyrolysisModels::reactingOneDim::gasHSource_
bool gasHSource_
Add gas enthalpy source term.
Definition: reactingOneDim.H:156
Foam::surfaceInterpolation::deltaCoeffs
const surfaceScalarField & deltaCoeffs() const
Return reference to cell-centre difference coefficients.
Definition: surfaceInterpolation.C:90
Foam::regionModels::pyrolysisModels::reactingOneDim::updateFields
void updateFields()
Update submodels.
Definition: reactingOneDim.C:198
Foam::regionModels::pyrolysisModels::reactingOneDim::chemistryQdot_
volScalarField chemistryQdot_
Heat release rate [J/s/m3].
Definition: reactingOneDim.H:125
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:290
Foam::regionModels::regionModel1D::boundaryFaceCells_
labelListList boundaryFaceCells_
Global cell IDs.
Definition: regionModel1D.H:83
Foam::fvc::laplacian
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcLaplacian.C:47
Foam::regionModels::pyrolysisModels::defineTypeNameAndDebug
defineTypeNameAndDebug(noPyrolysis, 0)
Foam::dimTime
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:54
Foam::regionModels::pyrolysisModels::reactingOneDim::calculateMassTransfer
void calculateMassTransfer()
Mass check.
Definition: reactingOneDim.C:351
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:62
Foam::Field< vector >
Foam::regionModels::regionModel1D::moveMesh
tmp< labelField > moveMesh(const scalarList &deltaV, const scalar minDelta=0.0)
Move mesh points according to change in cell volumes.
Definition: regionModel1D.C:195
Foam::regionModels::pyrolysisModels::reactingOneDim::maxDiff
virtual scalar maxDiff() const
Return max diffusivity allowed in the solid.
Definition: reactingOneDim.C:629
Foam::hashedWordList
A wordList with hashed named lookup, which can be faster in some situations than using the normal lis...
Definition: hashedWordList.H:54
Yt
volScalarField Yt(0.0 *Y[0])
Foam::radiation::radiationModel::New
static autoPtr< radiationModel > New(const volScalarField &T)
Return a reference to the selected radiation model.
Definition: radiationModelNew.C:36
Foam::solver
Base class for solution control classes.
Definition: solver.H:51
Foam::Info
messageStream Info
Information stream (uses stdout - output is on the master only)
Foam::regionModels::pyrolysisModels::reactingOneDim::nNonOrthCorr_
label nNonOrthCorr_
Number of non-orthogonal correctors.
Definition: reactingOneDim.H:107
Foam::fvm::laplacian
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvmLaplacian.C:48
Foam::regionModels::pyrolysisModels::reactingOneDim::T
virtual const volScalarField & T() const
Return const temperature [K].
Definition: reactingOneDim.C:641
Foam::regionModels::regionModel::regionMesh
const fvMesh & regionMesh() const
Return the region mesh database.
Definition: regionModelI.H:63
DiNum
scalar DiNum
Definition: solidRegionDiffusionNo.H:1
Foam::dictionary::subDict
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
Definition: dictionary.C:523
Foam::IOobject::READ_IF_PRESENT
Definition: IOobject.H:122
Foam::regionModels::pyrolysisModels::reactingOneDim::Ys_
PtrList< volScalarField > & Ys_
List of solid components.
Definition: reactingOneDim.H:98
delta
scalar delta
Definition: LISASMDCalcMethod2.H:8
Foam::regionModels::pyrolysisModels::reactingOneDim::read
bool read()
Read control parameters from dictionary.
Definition: reactingOneDim.C:68
Foam::regionModels::pyrolysisModels::reactingOneDim::rho
const volScalarField & rho() const
Fields.
Definition: reactingOneDim.C:635
Foam::regionModels::regionModel::preEvolveRegion
virtual void preEvolveRegion()
Pre-evolve region.
Definition: regionModel.C:515
Foam::dictionary::readEntry
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
Definition: dictionaryTemplates.C:314
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:43
Foam::regionModels::pyrolysisModels::pyrolysisModel::read
virtual bool read()
Read control parameters.
Definition: pyrolysisModel.C:52
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::regionModels::pyrolysisModels::reactingOneDim::minimumDelta_
scalar minimumDelta_
Minimum delta for combustion.
Definition: reactingOneDim.H:113
Foam::max
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:47
Foam::regionModels::pyrolysisModels::reactingOneDim::kappaRad
virtual tmp< volScalarField > kappaRad() const
Return the region absorptivity [1/m].
Definition: reactingOneDim.C:653
Foam::regionModels::regionModel::solution
const dictionary & solution() const
Return the solution dictionary.
Definition: regionModelI.H:106
Foam::regionModels::pyrolysisModels::reactingOneDim::totalHeatRR_
dimensionedScalar totalHeatRR_
Total heat release rate [J/s].
Definition: reactingOneDim.H:150
timeName
word timeName
Definition: getTimeIndex.H:3
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::regionModels::regionModel1D::nMagSf
const surfaceScalarField & nMagSf() const
Return the face area magnitudes / [m2].
Definition: regionModel1DI.H:54
fvm.H
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::Time::controlDict
const dictionary & controlDict() const
Return read access to the controlDict dictionary.
Definition: Time.H:309
Foam::regionModels::regionModel::infoOutput_
Switch infoOutput_
Active information output.
Definition: regionModel.H:95
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam::regionModels::pyrolysisModels::reactingOneDim::addMassSources
virtual scalar addMassSources(const label patchi, const label facei)
External hook to add mass to the primary region.
Definition: reactingOneDim.C:583
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:84
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::dimMass
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:52
Foam::fvc::interpolate
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.
Foam::indent
Ostream & indent(Ostream &os)
Indent stream.
Definition: Ostream.H:307
Foam::GeometricField::correctBoundaryConditions
void correctBoundaryConditions()
Correct boundary field.
Definition: GeometricField.C:909
Foam::regionModels::pyrolysisModels::reactingOneDim::evolveRegion
virtual void evolveRegion()
Evolve the pyrolysis equations.
Definition: reactingOneDim.C:677
Foam::basicSolidChemistryModel::New
static autoPtr< basicSolidChemistryModel > New(solidReactionThermo &thermo)
Selector.
Definition: basicSolidChemistryModelNew.C:34
Foam::regionModels::pyrolysisModels::reactingOneDim::phiGas_
surfaceScalarField phiGas_
Total gas mass flux to the primary region [kg/m2/s].
Definition: reactingOneDim.H:119
Foam::primitiveMesh::cellCentres
const vectorField & cellCentres() const
Definition: primitiveMeshCellCentresAndVols.C:176
Foam::fvm::ddt
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
Definition: fvmDdt.C:48
Foam::sqr
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Definition: dimensionedSymmTensor.C:51
Foam::regionModels::regionModel::time_
const Time & time_
Reference to the time database.
Definition: regionModel.H:89
fvcLaplacian.H
Calculate the laplacian of the given field.
Foam::nl
constexpr char nl
Definition: Ostream.H:372
Foam::regionModels::pyrolysisModels::reactingOneDim::phiHsGas_
volScalarField phiHsGas_
Sensible enthalpy gas flux [J/m2/s].
Definition: reactingOneDim.H:122
absorptionEmissionModel.H
Foam::GeometricField::boundaryFieldRef
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
Definition: GeometricField.C:752
Foam::Vector< scalar >
Foam::regionModels::pyrolysisModels::reactingOneDim::updateMesh
void updateMesh(const scalarField &mass0)
Update/move mesh based on change in mass.
Definition: reactingOneDim.C:210
Foam::TimeState::deltaTValue
scalar deltaTValue() const
Return time step value.
Definition: TimeStateI.H:42
Foam::List< label >
Foam::regionModels::pyrolysisModels::reactingOneDim::qrHSource_
bool qrHSource_
Add in depth radiation source term.
Definition: reactingOneDim.H:159
Foam::mag
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Foam::type
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:590
Foam::regionModels::pyrolysisModels::reactingOneDim::lostSolidMass_
dimensionedScalar lostSolidMass_
Cumulative lost mass of the condensed phase [kg].
Definition: reactingOneDim.H:141
k
label k
Boltzmann constant.
Definition: LISASMDCalcMethod2.H:41
Foam::regionModels::pyrolysisModels::reactingOneDim::info
virtual void info()
Provide some feedback.
Definition: reactingOneDim.C:715
Foam::constant::electromagnetic::e
const dimensionedScalar e
Elementary charge.
Definition: createFields.H:11
fvcVolumeIntegrate.H
Volume integrate volField creating a volField.
Foam::regionModels::pyrolysisModels::reactingOneDim::radiation_
autoPtr< radiation::radiationModel > radiation_
Pointer to radiation model.
Definition: reactingOneDim.H:89
Foam::fvMatrix
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvPatchField.H:76
Foam::fvMatrix::solve
SolverPerformance< Type > solve(const dictionary &)
Solve returning the solution statistics.
Definition: fvMatrixSolve.C:298
Foam::regionModels::regionModel1D::moveMesh_
Switch moveMesh_
Flag to allow mesh movement.
Definition: regionModel1D.H:98
Foam::regionModels::pyrolysisModels::reactingOneDim::qr_
volScalarField qr_
Coupled region radiative heat flux [W/m2].
Definition: reactingOneDim.H:135
Foam::regionModels::regionModel::intCoupledPatchIDs_
labelList intCoupledPatchIDs_
List of patch IDs internally coupled with the primary region.
Definition: regionModel.H:116
Foam::GeometricField::max
void max(const dimensioned< Type > &dt)
Use the maximum of the field and specified value.
Definition: GeometricField.C:1112
forAllReverse
#define forAllReverse(list, i)
Reverse loop across all elements in list.
Definition: stdFoam.H:303
Foam::regionModels::regionModel::coeffs
const dictionary & coeffs() const
Return the model coefficients dictionary.
Definition: regionModelI.H:99
Foam::regionModels::pyrolysisModels::reactingOneDim::solveEnergy
void solveEnergy()
Solve energy.
Definition: reactingOneDim.C:295
cells
const cellShapeList & cells
Definition: gmvOutputHeader.H:3
Foam::regionModels::pyrolysisModels::reactingOneDim::solidChemistry_
autoPtr< basicSolidChemistryModel > solidChemistry_
Reference to the solid chemistry model.
Definition: reactingOneDim.H:86
Foam::solidReactionThermo::New
static autoPtr< solidReactionThermo > New(const fvMesh &, const word &phaseName=word::null)
Standard selection based on fvMesh.
Definition: solidReactionThermo.C:67
Foam::gMin
Type gMin(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:593
reactingOneDim.H
Foam::dimVolume
const dimensionSet dimVolume(pow3(dimLength))
Definition: dimensionSets.H:61
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::IOobject::NO_READ
Definition: IOobject.H:123
Foam::fvMesh::Cf
const surfaceVectorField & Cf() const
Return face centres as surfaceVectorField.
Definition: fvMeshGeometry.C:369
Foam::regionModels::pyrolysisModels::reactingOneDim::updateqr
void updateqr()
Update radiative flux in pyrolysis region.
Definition: reactingOneDim.C:92
Foam::regionModels::pyrolysisModels::addToRunTimeSelectionTable
addToRunTimeSelectionTable(pyrolysisModel, noPyrolysis, mesh)
Foam::gMax
Type gMax(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:592
Foam::GeometricField::boundaryField
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Definition: GeometricFieldI.H:62
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54
Foam::regionModels::pyrolysisModels::reactingOneDim::Cp
virtual const tmp< volScalarField > Cp() const
Return specific heat capacity [J/kg/K].
Definition: reactingOneDim.C:647
Foam::fvMesh::name
const word & name() const
Return reference to name.
Definition: fvMesh.H:266
Foam::fvMesh::V
const DimensionedField< scalar, volMesh > & V() const
Return cell volumes.
Definition: fvMeshGeometry.C:190
Foam::regionModels::regionModel::primaryPatchIDs_
labelList primaryPatchIDs_
List of patch IDs on the primary region coupled to this region.
Definition: regionModel.H:113
Foam::IOobject::MUST_READ
Definition: IOobject.H:120