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-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 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 protected:
60 
61  // Protected Data
62 
63  //- Name of the density field used to normalise the mass flux
64  const word rhoName_;
65 
66  //- Name of the compressibility field used to calculate the wave speed
67  const word psiName_;
68 
69  //- Heat capacity ratio
70  const scalar gamma_;
71 
72  //- Reference pressure
74 
75 
76 public:
77 
78  //- Runtime type information
79  TypeName("dynamicPressure");
80 
81 
82  // Constructors
83 
84  //- Construct from patch and internal field
86  (
87  const fvPatch&,
89  );
90 
91  //- Construct from patch, internal field and dictionary
93  (
94  const fvPatch&,
96  const dictionary&
97  );
98 
99  //- Construct by mapping given dynamicPressureFvPatchScalarField
100  // onto a new patch
102  (
104  const fvPatch&,
106  const fvPatchFieldMapper&
107  );
108 
109  //- Disallow copy without setting internal field reference
111  (
113  ) = delete;
114 
115  //- Copy constructor setting internal field reference
117  (
120  );
121 
122 
123  // Member Functions
124 
125  // Mapping functions
126 
127  //- Map (and resize as needed) from self given a mapping object
128  // Used to update fields following mesh topology change
129  virtual void autoMap(const fvPatchFieldMapper&);
130 
131  //- Reverse map the given fvPatchField onto this fvPatchField
132  // Used to reconstruct fields
133  virtual void rmap(const fvPatchScalarField&, const labelList&);
134 
135 
136  // Evaluation functions
137 
138  using fixedValueFvPatchScalarField::updateCoeffs;
139 
140  //- Update the coefficients associated with the patch field
141  // using the given patch reference pressure and kinetic energy
142  // fields
143  void updateCoeffs
144  (
145  const scalarField& p0p,
146  const scalarField& Kp
147  );
148 
149 
150  //- Write
151  virtual void write(Ostream&) const;
152 };
153 
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 } // End namespace Foam
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 #endif
162 
163 // ************************************************************************* //
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:62
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...
void updateCoeffs(const scalarField &p0p, const scalarField &Kp)
Update the coefficients associated with the patch field.
TypeName("dynamicPressure")
Runtime type information.
A class for handling words, derived from string.
Definition: word.H:59
Foam::fvPatchFieldMapper.
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.