constantThermophysicalFunction.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2019-2020 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::thermophysicalFunctions::constant
26 
27 Description
28  Constant property function.
29 
30 Usage
31  \constant
32  Property | Description
33  value | Constant property value
34  \endconstant
35 
36  Example for the density of water between 280 and 350K
37  \verbatim
38  rho
39  {
40  type constant;
41  value 999.87;
42  }
43  \endverbatim
44 
45 \*---------------------------------------------------------------------------*/
46 
47 #ifndef constantThermophysicalFunction_H
48 #define constantThermophysicalFunction_H
49 
50 #include "thermophysicalFunction.H"
51 
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 
54 namespace Foam
55 {
56 namespace thermophysicalFunctions
57 {
58 
59 /*---------------------------------------------------------------------------*\
60  Class constant Declaration
61 \*---------------------------------------------------------------------------*/
62 
63 class constant
64 :
66 {
67  // Private member data
68 
69  //- Constant value
70  scalar value_;
71 
72 
73 public:
74 
75  //- Runtime type information
76  TypeName("constant");
77 
78 
79  // Constructors
80 
81  //- Construct from dictionary
82  constant(const dictionary& dict);
83 
84 
85  // Member Functions
86 
87  //- Evaluate the function and return the result
88  scalar f(scalar p, scalar T) const;
89 
90  //- Write the function coefficients
91  void write(Ostream& os) const;
92 };
93 
94 
95 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
96 
97 } // End namespace thermophysicalFunctions
98 } // End namespace Foam
99 
100 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
101 
102 #endif
103 
104 // ************************************************************************* //
dictionary dict
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
scalar f(scalar p, scalar T) const
Evaluate the function and return the result.
Abstract base class for thermo-physical functions.
void write(Ostream &os) const
Write the function coefficients.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
constant(const dictionary &dict)
Construct from dictionary.
TypeName("constant")
Runtime type information.
volScalarField & p
Namespace for OpenFOAM.