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-2022 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 and internal field
101  (
102  const fvPatch&,
104  );
105 
106  //- Construct from patch, internal field and dictionary
108  (
109  const fvPatch&,
111  const dictionary&
112  );
113 
114  //- Construct by mapping given dynamicPressureFvPatchScalarField
115  // onto a new patch
117  (
119  const fvPatch&,
121  const fvPatchFieldMapper&
122  );
123 
124  //- Disallow copy without setting internal field reference
126  (
128  ) = delete;
129 
130  //- Copy constructor setting internal field reference
132  (
135  );
136 
137 
138  // Member Functions
139 
140  // Mapping functions
141 
142  //- Map (and resize as needed) from self given a mapping object
143  // Used to update fields following mesh topology change
144  virtual void autoMap(const fvPatchFieldMapper&);
145 
146  //- Reverse map the given fvPatchField onto this fvPatchField
147  // Used to reconstruct fields
148  virtual void rmap(const fvPatchScalarField&, const labelList&);
149 
150  //- Reset the fvPatchField to the given fvPatchField
151  // Used for mesh to mesh mapping
152  virtual void reset(const fvPatchScalarField&);
153 
154 
155  //- Write
156  virtual void write(Ostream&) const;
157 };
158 
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 } // End namespace Foam
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 #endif
167 
168 // ************************************************************************* //
const word psiName_
Name of the compressibility field used to calculate the wave speed.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:63
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:66
This boundary condition provides a dynamic pressure condition. It subtracts a kinetic energy term fro...
virtual void reset(const fvPatchScalarField &)
Reset the fvPatchField to the given fvPatchField.
TypeName("dynamicPressure")
Runtime type information.
A class for handling words, derived from string.
Definition: word.H:59
Foam::fvPatchFieldMapper.
void updateCoeffs(const scalarField &p0p, const scalarField &K0mKp)
Update the coefficients associated with the patch field.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
const word rhoName_
Name of the density field used to normalise the mass flux.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
dynamicPressureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Namespace for OpenFOAM.