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