dynamicPressureFvPatchScalarField.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-2023 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::dynamicPressureFvPatchScalarField
26 
27 Description
28  This boundary condition provides a dynamic pressure condition. It subtracts
29  a kinetic energy term from a reference pressure to get a value which is
30  fixed on the boundary. It forms the base class for the total and
31  entrainment pressure conditions.
32 
33 See also
34  Foam::totalPressureFvPatchField
35 
36 SourceFiles
37  dynamicPressureFvPatchScalarField.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef dynamicPressureFvPatchScalarField_H
42 #define dynamicPressureFvPatchScalarField_H
43 
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class dynamicPressureFvPatchScalarField Declaration
53 \*---------------------------------------------------------------------------*/
54 
56 :
57  public fixedValueFvPatchScalarField
58 {
59 
60 protected:
61 
62  // Protected Data
63 
64  //- Name of the density field used to normalise the mass flux
65  const word rhoName_;
66 
67  //- Name of the compressibility field used to calculate the wave speed
68  const word psiName_;
69 
70  //- Heat capacity ratio
71  const scalar gamma_;
72 
73  //- Reference pressure
75 
76 
77  // Protected Member Functions
78 
79  using fixedValueFvPatchScalarField::updateCoeffs;
80 
81  //- Update the coefficients associated with the patch field
82  // using the given external static pressure, and difference between
83  // the external kinetic energy and patch kinetic energy fields
84  void updateCoeffs
85  (
86  const scalarField& p0p,
87  const scalarField& K0mKp
88  );
89 
90 
91 public:
92 
93  //- Runtime type information
94  TypeName("dynamicPressure");
95 
96 
97  // Constructors
98 
99  //- Construct from patch, internal field and dictionary
101  (
102  const fvPatch&,
104  const dictionary&
105  );
106 
107  //- Construct by mapping given dynamicPressureFvPatchScalarField
108  // onto a new patch
110  (
112  const fvPatch&,
114  const fvPatchFieldMapper&
115  );
116 
117  //- Disallow copy without setting internal field reference
119  (
121  ) = delete;
122 
123  //- Copy constructor setting internal field reference
125  (
128  );
129 
130 
131  // Member Functions
132 
133  // Mapping functions
134 
135  //- Map the given fvPatchField onto this fvPatchField
136  virtual void map
137  (
138  const fvPatchScalarField&,
139  const fvPatchFieldMapper&
140  );
141 
142  //- Reset the fvPatchField to the given fvPatchField
143  // Used for mesh to mesh mapping
144  virtual void reset(const fvPatchScalarField&);
145 
146 
147  //- Write
148  virtual void write(Ostream&) const;
149 };
150 
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 } // End namespace Foam
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 #endif
159 
160 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
This boundary condition provides a dynamic pressure condition. It subtracts a kinetic energy term fro...
TypeName("dynamicPressure")
Runtime type information.
virtual void reset(const fvPatchScalarField &)
Reset the fvPatchField to the given fvPatchField.
virtual void map(const fvPatchScalarField &, const fvPatchFieldMapper &)
Map the given fvPatchField onto this fvPatchField.
void updateCoeffs(const scalarField &p0p, const scalarField &K0mKp)
Update the coefficients associated with the patch field.
dynamicPressureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
const word rhoName_
Name of the density field used to normalise the mass flux.
const word psiName_
Name of the compressibility field used to calculate the wave speed.
Foam::fvPatchFieldMapper.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:87
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.