SLGThermo.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2018 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 Class
25  Foam::SLGThermo
26 
27 Description
28  Thermo package for (S)olids (L)iquids and (G)ases
29  Takes reference to thermo package, and provides:
30  - carrier : components of thermo - access to elemental properties
31  - liquids : liquid components - access to elemental properties
32  - solids : solid components - access to elemental properties
33 
34  If thermo is not a multi-component thermo package, carrier is nullptr.
35  Similarly, if no liquids or solids are specified, their respective
36  pointers will also be nullptr.
37 
38  Registered to the mesh so that it can be looked-up
39 
40 SourceFiles
41  SLGThermo.C
42 
43 \*---------------------------------------------------------------------------*/
44 
45 #ifndef SLGThermo_H
46 #define SLGThermo_H
47 
48 #include "regIOobject.H"
49 #include "fluidThermo.H"
50 #include "basicSpecieMixture.H"
52 #include "solidMixtureProperties.H"
53 
54 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55 
56 namespace Foam
57 {
58 
59 /*---------------------------------------------------------------------------*\
60  Class SLGThermo Declaration
61 \*---------------------------------------------------------------------------*/
62 
63 class SLGThermo
64 :
65  public regIOobject
66 {
67  // Private data
68 
69  //- Thermo package
70  fluidThermo& thermo_;
71 
72  //- Reference to the multi-component carrier phase thermo
73  basicSpecieMixture* carrier_;
74 
75  //- Additional liquid properties data
77 
78  //- Additional solid properties data
80 
81 
82 public:
83 
84  //- Runtime type information
85  TypeName("SLGThermo");
86 
87  // Constructors
88 
89  //- Construct from mesh
91 
92 
93  //- Destructor
94  virtual ~SLGThermo();
95 
96 
97  // Member Functions
98 
99  // Access
100 
101  //- Return reference to the thermo database
102  const fluidThermo& thermo() const;
103 
104  //- Return reference to the gaseous components
105  const basicSpecieMixture& carrier() const;
106 
107  //- Return reference to the global (additional) liquids
108  const liquidMixtureProperties& liquids() const;
109 
110  //- Return reference to the global (additional) solids
111  const solidMixtureProperties& solids() const;
112 
113 
114  // Index retrieval
115 
116  //- Index of carrier component
118  (
119  const word& cmptName,
120  bool allowNotFound = false
121  ) const;
122 
123  //- Index of liquid component
125  (
126  const word& cmptName,
127  bool allowNotFound = false
128  ) const;
129 
130  //- Index of solid component
131  label solidId
132  (
133  const word& cmptName,
134  bool allowNotFound = false
135  ) const;
136 
137 
138  // Checks
139 
140  //- Thermo database has multi-component carrier flag
141  bool hasMultiComponentCarrier() const;
142 
143  //- Thermo database has liquid components flag
144  bool hasLiquids() const;
145 
146  //- Thermo database has solid components flag
147  bool hasSolids() const;
148 
149 
150  // IO
152  bool writeData(Foam::Ostream&) const
153  {
154  return true;
155  }
156 };
157 
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 } // End namespace Foam
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 #endif
166 
167 // ************************************************************************* //
bool hasSolids() const
Thermo database has solid components flag.
Definition: SLGThermo.C:235
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
virtual ~SLGThermo()
Destructor.
Definition: SLGThermo.C:96
TypeName("SLGThermo")
Runtime type information.
bool hasMultiComponentCarrier() const
Thermo database has multi-component carrier flag.
Definition: SLGThermo.C:223
Specialization of basicMultiComponentMixture for a mixture consisting of a number for molecular speci...
const solidMixtureProperties & solids() const
Return reference to the global (additional) solids.
Definition: SLGThermo.C:134
bool writeData(Foam::Ostream &) const
Pure virtual writaData function.
Definition: SLGThermo.H:151
dynamicFvMesh & mesh
A class for handling words, derived from string.
Definition: word.H:59
Fundamental fluid thermodynamic properties.
Definition: fluidThermo.H:49
const liquidMixtureProperties & liquids() const
Return reference to the global (additional) liquids.
Definition: SLGThermo.C:121
Thermo package for (S)olids (L)iquids and (G)ases Takes reference to thermo package, and provides:
Definition: SLGThermo.H:62
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
const basicSpecieMixture & carrier() const
Return reference to the gaseous components.
Definition: SLGThermo.C:108
label liquidId(const word &cmptName, bool allowNotFound=false) const
Index of liquid component.
Definition: SLGThermo.C:174
label carrierId(const word &cmptName, bool allowNotFound=false) const
Index of carrier component.
Definition: SLGThermo.C:148
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:65
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
bool hasLiquids() const
Thermo database has liquid components flag.
Definition: SLGThermo.C:229
SLGThermo(const fvMesh &mesh, fluidThermo &thermo)
Construct from mesh.
Definition: SLGThermo.C:38
Namespace for OpenFOAM.
label solidId(const word &cmptName, bool allowNotFound=false) const
Index of solid component.
Definition: SLGThermo.C:199
const fluidThermo & thermo() const
Return reference to the thermo database.
Definition: SLGThermo.C:102