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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011 OpenFOAM Foundation
9 Copyright (C) 2019 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Namespace
28 Foam::compressibilityModels
29
30Description
31 Namespace for compressibility models.
32
33
34Class
35 Foam::barotropicCompressibilityModel
36
37Description
38 Abstract class for barotropic compressibility models
39
40SourceFiles
41 barotropicCompressibilityModel.C
42 newbarotropicCompressibilityModel.C
43
44\*---------------------------------------------------------------------------*/
45
46#ifndef barotropicCompressibilityModel_H
47#define barotropicCompressibilityModel_H
48
49#include "IOdictionary.H"
50#include "typeInfo.H"
52#include "volFields.H"
53#include "dimensionedScalar.H"
54#include "autoPtr.H"
55
56// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57
58namespace Foam
59{
60
61/*---------------------------------------------------------------------------*\
62 Class barotropicCompressibilityModel Declaration
63\*---------------------------------------------------------------------------*/
66{
67
68protected:
69
70 // Protected data
76
77
78 // Private Member Functions
79
80 //- No copy construct
82 (
84 ) = delete;
85
86 //- No copy assignment
87 void operator=(const barotropicCompressibilityModel&) = delete;
88
89
90public:
91
92 //- Runtime type information
93 TypeName("barotropicCompressibilityModel");
94
95
96 // Declare run-time constructor selection table
99 (
100 autoPtr,
103 (
105 const volScalarField& gamma,
106 const word& psiName
107 ),
109 );
110
111
112 // Selectors
113
114 //- Return a reference to the selected compressibility model
116 (
118 const volScalarField& gamma,
119 const word& psiName = "psi"
120 );
121
122
123 // Constructors
124
125 //- Construct from components
127 (
129 const volScalarField& gamma,
130 const word& psiName = "psi"
131 );
132
133
134 //- Destructor
135 virtual ~barotropicCompressibilityModel() = default;
136
137
138 // Member Functions
139
140 //- Return the phase transport properties dictionary
142 {
144 }
145
146 //- Return the compressibility
147 const volScalarField& psi() const
148 {
149 return psi_;
150 }
151
152 //- Correct the compressibility
153 virtual void correct() = 0;
154
155 //- Read compressibilityProperties dictionary
156 virtual bool read(const dictionary& compressibilityProperties) = 0;
157};
158
159
160// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161
162} // End namespace Foam
163
164// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165
166#endif
167
168// ************************************************************************* //
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
Abstract class for barotropic compressibility models.
TypeName("barotropicCompressibilityModel")
Runtime type information.
const dictionary & compressibilityProperties() const
Return the phase transport properties dictionary.
const volScalarField & psi() const
Return the compressibility.
virtual ~barotropicCompressibilityModel()=default
Destructor.
virtual void correct()=0
Correct the compressibility.
barotropicCompressibilityModel(const barotropicCompressibilityModel &)=delete
No copy construct.
declareRunTimeSelectionTable(autoPtr, barotropicCompressibilityModel, dictionary,(const dictionary &compressibilityProperties, const volScalarField &gamma, const word &psiName),(compressibilityProperties, gamma, psiName))
void operator=(const barotropicCompressibilityModel &)=delete
No copy assignment.
virtual bool read(const dictionary &compressibilityProperties)=0
Read compressibilityProperties dictionary.
static autoPtr< barotropicCompressibilityModel > New(const dictionary &compressibilityProperties, const volScalarField &gamma, const word &psiName="psi")
Return a reference to the selected compressibility model.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A class for handling words, derived from Foam::string.
Definition: word.H:68
const scalar gamma
Definition: EEqn.H:9
Namespace for OpenFOAM.
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73