solidProperties.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 | Copyright (C) 2011 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 class solidProperties;
49 
50 Ostream& operator<<
51 (
52  Ostream&,
53  const solidProperties&
54 );
55 
56 
57 /*---------------------------------------------------------------------------*\
58  Class solidProperties Declaration
59 \*---------------------------------------------------------------------------*/
60 
61 class solidProperties
62 {
63 
64  // Private data
65 
66  //- Density [kg/m3]
67  scalar rho_;
68 
69  //- Specific heat capacity [J/(kg.K)]
70  scalar Cp_;
71 
72  //- Thermal conductivity [W/(m.K)]
73  scalar K_;
74 
75  //- Heat of formation [J/kg]
76  scalar Hf_;
77 
78  //- Emissivity
79  scalar emissivity_;
80 
81 
82 public:
83 
84  //- Runtime type information
85  TypeName("solidProperties");
86 
87 
88  // Declare run-time constructor selection tables
89 
91  (
92  autoPtr,
94  ,
95  (),
96  ()
97  );
98 
100  (
101  autoPtr,
103  Istream,
104  (Istream& is),
105  (is)
106  );
107 
109  (
110  autoPtr,
112  dictionary,
113  (const dictionary& dict),
114  (dict)
115  );
116 
117 
118  // Constructors
119 
120  //- Construct from components
122  (
123  scalar rho,
124  scalar Cp,
125  scalar K,
126  scalar Hf,
127  scalar emissivity
128  );
129 
130  //- Construct from Istream
132 
133  //- Construct from dictionary
134  solidProperties(const dictionary& dict);
135 
136  //- Construct copy
138 
139  //- Construct and return clone
140  virtual autoPtr<solidProperties> clone() const
141  {
142  return autoPtr<solidProperties>(new solidProperties(*this));
143  }
144 
145 
146  // Selectors
147 
148  //- Return a pointer to a new solidProperties created from input
150 
151  //- Return a pointer to a new solidProperties created from dictionary
152  static autoPtr<solidProperties> New(const dictionary& dict);
153 
154 
155  //- Destructor
156  virtual ~solidProperties()
157  {}
158 
159 
160  // Member Functions
161 
162  // Physical constants which define the solidProperties
163 
164  //- Density [kg/m3]
165  inline scalar rho() const;
166 
167  //- Specific heat capacity [J/(kg.K)]
168  inline scalar Cp() const;
169 
170  //- Thermal conductivity [W/(m.K)]
171  inline scalar K() const;
172 
173  //- Heat of formation [J/kg]
174  inline scalar Hf() const;
175 
176  //- Sensible enthalpy - reference to Tstd [J/kg]
177  inline scalar Hs(const scalar T) const;
178 
179  //- Emissivity []
180  inline scalar emissivity() const;
181 
182 
183  // I-O
184 
185  //- Write the solidProperties properties
186  virtual void writeData(Ostream& os) const;
187 
188 
189  // Ostream Operator
190 
191  friend Ostream& operator<<(Ostream& os, const solidProperties& s);
192 };
193 
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 } // End namespace Foam
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 #include "solidPropertiesI.H"
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 #endif
206 
207 // ************************************************************************* //
scalar Hf() const
Heat of formation [J/kg].
dictionary dict
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
virtual ~solidProperties()
Destructor.
scalar emissivity() const
Emissivity [].
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
static autoPtr< solidProperties > New(Istream &is)
Return a pointer to a new solidProperties created from input.
CGAL::Exact_predicates_exact_constructions_kernel K
TypeName("solidProperties")
Runtime type information.
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))
solidProperties(scalar rho, scalar Cp, scalar K, scalar Hf, scalar emissivity)
Construct from components.
virtual void writeData(Ostream &os) const
Write the solidProperties properties.
friend Ostream & operator<<(Ostream &os, const solidProperties &s)
scalar Hs(const scalar T) const
Sensible enthalpy - reference to Tstd [J/kg].
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
virtual autoPtr< solidProperties > clone() const
Construct and return clone.
scalar Cp() const
Specific heat capacity [J/(kg.K)].
declareRunTimeSelectionTable(autoPtr, solidProperties,,(),())
The thermophysical properties of a solid.
scalar K() const
Thermal conductivity [W/(m.K)].
scalar rho() const
Density [kg/m3].
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:53
Macros to ease declaration of run-time selection tables.
Namespace for OpenFOAM.