SLGThermo.H
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-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::SLGThermo
28 
29 Description
30  Thermo package for (S)olids (L)iquids and (G)ases
31  Takes reference to thermo package, and provides:
32  - carrier : components of thermo - access to elemental properties
33  - liquids : liquid components - access to elemental properties
34  - solids : solid components - access to elemental properties
35 
36  If thermo is not a multi-component thermo package, carrier is nullptr.
37  Similarly, if no liquids or solids are specified, their respective
38  pointers will also be nullptr.
39 
40  Registered to the mesh so that it can be looked-up
41 
42 SourceFiles
43  SLGThermo.C
44 
45 \*---------------------------------------------------------------------------*/
46 
47 #ifndef SLGThermo_H
48 #define SLGThermo_H
49 
50 #include "regIOobject.H"
51 #include "fluidThermo.H"
52 #include "basicSpecieMixture.H"
54 #include "solidMixtureProperties.H"
55 
56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57 
58 namespace Foam
59 {
60 
61 /*---------------------------------------------------------------------------*\
62  Class SLGThermo Declaration
63 \*---------------------------------------------------------------------------*/
64 
65 class SLGThermo
66 :
67  public regIOobject
68 {
69  // Private data
70 
71  //- Thermo package
72  fluidThermo& thermo_;
73 
74  //- Reference to the multi-component carrier phase thermo
75  basicSpecieMixture* carrier_;
76 
77  //- Additional liquid properties data
79 
80  //- Additional solid properties data
82 
83 
84 public:
85 
86  //- Runtime type information
87  TypeName("SLGThermo");
88 
89  // Constructors
90 
91  //- Construct from mesh
93 
94 
95  //- Destructor
96  virtual ~SLGThermo();
97 
98 
99  // Member Functions
100 
101  // Access
102 
103  //- Return reference to the thermo database
104  const fluidThermo& thermo() const;
105 
106  //- Return reference to the gaseous components
107  const basicSpecieMixture& carrier() const;
108 
109  //- Return reference to the global (additional) liquids
110  const liquidMixtureProperties& liquids() const;
111 
112  //- Return reference to the global (additional) solids
113  const solidMixtureProperties& solids() const;
114 
115 
116  // Index retrieval
117 
118  //- Index of carrier component
119  label carrierId
120  (
121  const word& cmptName,
122  bool allowNotFound = false
123  ) const;
124 
125  //- Index of liquid component
126  label liquidId
127  (
128  const word& cmptName,
129  bool allowNotFound = false
130  ) const;
131 
132  //- Index of solid component
133  label solidId
134  (
135  const word& cmptName,
136  bool allowNotFound = false
137  ) const;
138 
139 
140  // Checks
141 
142  //- Thermo database has multi-component carrier flag
143  bool hasMultiComponentCarrier() const;
144 
145  //- Thermo database has liquid components flag
146  bool hasLiquids() const;
147 
148  //- Thermo database has solid components flag
149  bool hasSolids() const;
150 
151 
152  // IO
153 
154  bool writeData(Foam::Ostream&) const
155  {
156  return true;
157  }
158 };
159 
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 } // End namespace Foam
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 #endif
168 
169 // ************************************************************************* //
regIOobject.H
Foam::SLGThermo::~SLGThermo
virtual ~SLGThermo()
Destructor.
Definition: SLGThermo.C:99
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::SLGThermo::thermo
const fluidThermo & thermo() const
Return reference to the thermo database.
Definition: SLGThermo.C:105
Foam::basicSpecieMixture
Specialization of basicMultiComponentMixture for a mixture consisting of a number for molecular speci...
Definition: basicSpecieMixture.H:58
Foam::SLGThermo
Thermo package for (S)olids (L)iquids and (G)ases Takes reference to thermo package,...
Definition: SLGThermo.H:64
Foam::SLGThermo::hasMultiComponentCarrier
bool hasMultiComponentCarrier() const
Thermo database has multi-component carrier flag.
Definition: SLGThermo.C:226
fluidThermo.H
Foam::fluidThermo
Fundamental fluid thermodynamic properties.
Definition: fluidThermo.H:52
thermo
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
Foam::SLGThermo::solids
const solidMixtureProperties & solids() const
Return reference to the global (additional) solids.
Definition: SLGThermo.C:137
Foam::solidMixtureProperties
A mixture of solids.
Definition: solidMixtureProperties.H:69
Foam::SLGThermo::TypeName
TypeName("SLGThermo")
Runtime type information.
Foam::SLGThermo::writeData
bool writeData(Foam::Ostream &) const
Pure virtual writeData function.
Definition: SLGThermo.H:153
Foam::SLGThermo::liquids
const liquidMixtureProperties & liquids() const
Return reference to the global (additional) liquids.
Definition: SLGThermo.C:124
Foam::SLGThermo::carrier
const basicSpecieMixture & carrier() const
Return reference to the gaseous components.
Definition: SLGThermo.C:111
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::SLGThermo::liquidId
label liquidId(const word &cmptName, bool allowNotFound=false) const
Index of liquid component.
Definition: SLGThermo.C:177
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::regIOobject
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:73
solidMixtureProperties.H
Foam::liquidMixtureProperties
A mixture of liquids.
Definition: liquidMixtureProperties.H:68
Foam::SLGThermo::carrierId
label carrierId(const word &cmptName, bool allowNotFound=false) const
Index of carrier component.
Definition: SLGThermo.C:151
Foam::SLGThermo::hasLiquids
bool hasLiquids() const
Thermo database has liquid components flag.
Definition: SLGThermo.C:232
Foam::SLGThermo::SLGThermo
SLGThermo(const fvMesh &mesh, fluidThermo &thermo)
Construct from mesh.
Definition: SLGThermo.C:41
Foam::SLGThermo::hasSolids
bool hasSolids() const
Thermo database has solid components flag.
Definition: SLGThermo.C:238
Foam::SLGThermo::solidId
label solidId(const word &cmptName, bool allowNotFound=false) const
Index of solid component.
Definition: SLGThermo.C:202
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
basicSpecieMixture.H
liquidMixtureProperties.H