outletPhaseMeanVelocityFvPatchVectorField.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) 2013-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::outletPhaseMeanVelocityFvPatchVectorField
26 
27 Description
28  This boundary condition adjusts the velocity for the given phase to achieve
29  the specified mean thus causing the phase-fraction to adjust according to
30  the mass flow rate.
31 
32  Typical usage is as the outlet condition for a towing-tank ship simulation
33  to maintain the outlet water level at the level as the inlet.
34 
35 Usage
36  \table
37  Property | Description | Required | Default value
38  UnMean | mean velocity normal to the boundary [m/s] | yes |
39  alpha | phase-fraction field | yes |
40  \endtable
41 
42  Example of the boundary condition specification:
43  \verbatim
44  <patchName>
45  {
46  type outletPhaseMeanVelocity;
47  UnMean 1.2;
48  alpha alpha.water;
49  value uniform (1.2 0 0);
50  }
51  \endverbatim
52 
53 See also
54  Foam::mixedFvPatchField
55  Foam::variableHeightFlowRateInletVelocityFvPatchVectorField
56 
57 SourceFiles
58  outletPhaseMeanVelocityFvPatchVectorField.C
59 
60 \*---------------------------------------------------------------------------*/
61 
62 #ifndef outletPhaseMeanVelocityFvPatchVectorField_H
63 #define outletPhaseMeanVelocityFvPatchVectorField_H
64 
65 #include "mixedFvPatchFields.H"
66 #include "Function1.H"
67 
68 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
69 
70 namespace Foam
71 {
72 /*---------------------------------------------------------------------------*\
73  Class outletPhaseMeanVelocityFvPatchVectorField Declaration
74 \*---------------------------------------------------------------------------*/
75 
76 class outletPhaseMeanVelocityFvPatchVectorField
77 :
78  public mixedFvPatchVectorField
79 {
80  // Private Data
81 
82  //- Mean velocity normal to the boundary
83  autoPtr<Function1<scalar>> UnMean_;
84 
85  //- Name of the phase-fraction field
86  word alphaName_;
87 
88 
89 public:
90 
91  //- Runtime type information
92  TypeName("outletPhaseMeanVelocity");
93 
94 
95  // Constructors
96 
97  //- Construct from patch and internal field
99  (
100  const fvPatch&,
102  );
103 
104  //- Construct from patch, internal field and dictionary
106  (
107  const fvPatch&,
109  const dictionary&
110  );
111 
112  //- Construct by mapping given
113  // outletPhaseMeanVelocityFvPatchVectorField
114  // onto a new patch
116  (
118  const fvPatch&,
120  const fvPatchFieldMapper&
121  );
122 
123  //- Disallow copy without setting internal field reference
125  (
127  ) = delete;
128 
129  //- Copy constructor setting internal field reference
131  (
134  );
135 
136  //- Construct and return a clone setting internal field reference
138  (
140  ) const
141  {
143  (
145  (
146  *this,
147  iF
148  )
149  );
150  }
151 
153  // Member Functions
154 
155  //- Update the coefficients associated with the patch field
156  virtual void updateCoeffs();
157 
158  //- Write
159  virtual void write(Ostream&) const;
160 };
161 
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 } // End namespace Foam
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #endif
170 
171 // ************************************************************************* //
outletPhaseMeanVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
This boundary condition adjusts the velocity for the given phase to achieve the specified mean thus c...
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:62
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Foam::fvPatchFieldMapper.
virtual tmp< fvPatchVectorField > clone(const DimensionedField< vector, volMesh > &iF) const
Construct and return a clone setting internal field reference.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
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: PtrList.H:53
TypeName("outletPhaseMeanVelocity")
Runtime type information.
Namespace for OpenFOAM.