relaxation.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 | Copyright (C) 2011-2015 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 "relaxation.H"
28 #include "fvm.H"
29 #include "LESModel.H"
30 
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35 namespace reactionRateFlameAreaModels
36 {
39  (
41  relaxation,
43  );
44 }
45 }
46 
47 
48 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
49 
51 (
52  const word modelType,
53  const dictionary& dict,
54  const fvMesh& mesh,
55  const combustionModel& combModel
56 )
57 :
58  reactionRateFlameArea(modelType, dict, mesh, combModel),
59  correlation_(dict.subDict(typeName + "Coeffs").subDict(fuel_)),
60  C_(readScalar(dict.subDict(typeName + "Coeffs").lookup("C"))),
61  alpha_(readScalar(dict.subDict(typeName + "Coeffs").lookup("alpha")))
62 {}
63 
64 
65 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
66 
68 {}
69 
70 
71 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
72 
74 (
75  const volScalarField& sigma
76 )
77 {
78  dimensionedScalar omega0
79  (
80  "omega0",
81  dimensionSet(1, -2, -1, 0, 0, 0, 0),
82  correlation_.omega0()
83  );
84 
85  dimensionedScalar sigmaExt
86  (
87  "sigmaExt",
88  dimensionSet(0, 0, -1, 0, 0, 0, 0),
89  correlation_.sigmaExt()
90  );
91 
92  dimensionedScalar omegaMin
93  (
94  "omegaMin",
95  omega0.dimensions(),
96  1e-4
97  );
98 
100  (
101  "kMin",
102  sqr(dimVelocity),
103  SMALL
104  );
105 
106  const compressibleTurbulenceModel& turbulence = combModel_.turbulence();
107 
108  // Total strain
109  const volScalarField sigmaTotal
110  (
111  sigma + alpha_*turbulence.epsilon()/(turbulence.k() + kMin)
112  );
113 
114  const volScalarField omegaInf(correlation_.omega0Sigma(sigmaTotal));
115 
116  dimensionedScalar sigma0("sigma0", sigma.dimensions(), 0.0);
117 
118  const volScalarField tau(C_*mag(sigmaTotal));
119 
120  volScalarField Rc
121  (
122  (tau*omegaInf*(omega0 - omegaInf) + sqr(omegaMin)*sigmaExt)
123  /(sqr(omega0 - omegaInf) + sqr(omegaMin))
124  );
125 
126  tmp<surfaceScalarField> phi(combModel_.phi());
127 
128  solve
129  (
130  fvm::ddt(omega_)
131  + fvm::div(phi, omega_, "div(phi,omega)")
132  ==
133  Rc*omega0
134  - fvm::SuSp((tau + Rc), omega_)
135  );
136 
137  omega_.min(omega0);
138  omega_.max(0.0);
139 
140 }
141 
142 
144 (
145  const dictionary& dict
146 )
147 {
149  {
150  coeffDict_ = dict.subDict(typeName + "Coeffs");
151  coeffDict_.lookup("C") >> C_;
152  coeffDict_.lookup("alpha") >> alpha_;
153  correlation_.read
154  (
155  coeffDict_.subDict(fuel_)
156  );
157  return true;
158  }
159  else
160  {
161  return false;
162  }
163 }
164 
165 // ************************************************************************* //
Foam::combustionModel
Base class for combustion models.
Definition: combustionModel.H:49
Foam::reactionRateFlameAreaModels::relaxation
Consumption rate per unit of flame area obtained from a relaxation equation.
Definition: relaxation.H:51
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::dimVelocity
const dimensionSet dimVelocity
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::reactionRateFlameAreaModels::addToRunTimeSelectionTable
addToRunTimeSelectionTable(reactionRateFlameArea, relaxation, dictionary)
Foam::reactionRateFlameAreaModels::relaxation::relaxation
relaxation(const relaxation &)
Disallow copy construct.
Foam::dimensionSet
Dimension set for the base types.
Definition: dimensionSet.H:116
Foam::mag
dimensioned< scalar > mag(const dimensioned< Type > &)
Foam::reactionRateFlameAreaModels::defineTypeNameAndDebug
defineTypeNameAndDebug(relaxation, 0)
turbulence
autoPtr< compressible::turbulenceModel > turbulence
Definition: createFields.H:23
Foam::reactionRateFlameAreaModels::relaxation::~relaxation
virtual ~relaxation()
Definition: relaxation.C:67
Foam::fvm::SuSp
tmp< fvMatrix< Type > > SuSp(const DimensionedField< scalar, volMesh > &, const GeometricField< Type, fvPatchField, volMesh > &)
LESModel.H
Foam::reactionRateFlameArea::read
virtual bool read(const dictionary &dictProperties)
Update from dictionary.
Definition: reactionRateFlameArea.C:100
Foam::reactionRateFlameAreaModels::relaxation::read
virtual bool read(const dictionary &dictProperties)
Update properties from given dictionary.
Definition: relaxation.C:144
dict
dictionary dict
Definition: searchingEngine.H:14
fvm.H
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam::dimensioned
Generic dimensioned Type class.
Definition: dimensionedScalarFwd.H:41
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::e
const double e
Elementary charge.
Definition: doubleFloat.H:94
readScalar
#define readScalar
Definition: doubleScalar.C:38
Foam::reactionRateFlameArea
Abstract class for reaction rate per flame area unit.
Definition: reactionRateFlameArea.H:54
Foam::solve
SolverPerformance< Type > solve(fvMatrix< Type > &, const dictionary &)
Solve returning the solution statistics given convergence tolerance.
Foam::fvm::ddt
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
Definition: fvmDdt.C:46
Foam::sqr
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Definition: dimensionedSymmTensor.C:49
Foam::reactionRateFlameAreaModels::relaxation::correct
virtual void correct(const volScalarField &sigma)
Correct omega.
Definition: relaxation.C:74
relaxation.H
Foam::constant::physicoChemical::sigma
const dimensionedScalar sigma
Stefan-Boltzmann constant: default SI units: [W/m2/K4].
Foam::dimensioned::dimensions
const dimensionSet & dimensions() const
Return const reference to dimensions.
Definition: dimensionedType.C:248
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
Foam::fvm::div
tmp< fvMatrix< Type > > div(const surfaceScalarField &flux, const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvmDiv.C:46
Foam::compressibleTurbulenceModel
Abstract base class for turbulence models (RAS, LES and laminar).
Definition: compressibleTurbulenceModel.H:51