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-2023 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, internal field and dictionary
99  (
100  const fvPatch&,
102  const dictionary&
103  );
104 
105  //- Construct by mapping given
106  // outletPhaseMeanVelocityFvPatchVectorField
107  // onto a new patch
109  (
111  const fvPatch&,
113  const fvPatchFieldMapper&
114  );
115 
116  //- Disallow copy without setting internal field reference
118  (
120  ) = delete;
121 
122  //- Copy constructor setting internal field reference
124  (
127  );
128 
129  //- Construct and return a clone setting internal field reference
131  (
133  ) const
134  {
136  (
138  (
139  *this,
140  iF
141  )
142  );
143  }
144 
145 
146  // Member Functions
147 
148  //- Update the coefficients associated with the patch field
149  virtual void updateCoeffs();
150 
151  //- Write
152  virtual void write(Ostream&) const;
153 };
154 
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 } // End namespace Foam
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 #endif
163 
164 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Foam::fvPatchFieldMapper.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
This boundary condition adjusts the velocity for the given phase to achieve the specified mean thus c...
TypeName("outletPhaseMeanVelocity")
Runtime type information.
virtual tmp< fvPatchVectorField > clone(const DimensionedField< vector, volMesh > &iF) const
Construct and return a clone setting internal field reference.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
outletPhaseMeanVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
A class for managing temporary objects.
Definition: tmp.H:55
Namespace for OpenFOAM.