All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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-2019 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  //- Thermal conductivity [W/m/K]
150  inline scalar kappa() const;
151 
152  //- Heat of formation [J/kg]
153  inline scalar Hf() const;
154 
155  //- Sensible enthalpy - reference to Tstd [J/kg]
156  inline scalar Hs(const scalar T) const;
157 
158  //- Emissivity []
159  inline scalar emissivity() const;
160 
161 
162  // I-O
163 
164  //- Read and set the properties present it the given dictionary
165  void readIfPresent(const dictionary& dict);
166 
167  //- Write the solidProperties properties
168  virtual void write(Ostream& os) const;
169 
170  //- Ostream Operator
171  friend Ostream& operator<<(Ostream& os, const solidProperties& s);
172 };
173 
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 } // End namespace Foam
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 #include "solidPropertiesI.H"
182 
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 
185 #endif
186 
187 // ************************************************************************* //
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:158
virtual ~solidProperties()
Destructor.
virtual void write(Ostream &os) const
Write the solidProperties properties.
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].
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.
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 - reference to Tstd [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.