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-------------------------------------------------------------------------------
11License
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
33namespace Foam
34{
36}
37
39(
40 "combustionProperties"
41);
42
43
44// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
45
46Foam::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(),
59 );
60
61 if (io.typeHeaderOk<IOdictionary>(true))
62 {
64 }
65 else
66 {
68 }
69
70 return io;
71}
72
73
74// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
75
77(
78 const word& modelType,
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
96{}
97
98
99// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
100
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// ************************************************************************* //
compressible::turbulenceModel & turb
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:57
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:170
readOption readOpt() const noexcept
The read option.
Definition: IOobjectI.H:164
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.
@ MUST_READ_IF_MODIFIED
Definition: IOobject.H:180
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:78
Abstract base-class for fluid and solid thermodynamic properties.
Definition: basicThermo.H:66
Base class for combustion models.
static const word combustionPropertiesName
Default combustionProperties dictionary name.
virtual ~combustionModel()
Destructor.
virtual bool read()
Update properties from given dictionary.
Abstract base class for turbulence models (RAS, LES and laminar).
virtual bool read()
Read object.
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
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
volScalarField & p
dynamicFvMesh & mesh
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
Namespace for OpenFOAM.