solidProperties.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-2021 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::solidProperties
26 
27 Description
28  The thermophysical properties of a solid
29 
30 SourceFiles
31  solidProperties.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef solidProperties_H
36 #define solidProperties_H
37 
38 #include "typeInfo.H"
39 #include "autoPtr.H"
40 #include "runTimeSelectionTables.H"
41 #include "dictionary.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 // Forward declaration of friend functions and operators
49 class solidProperties;
50 Ostream& operator<<(Ostream&, const solidProperties&);
51 
52 /*---------------------------------------------------------------------------*\
53  Class solidProperties Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 class solidProperties
57 {
58  // Private Data
59 
60  //- Density [kg/m^3]
61  scalar rho_;
62 
63  //- Specific heat capacity [J/kg/K]
64  scalar Cp_;
65 
66  //- Thermal conductivity [W/m/K]
67  scalar kappa_;
68 
69  //- Heat of formation [J/kg]
70  scalar Hf_;
71 
72  //- Emissivity
73  scalar emissivity_;
74 
75 
76 public:
77 
78  //- Runtime type information
79  TypeName("solid");
80 
81 
82  // Declare run-time constructor selection tables
83 
85  (
86  autoPtr,
88  ,
89  (),
90  ()
91  );
92 
94  (
95  autoPtr,
97  dictionary,
98  (const dictionary& dict),
99  (dict)
100  );
101 
102 
103  // Constructors
104 
105  //- Construct from components
107  (
108  scalar rho,
109  scalar Cp,
110  scalar kappa,
111  scalar Hf,
112  scalar emissivity
113  );
114 
115  //- Construct from dictionary
116  solidProperties(const dictionary& dict);
117 
118  //- Construct and return clone
119  virtual autoPtr<solidProperties> clone() const
120  {
121  return autoPtr<solidProperties>(new solidProperties(*this));
122  }
123 
124 
125  // Selectors
126 
127  //- Return a pointer to a new solidProperties created from name
128  static autoPtr<solidProperties> New(const word& name);
129 
130  //- Return a pointer to a new solidProperties created from dictionary
131  static autoPtr<solidProperties> New(const dictionary& dict);
132 
133 
134  //- Destructor
135  virtual ~solidProperties()
136  {}
137 
138 
139  // Member Functions
140 
141  // Physical constants which define the solidProperties
142 
143  //- Density [kg/m^3]
144  inline scalar rho() const;
145 
146  //- Specific heat capacity [J/kg/K]
147  inline scalar Cp() const;
148 
149  //- Heat of formation [J/kg]
150  inline scalar Hf() const;
151 
152  //- Sensible enthalpy [J/kg]
153  inline scalar Hs(const scalar T) const;
154 
155  //- Absolute enthalpy [J/kg]
156  inline scalar Ha(scalar T) const;
157 
158  //- Sensible internal energy [J/kg]
159  inline scalar Es(const scalar T) const;
160 
161  //- Absolute internal energy [J/kg]
162  inline scalar Ea(scalar T) const;
163 
164  //- Thermal conductivity [W/m/K]
165  inline scalar kappa() const;
166 
167  //- Emissivity []
168  inline scalar emissivity() const;
169 
170 
171  // I-O
172 
173  //- Read and set the properties present it the given dictionary
174  void readIfPresent(const dictionary& dict);
175 
176  //- Write the solidProperties properties
177  virtual void write(Ostream& os) const;
178 
179  //- Ostream Operator
180  friend Ostream& operator<<(Ostream& os, const solidProperties& s);
181 };
182 
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
186 } // End namespace Foam
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 #include "solidPropertiesI.H"
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 #endif
195 
196 // ************************************************************************* //
solidProperties(scalar rho, scalar Cp, scalar kappa, scalar Hf, scalar emissivity)
Construct from components.
dictionary dict
scalar Cp() const
Specific heat capacity [J/kg/K].
scalar rho() const
Density [kg/m^3].
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
virtual ~solidProperties()
Destructor.
virtual void write(Ostream &os) const
Write the solidProperties properties.
scalar Ha(scalar T) const
Absolute enthalpy [J/kg].
scalar emissivity() const
Emissivity [].
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
A class for handling words, derived from string.
Definition: word.H:59
scalar Hf() const
Heat of formation [J/kg].
scalar Ea(scalar T) const
Absolute internal energy [J/kg].
void readIfPresent(const dictionary &dict)
Read and set the properties present it the given dictionary.
friend Ostream & operator<<(Ostream &os, const solidProperties &s)
Ostream Operator.
scalar Es(const scalar T) const
Sensible internal energy [J/kg].
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
virtual autoPtr< solidProperties > clone() const
Construct and return clone.
scalar kappa() const
Thermal conductivity [W/m/K].
scalar Hs(const scalar T) const
Sensible enthalpy [J/kg].
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
TypeName("solid")
Runtime type information.
declareRunTimeSelectionTable(autoPtr, solidProperties,,(),())
The thermophysical properties of a solid.
Ostream & operator<<(Ostream &, const ensightPart &)
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Macros to ease declaration of run-time selection tables.
static autoPtr< solidProperties > New(const word &name)
Return a pointer to a new solidProperties created from name.
Namespace for OpenFOAM.