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 
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(),
59  );
60 
61  if (io.typeHeaderOk<IOdictionary>(true))
62  {
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,
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 // ************************************************************************* //
Foam::IOobject::NO_WRITE
Definition: IOobject.H:195
Foam::IOdictionary
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:54
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:169
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::regIOobject::read
virtual bool read()
Read object.
Definition: regIOobjectRead.C:191
thermo
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
Foam::basicThermo
Abstract base-class for fluid and solid thermodynamic properties.
Definition: basicThermo.H:63
Foam::IOobject::IOobject
IOobject(const IOobject &)=default
Copy construct.
Foam::IOdictionary::IOdictionary
IOdictionary(const IOobject &io, const dictionary *fallback=nullptr)
Definition: IOdictionary.C:37
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::combustionModel::combustionPropertiesName
static const word combustionPropertiesName
Default combustionProperties dictionary name.
Definition: combustionModel.H:100
Foam::IOobject::MUST_READ_IF_MODIFIED
Definition: IOobject.H:186
Foam::combustionModel::read
virtual bool read()
Update properties from given dictionary.
Definition: combustionModel.C:101
Foam::combustionModel::~combustionModel
virtual ~combustionModel()
Destructor.
Definition: combustionModel.C:95
turb
compressible::turbulenceModel & turb
Definition: setRegionFluidFields.H:10
Foam::IOobject::NO_READ
Definition: IOobject.H:188
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)
combustionModel.H
Foam::compressibleTurbulenceModel
Abstract base class for turbulence models (RAS, LES and laminar).
Definition: compressibleTurbulenceModel.H:54
Foam::IOobject::MUST_READ
Definition: IOobject.H:185