pressurePermeableAlphaInletOutletVelocityFvPatchVectorField.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) 2021 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::pressurePermeableAlphaInletOutletVelocityFvPatchVectorField
28 
29 Group
30  grpInletBoundaryConditions grpOutletBoundaryConditions
31 
32 Description
33  The \c pressurePermeableAlphaInletOutletVelocity is a velocity inlet-outlet
34  boundary condition which can be applied to velocity boundaries for
35  multiphase flows when the pressure boundary condition is specified.
36 
37  In the \c pressurePermeableAlphaInletOutletVelocity, an open condition is
38  applied when \c alpha is under a user-defined \c alphaMin value and a wall
39  condition is applied when \c alpha is larger than the \c alphaMin.
40 
41  This boundary condition can be used in conjunction with
42  \c prghPermeableAlphaTotalPressure for the \c p_rgh variable.
43 
44 Usage
45  Example of the boundary condition specification:
46  \verbatim
47  <patchName>
48  {
49  // Mandatory entries
50  type pressurePermeableAlphaInletOutletVelocity;
51 
52  // Optional entries
53  phi phi;
54  rho rho;
55  alpha alpha.water;
56  alphaMin 0.01;
57 
58  // Inherited entries
59  value uniform (0 0 0);
60  ...
61  }
62  \endverbatim
63 
64  where the entries mean:
65  \table
66  Property | Description | Type | Reqd | Deflt
67  phi | Name of flux field | word | no | phi
68  rho | Name of density field | word | no | rho
69  alpha | Name of mixture field | word | no | none
70  alphaMin | Minimum alpha | scalar | no | 1
71  \endtable
72 
73  The inherited entries are elaborated in:
74  - \link mixedFvPatchFields.H \endlink
75 
76 See also
77  - Foam::prghPermeableAlphaTotalPressureFvPatchScalarField
78  - Foam::mixedFvPatchVectorField
79 
80 SourceFiles
81  pressurePermeableAlphaInletOutletVelocityFvPatchVectorField.C
82 
83 \*---------------------------------------------------------------------------*/
84 
85 #ifndef pressurePermeableAlphaInletOutletVelocityFvPatchVectorField_H
86 #define pressurePermeableAlphaInletOutletVelocityFvPatchVectorField_H
87 
88 #include "fvPatchFields.H"
89 #include "mixedFvPatchFields.H"
90 
91 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
92 
93 namespace Foam
94 {
95 
96 /*---------------------------------------------------------------------------*\
97 Class pressurePermeableAlphaInletOutletVelocityFvPatchVectorField Declaration
98 \*---------------------------------------------------------------------------*/
99 
100 class pressurePermeableAlphaInletOutletVelocityFvPatchVectorField
101 :
102  public mixedFvPatchVectorField
103 {
104  // Private Data
105 
106  //- Name of flux field
107  word phiName_;
108 
109  //- Name of density field
110  word rhoName_;
111 
112  //- Name of the mixture VOF field (if used)
113  word alphaName_;
114 
115  //- Minimum alpha value to outlet blockage
116  scalar alphaMin_;
117 
118 
119 public:
120 
121  //- Runtime type information
122  TypeName("permeableAlphaPressureInletOutletVelocity");
123 
124 
125  // Constructors
126 
127  //- Construct from patch and internal field
129  (
130  const fvPatch&,
132  );
133 
134  //- Construct from patch, internal field and dictionary
136  (
137  const fvPatch&,
139  const dictionary&
140  );
141 
142  //- Construct by mapping given
143  //- pressurePermeableAlphaInletOutletVelocityFvPatchVectorField
144  //- onto a new patch
146  (
148  const fvPatch&,
150  const fvPatchFieldMapper&
151  );
152 
153  //- Construct as copy
155  (
157  );
158 
159  //- Construct and return a clone
160  virtual tmp<fvPatchVectorField> clone() const
161  {
163  (
165  (
166  *this
167  )
168  );
169  }
170 
171  //- Construct as copy setting internal field reference
173  (
176  );
177 
178  //- Construct and return a clone setting internal field reference
180  (
182  ) const
183  {
185  (
187  (
188  *this,
189  iF
190  )
191  );
192  }
193 
194 
195  // Member Functions
196 
197  //- True: this patch field is altered by assignment
198  virtual bool assignable() const { return true; }
199 
200 
201  // Access
202 
203  //- Return the name of rho
204  const word& rhoName() const noexcept
205  {
206  return rhoName_;
207  }
208 
209  //- Return reference to the name of rho to allow adjustment
210  word& rhoName()
211  {
212  return rhoName_;
213  }
214 
215  //- Return the name of phi
216  const word& phiName() const noexcept
217  {
218  return phiName_;
219  }
220 
221  //- Return reference to the name of phi to allow adjustment
222  word& phiName()
223  {
224  return phiName_;
225  }
226 
227 
228  //- Update the coefficients associated with the patch field
229  virtual void updateCoeffs();
230 
231  //- Write
232  virtual void write(Ostream&) const;
233 
234 
235  // Member Operators
236 
237  //- Copy assignment
238  virtual void operator=(const fvPatchField<vector>& pvf);
239 };
240 
241 
242 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
243 
244 } // End namespace Foam
245 
246 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
247 
248 #endif
250 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
The pressurePermeableAlphaInletOutletVelocity is a velocity inlet-outlet boundary condition which can...
A class for handling words, derived from Foam::string.
Definition: word.H:63
A FieldMapper for finite-volume patch fields.
pressurePermeableAlphaInletOutletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
const direction noexcept
Definition: Scalar.H:258
TypeName("permeableAlphaPressureInletOutletVelocity")
Runtime type information.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.