integratedNonUniformTableThermophysicalFunction.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) 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::integratedNonUniformTable
26 
27 Description
28  Non-uniform tabulated property function that linearly interpolates between
29  the values.
30 
31  To speed-up the search of the non-uniform table a uniform jump-table is
32  created on construction which is used for fast indirect addressing into
33  the table.
34 
35 Usage
36  \integratedNonUniformTable
37  Property | Description
38  values | List of (temperature property) value pairs
39  \endintegratedNonUniformTable
40 
41  Example for the density of water between 280 and 350K
42  \verbatim
43  rho
44  {
45  type integratedNonUniformTable;
46 
47  values
48  (
49  (280 999.87)
50  (300 995.1)
51  (350 973.7)
52  );
53  }
54  \endverbatim
55 
56 \*---------------------------------------------------------------------------*/
57 
58 #ifndef integratedNonUniformTableThermophysicalFunction_H
59 #define integratedNonUniformTableThermophysicalFunction_H
60 
62 
63 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64 
65 namespace Foam
66 {
67 namespace thermophysicalFunctions
68 {
69 
70 /*---------------------------------------------------------------------------*\
71  Class integratedNonUniformTable Declaration
72 \*---------------------------------------------------------------------------*/
73 
75 :
76  public nonUniformTable
77 {
78  // Private member data
79 
80  List<scalar> intf_;
81 
82  List<scalar> intfByT_;
83 
84 
85 public:
86 
87  //- Runtime type information
88  TypeName("integratedNonUniformTable");
89 
90 
91  // Constructors
92 
93  //- Construct from entry name and dictionary
95 
96  //- Construct from dictionary
98 
99 
100  // Member Functions
101 
102  //- Integrate the function and return the result
103  scalar intfdT(scalar p, scalar T) const;
104 
105  //- Integrate the function divided by T and return the result
106  scalar intfByTdT(scalar p, scalar T) const;
107 
108  //- Write the function coefficients
109  void write(Ostream& os) const;
110 };
111 
112 
113 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114 
115 } // End namespace thermophysicalFunctions
116 } // End namespace Foam
117 
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119 
120 #endif
121 
122 // ************************************************************************* //
scalar intfdT(scalar p, scalar T) const
Integrate the function and return the result.
dictionary dict
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
integratedNonUniformTable(const word &name, const dictionary &dict)
Construct from entry name and dictionary.
TypeName("integratedNonUniformTable")
Runtime type information.
scalar intfByTdT(scalar p, scalar T) const
Integrate the function divided by T and return the result.
A class for handling words, derived from string.
Definition: word.H:59
Non-uniform tabulated property function that linearly interpolates between the values.
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)
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
Non-uniform tabulated property function that linearly interpolates between the values.
volScalarField & p
Namespace for OpenFOAM.