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 and return a clone
134  virtual tmp<fvPatchVectorField> clone() const
135  {
137  (
139  );
140  }
141 
142  //- Construct as copy setting internal field reference
144  (
147  );
148 
149  //- Construct and return a clone setting internal field reference
151  (
153  ) const
154  {
156  (
158  (
159  *this,
160  iF
161  )
162  );
163  }
164 
165 
166  // Member functions
167 
168  // Access
169 
170  //- Return the flux
171  scalar Umean() const
172  {
173  return Umean_;
174  }
175 
176  //- Return reference to the flux to allow adjustment
177  scalar& Umean()
178  {
179  return Umean_;
180  }
181 
182 
183  //- Update the coefficients associated with the patch field
184  virtual void updateCoeffs();
185 
186  //- Write
187  virtual void write(Ostream&) const;
188 };
189 
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 } // End namespace Foam
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 #endif
198 
199 // ************************************************************************* //
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::outletPhaseMeanVelocityFvPatchVectorField::TypeName
TypeName("outletPhaseMeanVelocity")
Runtime type information.
Foam::outletPhaseMeanVelocityFvPatchVectorField::outletPhaseMeanVelocityFvPatchVectorField
outletPhaseMeanVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: outletPhaseMeanVelocityFvPatchVectorField.C:39
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::outletPhaseMeanVelocityFvPatchVectorField::Umean
scalar & Umean()
Return reference to the flux to allow adjustment.
Definition: outletPhaseMeanVelocityFvPatchVectorField.H:191
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
mixedFvPatchFields.H
Foam::outletPhaseMeanVelocityFvPatchVectorField::Umean
scalar Umean() const
Return the flux.
Definition: outletPhaseMeanVelocityFvPatchVectorField.H:185
Foam::outletPhaseMeanVelocityFvPatchVectorField
This boundary condition adjusts the velocity for the given phase to achieve the specified mean thus c...
Definition: outletPhaseMeanVelocityFvPatchVectorField.H:94
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::outletPhaseMeanVelocityFvPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: outletPhaseMeanVelocityFvPatchVectorField.C:128
Foam::outletPhaseMeanVelocityFvPatchVectorField::clone
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Definition: outletPhaseMeanVelocityFvPatchVectorField.H:148
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::outletPhaseMeanVelocityFvPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: outletPhaseMeanVelocityFvPatchVectorField.C:167
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54