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 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::solidProperties
29 
30 Description
31  The thermophysical properties of a solid
32 
33 SourceFiles
34  solidProperties.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef solidProperties_H
39 #define solidProperties_H
40 
41 #include "typeInfo.H"
42 #include "autoPtr.H"
43 #include "runTimeSelectionTables.H"
44 #include "dictionary.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class solidProperties Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 class solidProperties
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 
84 public:
85 
86  //- Runtime type information
87  TypeName("solid");
88 
89 
90  // Declare run-time constructor selection tables
91 
93  (
94  autoPtr,
96  ,
97  (),
98  ()
99  );
100 
102  (
103  autoPtr,
105  dictionary,
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 
194 Ostream& operator<<(Ostream&, const solidProperties&);
195 
196 
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 
199 } // End namespace Foam
200 
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 
203 #include "solidPropertiesI.H"
204 
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 
207 #endif
208 
209 // ************************************************************************* //
Foam::autoPtr::New
static autoPtr< T > New(Args &&... args)
Construct autoPtr of T with forwarding arguments.
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
s
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))
Definition: gmvOutputSpray.H:25
typeInfo.H
Foam::solidProperties::writeData
virtual void writeData(Ostream &os) const
Write the solidProperties properties.
Definition: solidProperties.C:94
Foam::solidProperties::New
static autoPtr< solidProperties > New(const word &name)
Return a pointer to a new solidProperties created from name.
Definition: solidPropertiesNew.C:35
Foam::solidProperties
The thermophysical properties of a solid.
Definition: solidProperties.H:54
Foam::solidProperties::Hf
scalar Hf() const
Heat of formation [J/kg].
Definition: solidPropertiesI.H:51
Foam::solidProperties::emissivity
scalar emissivity() const
Emissivity [].
Definition: solidPropertiesI.H:63
Foam::solidProperties::rho
scalar rho() const
Density [kg/m3].
Definition: solidPropertiesI.H:33
Foam::solidProperties::~solidProperties
virtual ~solidProperties()=default
Destructor.
Foam::solidProperties::E
scalar E() const
Young modulus [N/m2].
Definition: solidPropertiesI.H:81
Foam::operator<<
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
Foam::solidProperties::readIfPresent
void readIfPresent(const dictionary &dict)
Read and set the properties if present in the given dictionary.
Definition: solidProperties.C:81
Foam::solidProperties::nu
scalar nu() const
Poissons.
Definition: solidPropertiesI.H:75
Foam::solidProperties::Hs
scalar Hs(const scalar T) const
Sensible enthalpy - reference to Tstd [J/kg].
Definition: solidPropertiesI.H:57
Foam::solidProperties::operator<<
friend Ostream & operator<<(Ostream &os, const solidProperties &s)
Ostream Operator.
Foam::solidProperties::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, solidProperties,,(),())
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:58
solidPropertiesI.H
Foam::solidProperties::kappa
scalar kappa() const
Thermal conductivity [W/(m.K)].
Definition: solidPropertiesI.H:45
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::solidProperties::solidProperties
solidProperties(scalar rho, scalar Cp, scalar kappa, scalar Hf, scalar emissivity, scalar W, scalar nu, scalar E)
Construct from components.
Definition: solidProperties.C:44
os
OBJstream os(runTime.globalPath()/outputName)
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
dictionary.H
Foam::solidProperties::W
scalar W() const
Molar weight [Kg/Kmol].
Definition: solidPropertiesI.H:69
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::solidProperties::clone
virtual autoPtr< solidProperties > clone() const
Construct and return clone.
Definition: solidProperties.H:129
Foam::solidProperties::Cp
scalar Cp() const
Specific heat capacity [J/(kg.K)].
Definition: solidPropertiesI.H:39
Foam::solidProperties::TypeName
TypeName("solid")
Runtime type information.
autoPtr.H