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-2018 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  Umean | mean velocity normal to the boundary [m/s] | yes |
39  ramp | ramping function for the mean flow speed | no | None
40  alpha | phase-fraction field | yes |
41  \endtable
42 
43  Example of the boundary condition specification:
44  \verbatim
45  <patchName>
46  {
47  type outletPhaseMeanVelocity;
48  Umean 1.2;
49  alpha alpha.water;
50  value uniform (1.2 0 0);
51  }
52  \endverbatim
53 
54 See also
55  Foam::mixedFvPatchField
56  Foam::variableHeightFlowRateInletVelocityFvPatchVectorField
57 
58 SourceFiles
59  outletPhaseMeanVelocityFvPatchVectorField.C
60 
61 \*---------------------------------------------------------------------------*/
62 
63 #ifndef outletPhaseMeanVelocityFvPatchVectorField_H
64 #define outletPhaseMeanVelocityFvPatchVectorField_H
65 
66 #include "mixedFvPatchFields.H"
67 #include "Function1.H"
68 
69 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
70 
71 namespace Foam
72 {
73 /*---------------------------------------------------------------------------*\
74  Class outletPhaseMeanVelocityFvPatchVectorField Declaration
75 \*---------------------------------------------------------------------------*/
76 
77 class outletPhaseMeanVelocityFvPatchVectorField
78 :
79  public mixedFvPatchVectorField
80 {
81  // Private data
82 
83  //- Inlet integral flow rate
84  scalar Umean_;
85 
86  //- Ramp for the mean flow rate
87  autoPtr<Function1<scalar>> ramp_;
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  //- Update the coefficients associated with the patch field
169  virtual void updateCoeffs();
171  //- Write
172  virtual void write(Ostream&) const;
173 };
174 
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 } // End namespace Foam
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 #endif
183 
184 // ************************************************************************* //
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:137
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:61
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
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.