FreeFOAM The Cross-Platform CFD Toolkit
solid.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) 1991-2010 OpenCFD Ltd.
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::solid
26 
27 Description
28  The thermophysical properties of a solid
29 
30 SourceFiles
31  solid.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef solid_H
36 #define solid_H
37 
38 #include <OpenFOAM/typeInfo.H>
39 #include <OpenFOAM/autoPtr.H>
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 class solid;
48 
49 Ostream& operator<<
50 (
51  Ostream&,
52  const solid&
53 );
54 
55 
56 /*---------------------------------------------------------------------------*\
57  Class solid Declaration
58 \*---------------------------------------------------------------------------*/
59 
60 class solid
61 {
62 
63  // Private data
64 
65  //- Density [kg/m3]
66  scalar rho_;
67 
68  //- Specific heat capacity [J/(kg.K)]
69  scalar cp_;
70 
71  //- Thermal conductivity [W/(m.K)]
72  scalar K_;
73 
74  //- Heat of formation [J/kg]
75  scalar Hf_;
76 
77  //- Emissivity
78  scalar emissivity_;
79 
80 
81 public:
82 
83  //- Runtime type information
84  TypeName("solid");
85 
86 
87  // Declare run-time constructor selection tables
88 
90  (
91  autoPtr,
92  solid,
93  ,
94  (),
95  ()
96  );
97 
99  (
100  autoPtr,
101  solid,
102  Istream,
103  (Istream& is),
104  (is)
105  );
106 
107 
108  // Constructors
109 
110  //- Construct from components
111  solid
112  (
113  scalar rho,
114  scalar cp,
115  scalar K,
116  scalar Hf,
117  scalar emissivity
118  );
119 
120  //- Construct from Istream
121  solid(Istream& is);
122 
123  //- Return a pointer to a new solid created from input
124  static autoPtr<solid> New(Istream& is);
125 
126 
127  // Destructor
128 
129  virtual ~solid()
130  {}
131 
132 
133  // Member Functions
134 
135  // Phisical constants which define the solid
136 
137  //- Density [kg/m3]
138  inline scalar rho() const;
139 
140  //- Specific heat capacity [J/(kg.K)]
141  inline scalar cp() const;
142 
143  //- Thermal conductivity [W/(m.K)]
144  inline scalar K() const;
145 
146  //- Heat of formation [J/kg]
147  inline scalar Hf() const;
148 
149  //- Emissivity []
150  inline scalar emissivity() const;
151 
152 
153  // I-O
154 
155  //- Write the solid properties
156  virtual void writeData(Ostream& os) const;
157 
158 
159  // Ostream Operator
160 
161  friend Ostream& operator<<(Ostream& os, const solid& s);
162 };
163 
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 #include "solidI.H"
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 } // End namespace Foam
172 
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 
175 #endif
176 
177 // ************************ vim: set sw=4 sts=4 et: ************************ //