barotropicCompressibilityModel.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) 2011 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 Namespace
25  Foam::compressibilityModels
26 
27 Description
28  Namespace for compressibility models.
29 
30 
31 Class
32  Foam::barotropicCompressibilityModel
33 
34 Description
35  Abstract class for barotropic compressibility models
36 
37 SourceFiles
38  barotropicCompressibilityModel.C
39  newbarotropicCompressibilityModel.C
40 
41 \*---------------------------------------------------------------------------*/
42 
43 #ifndef barotropicCompressibilityModel_H
44 #define barotropicCompressibilityModel_H
45 
46 #include "IOdictionary.H"
47 #include "typeInfo.H"
48 #include "runTimeSelectionTables.H"
49 #include "volFields.H"
50 #include "dimensionedScalar.H"
51 #include "autoPtr.H"
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 namespace Foam
56 {
57 
58 /*---------------------------------------------------------------------------*\
59  Class barotropicCompressibilityModel Declaration
60 \*---------------------------------------------------------------------------*/
61 
63 {
64 
65 protected:
66 
67  // Protected data
68 
70 
72  const volScalarField& gamma_;
73 
74 
75  // Private Member Functions
76 
77  //- Disallow copy construct
79 
80  //- Disallow default bitwise assignment
82 
83 
84 public:
85 
86  //- Runtime type information
87  TypeName("barotropicCompressibilityModel");
88 
89 
90  // Declare run-time constructor selection table
91 
93  (
94  autoPtr,
96  dictionary,
97  (
99  const volScalarField& gamma,
100  const word& psiName
101  ),
102  (compressibilityProperties, gamma, psiName)
103  );
104 
105 
106  // Selectors
107 
108  //- Return a reference to the selected compressibility model
110  (
111  const dictionary& compressibilityProperties,
112  const volScalarField& gamma,
113  const word& psiName = "psi"
114  );
115 
116 
117  // Constructors
118 
119  //- Construct from components
121  (
122  const dictionary& compressibilityProperties,
123  const volScalarField& gamma,
124  const word& psiName = "psi"
125  );
126 
127 
128  //- Destructor
130  {}
131 
132 
133  // Member Functions
134 
135  //- Return the phase transport properties dictionary
137  {
139  }
140 
141  //- Return the compressibility
142  const volScalarField& psi() const
143  {
144  return psi_;
145  }
146 
147  //- Correct the compressibility
148  virtual void correct() = 0;
149 
150  //- Read compressibilityProperties dictionary
151  virtual bool read(const dictionary& compressibilityProperties) = 0;
152 };
153 
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 } // End namespace Foam
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 #endif
162 
163 // ************************************************************************* //
virtual void correct()=0
Correct the compressibility.
virtual bool read(const dictionary &compressibilityProperties)=0
Read compressibilityProperties dictionary.
barotropicCompressibilityModel(const barotropicCompressibilityModel &)
Disallow copy construct.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
A class for handling words, derived from string.
Definition: word.H:59
TypeName("barotropicCompressibilityModel")
Runtime type information.
const volScalarField & psi() const
Return the compressibility.
void operator=(const barotropicCompressibilityModel &)
Disallow default bitwise assignment.
static autoPtr< barotropicCompressibilityModel > New(const dictionary &compressibilityProperties, const volScalarField &gamma, const word &psiName="psi")
Return a reference to the selected compressibility model.
const dictionary & compressibilityProperties() const
Return the phase transport properties dictionary.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Macros to ease declaration of run-time selection tables.
Abstract class for barotropic compressibility models.
Namespace for OpenFOAM.
declareRunTimeSelectionTable(autoPtr, barotropicCompressibilityModel, dictionary,(const dictionary &compressibilityProperties, const volScalarField &gamma, const word &psiName),(compressibilityProperties, gamma, psiName))