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 as copy setting internal field reference
161  (
164  );
165 
166  //- Return a clone
167  virtual tmp<fvPatchField<vector>> clone() const
168  {
169  return fvPatchField<vector>::Clone(*this);
170  }
171 
172  //- Clone with an internal field reference
174  (
176  ) const
177  {
178  return fvPatchField<vector>::Clone(*this, iF);
179  }
180 
181 
182  // Member Functions
183 
184  //- True: this patch field is altered by assignment
185  virtual bool assignable() const { return true; }
186 
187 
188  // Access
189 
190  //- Return the name of rho
191  const word& rhoName() const noexcept
192  {
193  return rhoName_;
194  }
195 
196  //- Return reference to the name of rho to allow adjustment
197  word& rhoName()
198  {
199  return rhoName_;
200  }
201 
202  //- Return the name of phi
203  const word& phiName() const noexcept
204  {
205  return phiName_;
206  }
207 
208  //- Return reference to the name of phi to allow adjustment
209  word& phiName()
210  {
211  return phiName_;
212  }
213 
215  //- Update the coefficients associated with the patch field
216  virtual void updateCoeffs();
217 
218  //- Write
219  virtual void write(Ostream&) const;
220 
221 
222  // Member Operators
224  //- Copy assignment
225  virtual void operator=(const fvPatchField<vector>& pvf);
226 };
227 
228 
229 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
230 
231 } // End namespace Foam
232 
233 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
234 
235 #endif
237 // ************************************************************************* //
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...
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
Definition: fvPatchField.H:597
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...
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.