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-2015 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 
35 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
36 
37 Foam::combustionModel::combustionModel
38 (
39  const word& modelType,
40  const fvMesh& mesh,
41  const word& phaseName
42 )
43 :
45  (
46  IOobject
47  (
48  IOobject::groupName("combustionProperties", phaseName),
49  mesh.time().constant(),
50  mesh,
53  )
54  ),
55  turbulencePtr_(),
56  mesh_(mesh),
57  active_(lookupOrDefault<Switch>("active", true)),
58  coeffs_(subDict(modelType + "Coeffs")),
59  modelType_(modelType),
60  phaseName_(phaseName)
61 {}
62 
63 
64 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
65 
67 {
68  if (turbulencePtr_)
69  {
70  turbulencePtr_ = 0;
71  }
72 }
73 
74 
75 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
76 
77 
79 {
80  if (regIOobject::read())
81  {
82  this->lookup("active") >> active_;
83  coeffs_ = subDict(modelType_ + "Coeffs");
84  return true;
85  }
86  else
87  {
88  return false;
89  }
90 }
91 
92 
94 {
96  (
97  new volScalarField
98  (
99  IOobject
100  (
101  IOobject::groupName("Sh", phaseName_),
102  mesh_.time().timeName(),
103  mesh_,
106  ),
107  mesh_,
109  )
110  );
111 }
112 
113 
114 // ************************************************************************* //
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:51
A class for handling words, derived from string.
Definition: word.H:59
const dimensionSet dimEnergy
dynamicFvMesh & mesh
const word & constant() const
Return constant name.
Definition: TimePaths.H:124
Namespace for OpenFOAM.
virtual ~combustionModel()
Destructor.
virtual bool read()
Update properties from given dictionary.
static word groupName(Name name, const word &group)
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:243
stressControl lookup("compactNormalStress") >> compactNormalStress
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:91
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:53
virtual tmp< volScalarField > Sh() const
Return source for enthalpy equation [kg/m/s3].
virtual bool read()
Read object.
const dimensionSet dimVolume(pow3(dimLength))
Definition: dimensionSets.H:58
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
A class for managing temporary objects.
Definition: PtrList.H:118
defineTypeNameAndDebug(combustionModel, 0)
Base class for combustion models.