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 | Copyright (C) 2011-2017 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 "combustionModel.H"
27 
28 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
29 
30 namespace Foam
31 {
33 }
34 
36 (
37  "combustionProperties"
38 );
39 
40 
41 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
42 
43 Foam::combustionModel::combustionModel
44 (
45  const word& modelType,
46  const fvMesh& mesh,
47  const word& combustionProperties,
48  const word& phaseName
49 )
50 :
52  (
53  IOobject
54  (
55  IOobject::groupName(combustionProperties, phaseName),
56  mesh.time().constant(),
57  mesh,
60  )
61  ),
62  turbulencePtr_(),
63  mesh_(mesh),
64  active_(lookupOrDefault<Switch>("active", true)),
65  coeffs_(optionalSubDict(modelType + "Coeffs")),
66  modelType_(modelType),
67  phaseName_(phaseName)
68 {}
69 
70 
71 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
72 
74 {
75  if (turbulencePtr_)
76  {
77  turbulencePtr_ = 0;
78  }
79 }
80 
81 
82 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
83 
85 {
86  if (regIOobject::read())
87  {
88  this->lookup("active") >> active_;
89  coeffs_ = optionalSubDict(modelType_ + "Coeffs");
90  return true;
91  }
92  else
93  {
94  return false;
95  }
96 }
97 
98 
99 // ************************************************************************* //
virtual bool read()
Read object.
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:243
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:52
stressControl lookup("compactNormalStress") >> compactNormalStress
dynamicFvMesh & mesh
A class for handling words, derived from string.
Definition: word.H:59
static word groupName(Name name, const word &group)
const word & constant() const
Return constant name.
Definition: TimePaths.H:124
virtual ~combustionModel()
Destructor.
virtual bool read()
Update properties from given dictionary.
Base class for combustion models.
defineTypeNameAndDebug(combustionModel, 0)
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:92
Namespace for OpenFOAM.
static const word combustionPropertiesName
Default combustionProperties dictionary name.