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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2017 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26\*---------------------------------------------------------------------------*/
27
28#include "relaxation.H"
30#include "fvm.H"
31#include "LESModel.H"
32
33// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34
35namespace Foam
36{
37namespace reactionRateFlameAreaModels
38{
41 (
45 );
46}
47}
48
49
50// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
51
53(
54 const word modelType,
55 const dictionary& dict,
56 const fvMesh& mesh,
57 const combustionModel& combModel
58)
59:
60 reactionRateFlameArea(modelType, dict, mesh, combModel),
61 correlation_(dict.optionalSubDict(typeName + "Coeffs").subDict(fuel_)),
62 C_(dict.optionalSubDict(typeName + "Coeffs").get<scalar>("C")),
63 alpha_(dict.optionalSubDict(typeName + "Coeffs").get<scalar>("alpha"))
64{}
65
66
67// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
68
70{}
71
72
73// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
74
76(
77 const volScalarField& sigma
78)
79{
81 (
82 "omega0",
83 dimensionSet(1, -2, -1, 0, 0, 0, 0),
84 correlation_.omega0()
85 );
86
87 dimensionedScalar sigmaExt
88 (
89 "sigmaExt",
90 dimensionSet(0, 0, -1, 0, 0, 0, 0),
91 correlation_.sigmaExt()
92 );
93
94 dimensionedScalar omegaMin
95 (
96 "omegaMin",
97 omega0.dimensions(),
98 1e-4
99 );
100
102 (
103 "kMin",
105 SMALL
106 );
107
108 const compressibleTurbulenceModel& turbulence = combModel_.turbulence();
109
110 // Total strain
111 const volScalarField sigmaTotal
112 (
113 sigma + alpha_*turbulence.epsilon()/(turbulence.k() + kMin)
114 );
115
116 const volScalarField omegaInf(correlation_.omega0Sigma(sigmaTotal));
117
118 const volScalarField tau(C_*mag(sigmaTotal));
119
121 (
122 (tau*omegaInf*(omega0 - omegaInf) + sqr(omegaMin)*sigmaExt)
123 /(sqr(omega0 - omegaInf) + sqr(omegaMin))
124 );
125
126 const volScalarField& rho = combModel_.rho();
127 const tmp<surfaceScalarField> tphi = combModel_.phi();
128 const surfaceScalarField& phi = tphi();
129
130 solve
131 (
132 fvm::ddt(rho, omega_)
133 + fvm::div(phi, omega_)
134 ==
135 rho*Rc*omega0
136 - fvm::SuSp(rho*(tau + Rc), omega_)
137 );
138
139 omega_.min(omega0);
140 omega_.max(0.0);
141}
142
143
145(
146 const dictionary& dict
147)
148{
150 {
151 coeffDict_ = dict.optionalSubDict(typeName + "Coeffs");
152 coeffDict_.readEntry("C", C_);
153 coeffDict_.readEntry("alpha", alpha_);
154 correlation_.read
155 (
156 coeffDict_.subDict(fuel_)
157 );
158 return true;
159 }
160
161 return false;
162}
163
164// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
surfaceScalarField & phi
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
virtual bool read()
Re-read model coefficients if they have changed.
Base class for combustion models.
Abstract base class for turbulence models (RAS, LES and laminar).
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
Definition: dimensionSet.H:109
const dimensionSet & dimensions() const
Return const reference to dimensions.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Consumption rate per unit of flame area obtained from a relaxation equation.
Definition: relaxation.H:56
Abstract class for reaction rate per flame area unit.
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition: className.H:121
dynamicFvMesh & mesh
compressible::turbulenceModel & turbulence
tmp< fvMatrix< Type > > div(const surfaceScalarField &flux, const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvmDiv.C:48
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
Definition: fvmDdt.C:48
zeroField SuSp(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
Namespace for OpenFOAM.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
const dimensionSet dimVelocity
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
dictionary dict
CEqn solve()
volScalarField & e
Definition: createFields.H:11