OpenFOAM: API Guide
v2112
The open source CFD toolbox
combustionModel.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) 2020-2021 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 "
combustionModel.H
"
30
31
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32
33
namespace
Foam
34
{
35
defineTypeNameAndDebug
(
combustionModel
, 0);
36
}
37
38
const
Foam::word
Foam::combustionModel::combustionPropertiesName
39
(
40
"combustionProperties"
41
);
42
43
44
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
45
46
Foam::IOobject
Foam::combustionModel::createIOobject
47
(
48
basicThermo&
thermo
,
49
const
word& combustionProperties
50
)
const
51
{
52
IOobject
io
53
(
54
thermo
.phasePropertyName(combustionProperties),
55
thermo
.db().time().constant(),
56
thermo
.db(),
57
IOobject::MUST_READ
,
58
IOobject::NO_WRITE
59
);
60
61
if
(
io
.
typeHeaderOk
<IOdictionary>(
true
))
62
{
63
io
.
readOpt
(
IOobject::MUST_READ_IF_MODIFIED
);
64
}
65
else
66
{
67
io
.
readOpt
(
IOobject::NO_READ
);
68
}
69
70
return
io
;
71
}
72
73
74
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
75
76
Foam::combustionModel::combustionModel
77
(
78
const
word
& modelType,
79
basicThermo
&
thermo
,
80
const
compressibleTurbulenceModel
&
turb
,
81
const
word
& combustionProperties
82
)
83
:
84
IOdictionary
(createIOobject(
thermo
, combustionProperties)),
85
mesh_(
thermo
.
p
().
mesh
()),
86
turb_(
turb
),
87
active_(getOrDefault<
Switch
>(
"active"
, true)),
88
coeffs_(optionalSubDict(modelType +
"Coeffs"
)),
89
modelType_(modelType)
90
{}
91
92
93
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
94
95
Foam::combustionModel::~combustionModel
()
96
{}
97
98
99
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
100
101
bool
Foam::combustionModel::read
()
102
{
103
if
(
regIOobject::read
())
104
{
105
this->readEntry(
"active"
, active_);
106
coeffs_ = optionalSubDict(modelType_ +
"Coeffs"
);
107
return
true
;
108
}
109
110
return
false
;
111
}
112
113
114
// ************************************************************************* //
turb
compressible::turbulenceModel & turb
Definition:
setRegionFluidFields.H:10
Foam::IOdictionary
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition:
IOdictionary.H:57
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition:
IOobject.H:170
Foam::IOobject::readOpt
readOption readOpt() const noexcept
The read option.
Definition:
IOobjectI.H:164
Foam::IOobject::typeHeaderOk
bool typeHeaderOk(const bool checkType=true, const bool search=true, const bool verbose=true)
Read header (uses typeFilePath to find file) and check its info.
Definition:
IOobjectTemplates.C:39
Foam::IOobject::NO_WRITE
@ NO_WRITE
Definition:
IOobject.H:187
Foam::IOobject::NO_READ
@ NO_READ
Definition:
IOobject.H:178
Foam::IOobject::MUST_READ_IF_MODIFIED
@ MUST_READ_IF_MODIFIED
Definition:
IOobject.H:180
Foam::IOobject::MUST_READ
@ MUST_READ
Definition:
IOobject.H:179
Foam::Switch
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition:
Switch.H:78
Foam::basicThermo
Abstract base-class for fluid and solid thermodynamic properties.
Definition:
basicThermo.H:66
Foam::combustionModel
Base class for combustion models.
Definition:
combustionModel.H:57
Foam::combustionModel::combustionPropertiesName
static const word combustionPropertiesName
Default combustionProperties dictionary name.
Definition:
combustionModel.H:100
Foam::combustionModel::~combustionModel
virtual ~combustionModel()
Destructor.
Definition:
combustionModel.C:95
Foam::combustionModel::read
virtual bool read()
Update properties from given dictionary.
Definition:
combustionModel.C:101
Foam::compressibleTurbulenceModel
Abstract base class for turbulence models (RAS, LES and laminar).
Definition:
compressibleTurbulenceModel.H:57
Foam::regIOobject::read
virtual bool read()
Read object.
Definition:
regIOobjectRead.C:193
thermo
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
Foam::word
A class for handling words, derived from Foam::string.
Definition:
word.H:68
defineTypeNameAndDebug
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition:
className.H:121
combustionModel.H
p
volScalarField & p
Definition:
createFieldRefs.H:8
mesh
dynamicFvMesh & mesh
Definition:
createDynamicFvMesh.H:6
io
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
Foam
Namespace for OpenFOAM.
Definition:
atmBoundaryLayer.C:34
src
combustionModels
combustionModel
combustionModel.C
Generated by
1.9.5
OPENFOAM® is a registered
trademark
of OpenCFD Ltd.