outletPhaseMeanVelocityFvPatchVectorField.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 | Copyright (C) 2013 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 Group
28  grpOutletBoundaryConditions
29 
30 Description
31  This boundary condition adjusts the velocity for the given phase to achieve
32  the specified mean thus causing the phase-fraction to adjust according to
33  the mass flow rate.
34 
35  Typical usage is as the outlet condition for a towing-tank ship simulation
36  to maintain the outlet water level at the level as the inlet.
37 
38  \heading Patch usage
39  \table
40  Property | Description | Required | Default value
41  Umean | mean velocity normal to the boundary [m/s] | yes |
42  alpha | phase-fraction field | yes |
43  \endtable
44 
45  Example of the boundary condition specification:
46  \verbatim
47  myPatch
48  {
49  type outletPhaseMeanVelocity;
50  Umean 1.2;
51  alpha alpha.water;
52  value uniform (1.2 0 0);
53  }
54  \endverbatim
55 
56 SeeAlso
57  Foam::mixedFvPatchField
58  Foam::variableHeightFlowRateInletVelocityFvPatchVectorField
59 
60 SourceFiles
61  outletPhaseMeanVelocityFvPatchVectorField.C
62 
63 \*---------------------------------------------------------------------------*/
64 
65 #ifndef outletPhaseMeanVelocityFvPatchVectorField_H
66 #define outletPhaseMeanVelocityFvPatchVectorField_H
67 
68 #include "mixedFvPatchFields.H"
69 
70 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
71 
72 namespace Foam
73 {
74 /*---------------------------------------------------------------------------*\
75  Class outletPhaseMeanVelocityFvPatchVectorField Declaration
76 \*---------------------------------------------------------------------------*/
77 
78 class outletPhaseMeanVelocityFvPatchVectorField
79 :
80  public mixedFvPatchVectorField
81 {
82  // Private data
83 
84  //- Inlet integral flow rate
85  scalar Umean_;
86 
87  //- Name of the phase-fraction field
88  word alphaName_;
89 
90 
91 public:
92 
93  //- Runtime type information
94  TypeName("outletPhaseMeanVelocity");
95 
96 
97  // Constructors
98 
99  //- Construct from patch and internal field
101  (
102  const fvPatch&,
104  );
105 
106  //- Construct from patch, internal field and dictionary
108  (
109  const fvPatch&,
111  const dictionary&
112  );
113 
114  //- Construct by mapping given
115  // outletPhaseMeanVelocityFvPatchVectorField
116  // onto a new patch
118  (
120  const fvPatch&,
122  const fvPatchFieldMapper&
123  );
124 
125  //- Construct as copy
127  (
129  );
130 
131  //- Construct and return a clone
132  virtual tmp<fvPatchVectorField> clone() const
133  {
135  (
137  );
138  }
139 
140  //- Construct as copy setting internal field reference
142  (
145  );
147  //- Construct and return a clone setting internal field reference
149  (
151  ) const
152  {
154  (
156  (
157  *this,
158  iF
159  )
160  );
161  }
162 
164  // Member functions
165 
166  // Access
167 
168  //- Return the flux
169  scalar Umean() const
170  {
171  return Umean_;
172  }
173 
174  //- Return reference to the flux to allow adjustment
175  scalar& Umean()
176  {
177  return Umean_;
178  }
179 
180 
181  //- Update the coefficients associated with the patch field
182  virtual void updateCoeffs();
184  //- Write
185  virtual void write(Ostream&) const;
186 };
187 
188 
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 
191 } // End namespace Foam
192 
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 
195 #endif
196 
197 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
This boundary condition adjusts the velocity for the given phase to achieve the specified mean thus c...
Foam::fvPatchFieldMapper.
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Namespace for OpenFOAM.
TypeName("outletPhaseMeanVelocity")
Runtime type information.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A class for managing temporary objects.
Definition: PtrList.H:118
outletPhaseMeanVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.