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  // Attributes
198 
199  //- Return true: this patch field is altered by assignment
200  virtual bool assignable() const
201  {
202  return true;
203  }
204 
205 
206  // Access
207 
208  //- Return the name of rho
209  const word& rhoName() const noexcept
210  {
211  return rhoName_;
212  }
213 
214  //- Return reference to the name of rho to allow adjustment
215  word& rhoName()
216  {
217  return rhoName_;
218  }
219 
220  //- Return the name of phi
221  const word& phiName() const noexcept
222  {
223  return phiName_;
224  }
225 
226  //- Return reference to the name of phi to allow adjustment
227  word& phiName()
228  {
229  return phiName_;
230  }
231 
232 
233  //- Update the coefficients associated with the patch field
234  virtual void updateCoeffs();
235 
236  //- Write
237  virtual void write(Ostream&) const;
238 
239 
240  // Member Operators
241 
242  //- Copy assignment
243  virtual void operator=(const fvPatchField<vector>& pvf);
244 };
245 
246 
247 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
248 
249 } // End namespace Foam
250 
251 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
252 
253 #endif
254 
255 // ************************************************************************* //
Foam::pressurePermeableAlphaInletOutletVelocityFvPatchVectorField::clone
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Definition: pressurePermeableAlphaInletOutletVelocityFvPatchVectorField.H:189
Foam::fvPatchField< vector >
Foam::pressurePermeableAlphaInletOutletVelocityFvPatchVectorField::TypeName
TypeName("permeableAlphaPressureInletOutletVelocity")
Runtime type information.
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::pressurePermeableAlphaInletOutletVelocityFvPatchVectorField::phiName
const word & phiName() const noexcept
Return the name of phi.
Definition: pressurePermeableAlphaInletOutletVelocityFvPatchVectorField.H:250
Foam::pressurePermeableAlphaInletOutletVelocityFvPatchVectorField::rhoName
word & rhoName()
Return reference to the name of rho to allow adjustment.
Definition: pressurePermeableAlphaInletOutletVelocityFvPatchVectorField.H:244
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::pressurePermeableAlphaInletOutletVelocityFvPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: pressurePermeableAlphaInletOutletVelocityFvPatchVectorField.C:185
Foam::pressurePermeableAlphaInletOutletVelocityFvPatchVectorField::pressurePermeableAlphaInletOutletVelocityFvPatchVectorField
pressurePermeableAlphaInletOutletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: pressurePermeableAlphaInletOutletVelocityFvPatchVectorField.C:38
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
mixedFvPatchFields.H
Foam::pressurePermeableAlphaInletOutletVelocityFvPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: pressurePermeableAlphaInletOutletVelocityFvPatchVectorField.C:127
fvPatchFields.H
Foam::pressurePermeableAlphaInletOutletVelocityFvPatchVectorField::phiName
word & phiName()
Return reference to the name of phi to allow adjustment.
Definition: pressurePermeableAlphaInletOutletVelocityFvPatchVectorField.H:256
Foam::pressurePermeableAlphaInletOutletVelocityFvPatchVectorField::rhoName
const word & rhoName() const noexcept
Return the name of rho.
Definition: pressurePermeableAlphaInletOutletVelocityFvPatchVectorField.H:238
Foam::pressurePermeableAlphaInletOutletVelocityFvPatchVectorField::assignable
virtual bool assignable() const
Return true: this patch field is altered by assignment.
Definition: pressurePermeableAlphaInletOutletVelocityFvPatchVectorField.H:229
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::pressurePermeableAlphaInletOutletVelocityFvPatchVectorField
The pressurePermeableAlphaInletOutletVelocity is a velocity inlet-outlet boundary condition which can...
Definition: pressurePermeableAlphaInletOutletVelocityFvPatchVectorField.H:129
Foam::pressurePermeableAlphaInletOutletVelocityFvPatchVectorField::operator=
virtual void operator=(const fvPatchField< vector > &pvf)
Copy assignment.
Definition: pressurePermeableAlphaInletOutletVelocityFvPatchVectorField.C:201
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54