mappedFlowRateFvPatchVectorField.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) 2011-2019 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::mappedFlowRateFvPatchVectorField
26 
27 Description
28  Describes a volumetric/mass flow normal vector boundary condition by its
29  magnitude as an integral over its area.
30 
31  The inlet mass flux is taken from the neighbour region.
32 
33  The basis of the patch (volumetric or mass) is determined by the
34  dimensions of the flux, phi. The current density is used to correct the
35  velocity when applying the mass basis.
36 
37 Usage
38  \table
39  Property | Description | Required | Default value
40  phi | flux field name | no | phi
41  rho | density field name | no | rho
42  neigPhi | name of flux field on neighbour mesh | yes |
43  \endtable
44 
45  Example of the boundary condition specification:
46  \verbatim
47  <patchName>
48  {
49  type mappedFlowRate;
50  phi phi;
51  rho rho;
52  neigPhi phi;
53  value uniform (0 0 0); // placeholder
54  }
55  \endverbatim
56 
57 SourceFiles
58  mappedFlowRateFvPatchVectorField.C
59 
60 \*---------------------------------------------------------------------------*/
61 
62 #ifndef mappedFlowRateFvPatchVectorField_H
63 #define mappedFlowRateFvPatchVectorField_H
64 
66 
67 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
68 
69 namespace Foam
70 {
71 /*---------------------------------------------------------------------------*\
72  Class flowRateInletVelocityFvPatch Declaration
73 \*---------------------------------------------------------------------------*/
74 
75 class mappedFlowRateFvPatchVectorField
76 :
77  public fixedValueFvPatchVectorField
78 {
79  // Private Data
80 
81  //- Name of the neighbor flux setting the inlet mass flux
82  word nbrPhiName_;
83 
84  //- Name of the local mass flux
85  word phiName_;
86 
87  //- Name of the density field used to normalize the mass flux
88  word rhoName_;
89 
90 
91 public:
92 
93  //- Runtime type information
94  TypeName("mappedFlowRate");
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  // mappedFlowRateFvPatchVectorField
116  // onto a new patch
118  (
120  const fvPatch&,
122  const fvPatchFieldMapper&
123  );
124 
125  //- Copy constructor
127  (
129  );
130 
131  //- Construct and return a clone
132  virtual tmp<fvPatchVectorField> clone() const
133  {
135  (
137  );
138  }
139 
140  //- Copy constructor setting internal field reference
142  (
145  );
146 
147  //- Construct and return a clone setting internal field reference
149  (
151  ) const
152  {
154  (
155  new mappedFlowRateFvPatchVectorField(*this, iF)
156  );
157  }
158 
159 
160  // Member Functions
161 
162 
163  //- Update the coefficients associated with the patch field
164  virtual void updateCoeffs();
165 
166  //- Write
167  virtual void write(Ostream&) const;
169 };
170 
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 } // End namespace Foam
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 #endif
179 
180 // ************************************************************************* //
Describes a volumetric/mass flow normal vector boundary condition by its magnitude as an integral ove...
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
mappedFlowRateFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
A class for managing temporary objects.
Definition: PtrList.H:53
TypeName("mappedFlowRate")
Runtime type information.
Namespace for OpenFOAM.