barotropicCompressibilityModel.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) 2011-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 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 protected:
65 
66  // Protected data
67 
69 
71  const volScalarField& gamma_;
72 
73 
74 public:
75 
76  //- Runtime type information
77  TypeName("barotropicCompressibilityModel");
78 
79 
80  // Declare run-time constructor selection table
81 
83  (
84  autoPtr,
86  dictionary,
87  (
89  const volScalarField& gamma,
90  const word& psiName
91  ),
92  (compressibilityProperties, gamma, psiName)
93  );
94 
95 
96  // Constructors
97 
98  //- Construct from components
100  (
101  const dictionary& compressibilityProperties,
102  const volScalarField& gamma,
103  const word& psiName = "psi"
104  );
105 
106  //- Disallow default bitwise copy construction
108 
109 
110  // Selectors
111 
112  //- Return a reference to the selected compressibility model
114  (
115  const dictionary& compressibilityProperties,
116  const volScalarField& gamma,
117  const word& psiName = "psi"
118  );
119 
120 
121  //- Destructor
123  {}
124 
125 
126  // Member Functions
127 
128  //- Return the phase transport properties dictionary
130  {
132  }
133 
134  //- Return the compressibility
135  const volScalarField& psi() const
136  {
137  return psi_;
138  }
139 
140  //- Correct the compressibility
141  virtual void correct() = 0;
142 
143  //- Read compressibilityProperties dictionary
144  virtual bool read(const dictionary& compressibilityProperties) = 0;
145 
146 
147  // Member Operators
148 
149  //- Disallow default bitwise assignment
150  void operator=(const barotropicCompressibilityModel&) = delete;
151 };
152 
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 } // End namespace Foam
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 #endif
161 
162 // ************************************************************************* //
virtual void correct()=0
Correct the compressibility.
virtual bool read(const dictionary &compressibilityProperties)=0
Read compressibilityProperties dictionary.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
void operator=(const barotropicCompressibilityModel &)=delete
Disallow default bitwise assignment.
barotropicCompressibilityModel(const dictionary &compressibilityProperties, const volScalarField &gamma, const word &psiName="psi")
Construct from components.
A class for handling words, derived from string.
Definition: word.H:59
TypeName("barotropicCompressibilityModel")
Runtime type information.
const volScalarField & psi() const
Return the compressibility.
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))