integratedNonUniformTable1.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-2021 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::Function1s::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  \table
37  Property | Description
38  values | List of value pairs
39  \endtable
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 integratedNonUniformTable1_H
59 #define integratedNonUniformTable1_H
60 
61 #include "NonUniformTable1.H"
62 
63 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64 
65 namespace Foam
66 {
67 namespace Function1s
68 {
69 
70 /*---------------------------------------------------------------------------*\
71  Class integratedNonUniformTable Declaration
72 \*---------------------------------------------------------------------------*/
73 
74 class integratedNonUniformTable
75 :
76  public NonUniformTable<scalar>
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 
97  // Member Functions
98 
99  //- Integrate the function and return the result
100  scalar intfdT(scalar T) const;
101 
102  //- Integrate the function divided by T and return the result
103  scalar intfByTdT(scalar T) const;
104 
105  //- Write the function coefficients
106  void write(Ostream& os) const;
107 };
108 
109 
110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
111 
112 } // End namespace Function1s
113 } // End namespace Foam
114 
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 
117 #endif
118 
119 // ************************************************************************* //
TypeName("integratedNonUniformTable")
Runtime type information.
const word const dictionary & dict
Definition: Function1.H:84
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
const word & name() const
Return the name of the entry.
void write(Ostream &os) const
Write the function coefficients.
A class for handling words, derived from string.
Definition: word.H:59
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)
scalar intfByTdT(scalar T) const
Integrate the function divided by T and return the result.
scalar intfdT(scalar T) const
Integrate the function and return the result.
integratedNonUniformTable(const word &name, const dictionary &dict)
Construct from entry name and dictionary.
Namespace for OpenFOAM.