FreeFOAM The Cross-Platform CFD Toolkit
hsPsiThermo.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) 2010-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::hsPsiThermo
26 
27 Description
28  Sensible enthalpy for a mixture based on compressibility
29 
30 SourceFiles
31  hsPsiThermo.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef hsPsiThermo_H
36 #define hsPsiThermo_H
37 
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class hsPsiThermo Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 template<class MixtureType>
52 :
53  public basicPsiThermo,
54  public MixtureType
55 {
56  // Private data
57 
58  //- Sensible enthalpy field [J/kg]
59  volScalarField hs_;
60 
61 
62  // Private member functions
63 
64  //- Calculate the thermo variables
65  void calculate();
66 
67  //- Construct as copy (not implemented)
69 
70 
71 public:
72 
73  //- Runtime type information
74  TypeName("hsPsiThermo");
75 
76 
77  // Constructors
78 
79  //- Construct from mesh
80  hsPsiThermo(const fvMesh&);
81 
82 
83  //- Destructor
84  virtual ~hsPsiThermo();
85 
86 
87  // Member functions
88 
89  //- Return the compostion of the mixture
91  {
92  return *this;
93  }
94 
95  //- Return the compostion of the mixture
96  virtual const basicMixture& composition() const
97  {
98  return *this;
99  }
100 
101  //- Update properties
102  virtual void correct();
103 
104 
105  // Access to thermodynamic state variables
106 
107  //- Sensible enthalpy [J/kg]
108  // Non-const access allowed for transport equations
109  virtual volScalarField& hs()
110  {
111  return hs_;
112  }
113 
114  //- Sensible enthalpy [J/kg]
115  virtual const volScalarField& hs() const
116  {
117  return hs_;
118  }
119 
120 
121  // Fields derived from thermodynamic state variables
122 
123  //- Enthalpy for cell-set [J/kg]
124  virtual tmp<scalarField> hs
125  (
126  const scalarField& T,
127  const labelList& cells
128  ) const;
129 
130  //- Enthalpy for patch [J/kg]
131  virtual tmp<scalarField> hs
132  (
133  const scalarField& T,
134  const label patchi
135  ) const;
136 
137  //- Heat capacity at constant pressure for patch [J/kg/K]
138  virtual tmp<scalarField> Cp
139  (
140  const scalarField& T,
141  const label patchi
142  ) const;
143 
144  //- Heat capacity at constant pressure [J/kg/K]
145  virtual tmp<volScalarField> Cp() const;
146 
147  //- Heat capacity at constant volume for patch [J/kg/K]
148  virtual tmp<scalarField> Cv
149  (
150  const scalarField& T,
151  const label patchi
152  ) const;
153 
154  //- Heat capacity at constant volume [J/kg/K]
155  virtual tmp<volScalarField> Cv() const;
156 
157 
158  //- Read thermophysicalProperties dictionary
159  virtual bool read();
160 };
161 
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 } // End namespace Foam
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
168 
169 #ifdef NoRepository
170 # include "hsPsiThermo.C"
171 #endif
172 
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 
175 #endif
176 
177 // ************************ vim: set sw=4 sts=4 et: ************************ //