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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2013-2016 OpenFOAM Foundation
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::outletPhaseMeanVelocityFvPatchVectorField
28 
29 Group
30  grpOutletBoundaryConditions
31 
32 Description
33  This boundary condition adjusts the velocity for the given phase to achieve
34  the specified mean thus causing the phase-fraction to adjust according to
35  the mass flow rate.
36 
37  Typical usage is as the outlet condition for a towing-tank ship simulation
38  to maintain the outlet water level at the level as the inlet.
39 
40 Usage
41  \table
42  Property | Description | Required | Default value
43  Umean | mean velocity normal to the boundary [m/s] | yes |
44  alpha | phase-fraction field | yes |
45  \endtable
46 
47  Example of the boundary condition specification:
48  \verbatim
49  <patchName>
50  {
51  type outletPhaseMeanVelocity;
52  Umean 1.2;
53  alpha alpha.water;
54  value uniform (1.2 0 0);
55  }
56  \endverbatim
57 
58 See also
59  Foam::mixedFvPatchField
60  Foam::variableHeightFlowRateInletVelocityFvPatchVectorField
61 
62 SourceFiles
63  outletPhaseMeanVelocityFvPatchVectorField.C
64 
65 \*---------------------------------------------------------------------------*/
66 
67 #ifndef outletPhaseMeanVelocityFvPatchVectorField_H
68 #define outletPhaseMeanVelocityFvPatchVectorField_H
69 
70 #include "mixedFvPatchFields.H"
71 
72 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
73 
74 namespace Foam
75 {
76 /*---------------------------------------------------------------------------*\
77  Class outletPhaseMeanVelocityFvPatchVectorField Declaration
78 \*---------------------------------------------------------------------------*/
79 
80 class outletPhaseMeanVelocityFvPatchVectorField
81 :
82  public mixedFvPatchVectorField
83 {
84  // Private data
85 
86  //- Inlet integral flow rate
87  scalar Umean_;
88 
89  //- Name of the phase-fraction field
90  word alphaName_;
91 
92 
93 public:
94 
95  //- Runtime type information
96  TypeName("outletPhaseMeanVelocity");
97 
98 
99  // Constructors
100 
101  //- Construct from patch and internal field
103  (
104  const fvPatch&,
106  );
107 
108  //- Construct from patch, internal field and dictionary
110  (
111  const fvPatch&,
113  const dictionary&
114  );
115 
116  //- Construct by mapping given
117  // outletPhaseMeanVelocityFvPatchVectorField
118  // onto a new patch
120  (
122  const fvPatch&,
124  const fvPatchFieldMapper&
125  );
126 
127  //- Construct as copy
129  (
131  );
132 
133  //- Construct as copy setting internal field reference
135  (
138  );
139 
140  //- Return a clone
141  virtual tmp<fvPatchField<vector>> clone() const
142  {
143  return fvPatchField<vector>::Clone(*this);
144  }
145 
146  //- Clone with an internal field reference
148  (
150  ) const
151  {
152  return fvPatchField<vector>::Clone(*this, iF);
153  }
154 
155 
156  // Member functions
157 
158  // Access
159 
160  //- Return the flux
161  scalar Umean() const
162  {
163  return Umean_;
164  }
165 
166  //- Return reference to the flux to allow adjustment
167  scalar& Umean()
168  {
169  return Umean_;
170  }
171 
172 
173  //- Update the coefficients associated with the patch field
174  virtual void updateCoeffs();
175 
176  //- Write
177  virtual void write(Ostream&) const;
178 };
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 } // End namespace Foam
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #endif
188 
189 // ************************************************************************* //
outletPhaseMeanVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
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:70
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 class for handling words, derived from Foam::string.
Definition: word.H:63
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A FieldMapper for finite-volume patch fields.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
virtual tmp< fvPatchField< vector > > clone() const
Return a clone.
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
TypeName("outletPhaseMeanVelocity")
Runtime type information.
Namespace for OpenFOAM.