actuationDiskSource.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-2021 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::fv::actuationDiskSource
26 
27 Description
28  Actuation disk source
29 
30  Constant values for momentum source for actuation disk
31  \f[
32  T = 2 \rho A U_{o}^2 a (1-a)
33  \f]
34  and
35  \f[
36  U_1 = (1 - a)U_{o}
37  \f]
38 
39  where:
40  \vartable
41  A | disk area
42  U_o | upstream velocity
43  a | 1 - Cp/Ct
44  U_1 | velocity at the disk
45  \endvartable
46 
47 Usage
48  Example usage:
49  \verbatim
50  actuationDiskSource1
51  {
52  type actuationDiskSource;
53 
54  selectionMode cellSet;
55  cellSet actuationDisk1;
56 
57  U U; // Name of the velocity field
58 
59  diskDir (-1 0 0); // Disk direction
60  Cp 0.1; // Power coefficient
61  Ct 0.5; // Thrust coefficient
62  diskArea 5.0; // Disk area
63  upstreamPoint (0 0 0); // Upstream point
64  }
65  \endverbatim
66 
67 
68 SourceFiles
69  actuationDiskSource.C
70  actuationDiskSourceTemplates.C
71 
72 \*---------------------------------------------------------------------------*/
73 
74 #ifndef actuationDiskSource_H
75 #define actuationDiskSource_H
76 
77 #include "fvModel.H"
78 #include "fvCellSet.H"
79 
80 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
81 
82 namespace Foam
83 {
84 namespace fv
85 {
86 
87 /*---------------------------------------------------------------------------*\
88  Class actuationDiskSource Declaration
89 \*---------------------------------------------------------------------------*/
90 
91 class actuationDiskSource
92 :
93  public fvModel
94 {
95 protected:
96 
97  // Protected Data
98 
99  //- The set of cells the fvConstraint applies to
100  fvCellSet set_;
101 
102  //- Name of the velocity field
103  word UName_;
104 
105  //- Disk area normal
107 
108  //- Power coefficient
109  scalar Cp_;
110 
111  //- Thrust coefficient
112  scalar Ct_;
113 
114  //- Disk area
115  scalar diskArea_;
116 
117  //- Upstream point sample
119 
120  //- Upstream cell ID
122 
123 
124 private:
125 
126  // Private Member Functions
128  //- Non-virtual read
129  void readCoeffs();
131  //- Add resistance to the UEqn
132  template<class RhoFieldType>
133  void addActuationDiskAxialInertialResistance
134  (
135  vectorField& Usource,
136  const labelList& cells,
137  const scalarField& V,
138  const RhoFieldType& rho,
139  const vectorField& U
140  ) const;
141 
142 
143 public:
144 
145  //- Runtime type information
146  TypeName("actuationDiskSource");
147 
148 
149  // Constructors
150 
151  //- Construct from components
153  (
154  const word& name,
155  const word& modelType,
156  const dictionary& dict,
157  const fvMesh& mesh
158  );
159 
160  //- Disallow default bitwise copy construction
161  actuationDiskSource(const actuationDiskSource&) = delete;
162 
163 
164  //- Destructor
165  virtual ~actuationDiskSource()
166  {}
167 
168 
169  // Member Functions
170 
171  // Checks
172 
173  //- Return the list of fields for which the fvModel adds source term
174  // to the transport equation
175  virtual wordList addSupFields() const;
176 
177 
178  // Add explicit and implicit contributions
179 
180  //- Source term to momentum equation
181  virtual void addSup
182  (
183  fvMatrix<vector>& eqn,
184  const word& fieldName
185  ) const;
186 
187  //- Source term to compressible momentum equation
188  virtual void addSup
189  (
190  const volScalarField& rho,
191  fvMatrix<vector>& eqn,
192  const word& fieldName
193  ) const;
194 
195 
196  // Mesh motion
197 
198  //- Update for mesh changes
199  virtual void updateMesh(const mapPolyMesh&);
200 
201 
202  // IO
203 
204  //- Read dictionary
205  virtual bool read(const dictionary& dict);
206 
207 
208  // Member Operators
209 
210  //- Disallow default bitwise assignment
211  void operator=(const actuationDiskSource&) = delete;
212 };
213 
214 
215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 
217 } // End namespace fv
218 } // End namespace Foam
219 
220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221 
222 #ifdef NoRepository
224 #endif
225 
226 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
227 
228 #endif
229 
230 // ************************************************************************* //
vector diskDir_
Disk area normal.
TypeName("actuationDiskSource")
Runtime type information.
label upstreamCellId_
Upstream cell ID.
dictionary dict
virtual ~actuationDiskSource()
Destructor.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
const word & name() const
Return const access to the source name.
Definition: fvModelI.H:28
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
point upstreamPoint_
Upstream point sample.
fvCellSet set_
The set of cells the fvConstraint applies to.
word UName_
Name of the velocity field.
actuationDiskSource(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvModelI.H:34
void operator=(const actuationDiskSource &)=delete
Disallow default bitwise assignment.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
virtual void updateMesh(const mapPolyMesh &)
Update for mesh changes.
virtual wordList addSupFields() const
Return the list of fields for which the fvModel adds source term.
virtual void addSup(fvMatrix< vector > &eqn, const word &fieldName) const
Source term to momentum equation.
const cellShapeList & cells
A class for handling words, derived from string.
Definition: word.H:59
labelList fv(nPoints)
A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
Definition: fvPatchField.H:72
scalar Cp_
Power coefficient.
virtual bool read(const dictionary &dict)
Read dictionary.
scalar Ct_
Thrust coefficient.
U
Definition: pEqn.H:72
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Namespace for OpenFOAM.