Loading...
Searching...
No Matches
prghPermeableAlphaTotalPressureFvPatchScalarField.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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::prghPermeableAlphaTotalPressureFvPatchScalarField
28
29Description
30 The \c prghPermeableAlphaTotalPressure is a mixed boundary condition
31 for the \c p_rgh variable in multiphase flows.
32
33 It switches between an open boundary using the \c prghTotalPressure
34 boundary condition and a wall condition using the \c fixedFluxPressure
35 boundary condition.
36
37 In the \c prghPermeableAlphaTotalPressure, 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 pressurePermeableAlphaInletOutletVelocity for the \c U variable.
43
44Usage
45 Example of the boundary condition specification:
46 \verbatim
47 <patchName>
48 {
49 // Mandatory entries
50 type prghPermeableAlphaTotalPressure;
51 p uniform 0;
52
53 // Optional entries
54 phi phi;
55 rho rho;
56 U U;
57 alphaName alpha.water;
58 alphaMin 0.01;
59
60 // Inherited entries
61 value uniform 0;
62 ...
63 }
64 \endverbatim
65
66 where the entries mean:
67 \table
68 Property | Description | Type | Reqd | Deflt
69 p | Total pressure | PatchFunction1<scalar> | yes | -
70 phi | Name of flux field | word | no | phi
71 rho | Name of density field | word | no | rho
72 U | Name of velocity field | word | no | U
73 alpha | Name of mixture field | word | no | none
74 alphaMin | Minimum alpha | scalar | no | 1
75 \endtable
76
77 The inherited entries are elaborated in:
78 - \link mixedFvPatchFields.H \endlink
79 - \link PatchFunction1.H \endlink
80
81See also
82 - Foam::pressurePermeableAlphaInletOutletVelocityFvPatchVectorField
83 - Foam::mixedFvPatchVectorField
84 - Foam::prghTotalPressureFvPatchScalarField
85
86SourceFiles
87 prghPermeableAlphaTotalPressureFvPatchScalarField.C
88
89\*---------------------------------------------------------------------------*/
90
91#ifndef prghPermeableAlphaTotalPressureFvPatchScalarField_H
92#define prghPermeableAlphaTotalPressureFvPatchScalarField_H
93
94#include "mixedFvPatchField.H"
95#include "volFields.H"
96#include "surfaceFields.H"
97#include "updateableSnGrad.H"
98#include "PatchFunction1.H"
99
100// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
101
102namespace Foam
103{
104
105/*---------------------------------------------------------------------------*\
106 Class prghPermeableAlphaTotalPressureFvPatchScalarField Declaration
107\*---------------------------------------------------------------------------*/
108
110:
111 public mixedFvPatchField<scalar>,
113{
114 // Private Data
115
116 //- Total pressure field
117 autoPtr<PatchFunction1<scalar>> p0_;
118
119 //- Name of the flux transporting the field
120 word phiName_;
121
122 //- Name of the density field used to normalise the mass flux
123 word rhoName_;
124
125 //- Name of the velocity field
126 word UName_;
127
128 //- Name of the mixture VOF field (if used)
129 word alphaName_;
130
131 //- Minimum alpha value to outlet blockage
132 scalar alphaMin_;
133
134 //- Current time index (used for updating)
135 label curTimeIndex_;
136
137
138public:
139
140 //- Runtime type information
141 TypeName("prghPermeableAlphaTotalPressure");
142
143
144 // Constructors
145
146 //- Construct from patch and internal field
148 (
149 const fvPatch&,
151 );
152
153 //- Construct from patch, internal field and dictionary
155 (
156 const fvPatch&,
158 const dictionary&
159 );
160
161 //- Construct by mapping given
162 //- prghPermeableAlphaTotalPressureFvPatchScalarField
163 //- onto a new patch
165 (
167 const fvPatch&,
169 const fvPatchFieldMapper&
170 );
171
172 //- Construct as copy
174 (
176 );
177
178 //- Construct as copy setting internal field reference
180 (
183 );
184
185 //- Return a clone
186 virtual tmp<fvPatchField<scalar>> clone() const
187 {
188 return fvPatchField<scalar>::Clone(*this);
189 }
190
191 //- Clone with an internal field reference
193 (
195 ) const
196 {
197 return fvPatchField<scalar>::Clone(*this, iF);
198 }
199
200
201 // Member Functions
202
203 // Mapping
204
205 //- Map (and resize as needed) from self given a mapping object
206 virtual void autoMap
207 (
208 const fvPatchFieldMapper&
209 );
210
211 //- Reverse map the given fvPatchField onto this fvPatchField
212 virtual void rmap
213 (
214 const fvPatchScalarField&,
215 const labelList&
216 );
217
218
219 // Evaluation
220
221 //- Update the coefficients associated with the patch field
222 virtual void updateCoeffs();
223
224 //- Update the patch pressure gradient field from the given snGradp
225 virtual void updateSnGrad(const scalarField& snGradp);
226
227
228 //- Write
229 virtual void write(Ostream&) const;
230};
231
232
233// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
234
235} // End namespace Foam
236
237// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
238
239
240#endif
241
242// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
A FieldMapper for finite-volume patch fields.
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition fvPatch.H:71
This boundary condition provides a base class for 'mixed' type boundary conditions,...
mixedFvPatchField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
The prghPermeableAlphaTotalPressure is a mixed boundary condition for the p_rgh variable in multiphas...
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
TypeName("prghPermeableAlphaTotalPressure")
Runtime type information.
virtual tmp< fvPatchField< scalar > > clone(const DimensionedField< scalar, volMesh > &iF) const
Clone with an internal field reference.
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
prghPermeableAlphaTotalPressureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
virtual void updateSnGrad(const scalarField &snGradp)
Update the patch pressure gradient field from the given snGradp.
A class for managing temporary objects.
Definition tmp.H:75
A class for handling words, derived from Foam::string.
Definition word.H:66
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition List.H:62
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
fvPatchField< scalar > fvPatchScalarField
runTime write()
Foam::surfaceFields.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68