PaSR.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "PaSR.H"
28 
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
33 namespace combustionModels
34 {
37 }
38 }
39 
40 
41 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
42 
44 (
45  const word& modelType,
48  const word& combustionProperties
49 )
50 :
51  laminar(modelType, thermo, turb, combustionProperties),
52  Cmix_(this->coeffs().template lookup<scalar>("Cmix")),
53  kappa_
54  (
55  IOobject
56  (
57  thermo.phasePropertyName(typedName("kappa")),
58  this->mesh().time().name(),
59  this->mesh(),
60  IOobject::NO_READ,
61  IOobject::AUTO_WRITE
62  ),
63  this->mesh(),
65  )
66 {}
67 
68 
69 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
70 
72 {}
73 
74 
75 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
76 
78 {
80 
81  tmp<volScalarField> tepsilon(this->turbulence().epsilon());
82  const scalarField& epsilon = tepsilon();
83 
84  tmp<volScalarField> tnuEff(this->turbulence().nuEff());
85  const scalarField& nuEff = tnuEff();
86 
87  tmp<volScalarField> ttc(this->chemistryPtr_->tc());
88  const scalarField& tc = ttc();
89 
90  forAll(epsilon, i)
91  {
92  const scalar tk =
93  Cmix_*sqrt(max(nuEff[i]/(epsilon[i] + small), 0));
94 
95  if (tk > small)
96  {
97  kappa_[i] = tc[i]/(tc[i] + tk);
98  }
99  else
100  {
101  kappa_[i] = 1.0;
102  }
103  }
104 }
105 
106 
109 {
110  return kappa_*laminar::R(speciei);
111 }
112 
113 
116 {
117  return kappa_*laminar::R(Y);
118 }
119 
120 
123 {
124  return volScalarField::New
125  (
126  this->thermo().phasePropertyName(typedName("Qdot")),
127  kappa_*laminar::Qdot()
128  );
129 }
130 
131 
133 {
134  if (laminar::read())
135  {
136  this->coeffs().lookup("Cmix") >> Cmix_;
137  return true;
138  }
139  else
140  {
141  return false;
142  }
143 }
144 
145 
146 // ************************************************************************* //
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:434
Macros for easy insertion into run-time selection tables.
Generic GeometricField class.
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, const Internal &, const PtrList< PatchField< Type >> &, const HashPtrTable< Source > &=HashPtrTable< Source >())
Return a temporary field constructed from name,.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:99
Base class for combustion models.
Partially stirred reactor turbulent combustion model.
Definition: PaSR.H:57
PaSR(const word &modelType, const fluidMulticomponentThermo &thermo, const compressibleMomentumTransportModel &turb, const word &combustionProperties)
Construct from components.
Definition: PaSR.C:44
virtual void correct()
Correct combustion rate.
Definition: PaSR.C:77
virtual ~PaSR()
Destructor.
Definition: PaSR.C:71
virtual tmp< volScalarField::Internal > R(const label speciei) const
Specie consumption rate field.
Definition: PaSR.C:108
virtual tmp< volScalarField > Qdot() const
Heat release rate [kg/m/s^3].
Definition: PaSR.C:122
virtual bool read()
Update properties from given dictionary.
Definition: PaSR.C:132
Laminar combustion model.
Definition: laminar.H:55
virtual void correct()
Correct combustion rate.
Definition: laminar.C:94
virtual tmp< volScalarField::Internal > R(const label speciei) const
Specie consumption rate field.
Definition: laminar.C:131
virtual tmp< volScalarField > Qdot() const
Heat release rate [kg/m/s^3].
Definition: laminar.C:150
virtual bool read()
Update properties from given dictionary.
Definition: laminar.C:156
Base class for single-phase compressible turbulence models.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Base-class for multi-component fluid thermodynamic properties.
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
const scalar nuEff
const scalar epsilon
defineTypeNameAndDebug(diffusion, 0)
addToRunTimeSelectionTable(combustionModel, diffusion, dictionary)
Namespace for OpenFOAM.
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:59
word name(const bool)
Return a word representation of a bool.
Definition: boolIO.C:39
const dimensionSet dimless
dimensionedScalar sqrt(const dimensionedScalar &ds)
word typedName(Name name)
Return the name of the object within the given type.
Definition: typeInfo.H:176
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
autoPtr< incompressible::momentumTransportModel > turbulence(incompressible::momentumTransportModel::New(U, phi, viscosity))
PtrList< volScalarField > & Y
fluidMulticomponentThermo & thermo
Definition: createFields.H:31