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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2017 OpenFOAM Foundation
9 Copyright (C) 2018-2019 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::solidProperties
29
30Description
31 The thermophysical properties of a solid
32
33SourceFiles
34 solidProperties.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef solidProperties_H
39#define solidProperties_H
40
41#include "typeInfo.H"
42#include "autoPtr.H"
44#include "dictionary.H"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
50
51/*---------------------------------------------------------------------------*\
52 Class solidProperties Declaration
53\*---------------------------------------------------------------------------*/
56{
57 // Private Data
58
59 //- Density [kg/m3]
60 scalar rho_;
61
62 //- Specific heat capacity [J/(kg.K)]
63 scalar Cp_;
64
65 //- Thermal conductivity [W/(m.K)]
66 scalar kappa_;
67
68 //- Heat of formation [J/kg]
69 scalar Hf_;
70
71 //- Emissivity
72 scalar emissivity_;
73
74 //- Molar weight [Kg/Kmol]
75 scalar W_;
76
77 //- Poisson ration
78 scalar nu_;
79
80 //- Young Modulus [N/m2]
81 scalar E_;
82
83
84public:
85
86 //- Runtime type information
87 TypeName("solid");
88
89
90 // Declare run-time constructor selection tables
93 (
94 autoPtr,
96 ,
97 (),
98 ()
99 );
102 (
103 autoPtr,
106 (const dictionary& dict),
107 (dict)
108 );
109
110
111 // Constructors
112
113 //- Construct from components
115 (
116 scalar rho,
117 scalar Cp,
118 scalar kappa,
119 scalar Hf,
120 scalar emissivity,
121 scalar W,
122 scalar nu,
123 scalar E
124 );
125
126 //- Construct from dictionary
128
129 //- Construct and return clone
130 virtual autoPtr<solidProperties> clone() const
131 {
132 return autoPtr<solidProperties>::New(*this);
133 }
134
135
136 // Selectors
137
138 //- Return a pointer to a new solidProperties created from name
139 static autoPtr<solidProperties> New(const word& name);
140
141 //- Return a pointer to a new solidProperties created from dictionary
143
144
145 //- Destructor
146 virtual ~solidProperties() = default;
147
148
149 // Member Functions
150
151 // Physical constants which define the solidProperties
152
153 //- Density [kg/m3]
154 inline scalar rho() const;
155
156 //- Specific heat capacity [J/(kg.K)]
157 inline scalar Cp() const;
158
159 //- Thermal conductivity [W/(m.K)]
160 inline scalar kappa() const;
161
162 //- Heat of formation [J/kg]
163 inline scalar Hf() const;
164
165 //- Sensible enthalpy - reference to Tstd [J/kg]
166 inline scalar Hs(const scalar T) const;
167
168 //- Emissivity []
169 inline scalar emissivity() const;
170
171 //- Molar weight [Kg/Kmol]
172 inline scalar W() const;
173
174 //- Poissons
175 inline scalar nu() const;
176
177 //- Young modulus [N/m2]
178 inline scalar E() const;
179
180
181 // I-O
182
183 //- Read and set the properties if present in the given dictionary
184 void readIfPresent(const dictionary& dict);
185
186 //- Write the solidProperties properties
187 virtual void writeData(Ostream& os) const;
188
189 //- Ostream Operator
190 friend Ostream& operator<<(Ostream& os, const solidProperties& s);
191};
192
193
195
196
197// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198
199} // End namespace Foam
200
201// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202
203#include "solidPropertiesI.H"
204
205// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206
207#endif
208
209// ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: Time.C:717
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
The thermophysical properties of a solid.
scalar Cp() const
Specific heat capacity [J/(kg.K)].
scalar kappa() const
Thermal conductivity [W/(m.K)].
scalar Hf() const
Heat of formation [J/kg].
virtual ~solidProperties()=default
Destructor.
static autoPtr< solidProperties > New(const word &name)
Return a pointer to a new solidProperties created from name.
scalar Hs(const scalar T) const
Sensible enthalpy - reference to Tstd [J/kg].
virtual void writeData(Ostream &os) const
Write the solidProperties properties.
scalar E() const
Young modulus [N/m2].
scalar nu() const
Poissons.
TypeName("solid")
Runtime type information.
scalar rho() const
Density [kg/m3].
declareRunTimeSelectionTable(autoPtr, solidProperties, dictionary,(const dictionary &dict),(dict))
scalar W() const
Molar weight [Kg/Kmol].
friend Ostream & operator<<(Ostream &os, const solidProperties &s)
Ostream Operator.
virtual autoPtr< solidProperties > clone() const
Construct and return clone.
scalar emissivity() const
Emissivity [].
declareRunTimeSelectionTable(autoPtr, solidProperties,,(),())
void readIfPresent(const dictionary &dict)
Read and set the properties if present in the given dictionary.
A class for handling words, derived from Foam::string.
Definition: word.H:68
OBJstream os(runTime.globalPath()/outputName)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.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))
Namespace for OpenFOAM.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73