All Classes Namespaces Files Functions Variables Typedefs Friends Macros Groups
cosVelocityFvPatchVectorField.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  Copyright (C) 2019 OpenCFD Ltd.
10  Copyright (C) 2016-2019 ISP RAS (www.ispras.ru) UniCFD Group (www.unicfd.ru)
11 -------------------------------------------------------------------------------
12 License
13  This file is part of QGDsolver library, based on OpenFOAM+.
14 
15  OpenFOAM is free software: you can redistribute it and/or modify it
16  under the terms of the GNU General Public License as published by
17  the Free Software Foundation, either version 3 of the License, or
18  (at your option) any later version.
19 
20  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
21  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
22  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23  for more details.
24 
25  You should have received a copy of the GNU General Public License
26  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
27 
28 Class
29  Foam::cosVelocityFvPatchVectorField
30 
31 Group
32  grpQGDBCs grpWallBoundaryConditions
33 
34 Description
35  This boundary condition sets the pressure gradient to the provided value
36  such that the flux on the boundary is that specified by the velocity
37  boundary condition.
38 
39 Usage
40  Example of the boundary condition specification:
41  \verbatim
42  <patchName>
43  {
44  type cosVelocity;
45  }
46  \endverbatim
47 
48 SourceFiles
49  cosVelocityFvPatchVectorField.C
50 
51 \*---------------------------------------------------------------------------*/
52 
53 #ifndef cosVelocityFvPatchVectorField_H
54 #define cosVelocityFvPatchVectorField_H
55 
56 #include "mixedFvPatchFields.H"
57 #include "coordinateSystem.H"
58 #include "Switch.H"
59 
60 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
61 
62 namespace Foam
63 {
64 
65 /*---------------------------------------------------------------------------*\
66  Class advectiveFvPatch Declaration
67 \*---------------------------------------------------------------------------*/
68 
70 :
71  public mixedFvPatchVectorField
72 {
73 protected:
74 
75  // Private data
76 
77  //-
78  vector A_;
79 
80  //-
81  scalar H_;
82 
83  //-
84  vector Hdirection_;
85 
86  //-
87  scalar omega0_;
88 
89  //-
90  scalar phi0_;
91 
92  //-
93  scalar minZ_;
94 
95 public:
96 
97  //- Runtime type information
98  TypeName("cosVelocity");
99 
101  // Constructors
102 
103  //- Construct from patch and internal field
105  (
106  const fvPatch&,
107  const DimensionedField<vector, volMesh>&
108  );
109 
110  //- Construct from patch, internal field and dictionary
112  (
113  const fvPatch&,
114  const DimensionedField<vector, volMesh>&,
115  const dictionary&
116  );
117 
118  //- Construct by mapping given cosVelocityFvPatchVectorField
119  // onto a new patch
121  (
123  const fvPatch&,
124  const DimensionedField<vector, volMesh>&,
125  const fvPatchFieldMapper&
126  );
127 
128  //- Construct as copy
130  (
132  );
133 
134  //- Construct and return a clone
135  virtual tmp<fvPatchVectorField > clone() const
136  {
137  return tmp<fvPatchVectorField>
138  (
140  );
141  }
142 
143  //- Construct as copy setting internal field reference
145  (
147  const DimensionedField<vector, volMesh>&
148  );
149 
150  //- Construct and return a clone setting internal field reference
151  virtual tmp<fvPatchVectorField> clone
152  (
153  const DimensionedField<vector, volMesh>& iF
154  ) const
155  {
156  return tmp<fvPatchVectorField>
157  (
158  new cosVelocityFvPatchVectorField(*this, iF)
159  );
160  }
161 
162 
163  // Member functions
164 
165  // Access
166  void setPatchVelocities(vectorField& pV);
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  virtual void autoMap (const fvPatchFieldMapper& );
176 
177  //-
178  virtual void rmap (const fvPatchVectorField& pf, const labelList& ll);
179 };
180 
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 } // End namespace Foam
185 
186 
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 #endif
190 
191 
192 // ************************************************************************* //
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
pf
Definition: updateFields.H:21
virtual void rmap(const fvPatchVectorField &pf, const labelList &ll)
This boundary condition sets the pressure gradient to the provided value such that the flux on the bo...
TypeName("cosVelocity")
Runtime type information.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual void write(Ostream &) const
Write.
cosVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
virtual void autoMap(const fvPatchFieldMapper &)