actuationDisk.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-2024 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::actuationDisk
26 
27 Description
28  Actuation disk source
29 
30  Constant values for momentum source for actuation disk
31  \f[
32  T = 2 \rho A (\hat{d}\dot U_{o})^2 a (1-a) \hat{d}
33  \f]
34 
35  where:
36  \vartable
37  A | Disk area
38  dHat | Unit disk direction
39  U_o | Upstream velocity
40  a | 1 - Cp/Ct
41  Cp | Power coefficient
42  Ct | Thrust coefficient
43  \endvartable
44 
45 Usage
46  Example usage:
47  \verbatim
48  actuationDisk1
49  {
50  type actuationDisk;
51 
52  select cellSet;
53  cellSet actuationDisk1;
54 
55  diskDir (-1 0 0); // Disk direction
56  Cp 0.1; // Power coefficient
57  Ct 0.5; // Thrust coefficient
58  diskArea 5.0; // Disk area
59  upstreamPoint (0 0 0); // Upstream point
60  }
61  \endverbatim
62 
63 SourceFiles
64  actuationDisk.C
65  actuationDiskTemplates.C
66 
67 \*---------------------------------------------------------------------------*/
68 
69 #ifndef actuationDisk_H
70 #define actuationDisk_H
71 
72 #include "fvModel.H"
73 #include "fvCellSet.H"
74 
75 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
76 
77 namespace Foam
78 {
79 namespace fv
80 {
81 
82 /*---------------------------------------------------------------------------*\
83  Class actuationDisk Declaration
84 \*---------------------------------------------------------------------------*/
85 
86 class actuationDisk
87 :
88  public fvModel
89 {
90 protected:
91 
92  // Protected Data
93 
94  //- The set of cells the fvConstraint applies to
95  fvCellSet set_;
96 
97  //- The name of the phase to which this fvModel applies
98  word phaseName_;
99 
100  //- Name of the velocity field
101  word UName_;
102 
103  //- Disk area normal
105 
106  //- Power coefficient
107  scalar Cp_;
108 
109  //- Thrust coefficient
110  scalar Ct_;
111 
112  //- Disk area
113  scalar diskArea_;
114 
115  //- Upstream point sample
117 
118  //- Upstream cell ID
120 
121 
122 private:
123 
124  // Private Member Functions
125 
126  //- Non-virtual read
127  void readCoeffs();
128 
129  //- Add resistance to the UEqn
130  template<class AlphaFieldType, class RhoFieldType>
131  inline void addActuationDiskAxialInertialResistance
132  (
133  vectorField& Usource,
134  const labelList& cells,
135  const scalarField& V,
136  const AlphaFieldType& alpha,
137  const RhoFieldType& rho,
138  const vectorField& U
139  ) const;
140 
141 
142 public:
143 
144  //- Runtime type information
145  TypeName("actuationDisk");
146 
147 
148  // Constructors
149 
150  //- Construct from components
152  (
153  const word& name,
154  const word& modelType,
155  const fvMesh& mesh,
156  const dictionary& dict
157  );
158 
159  //- Disallow default bitwise copy construction
160  actuationDisk(const actuationDisk&) = delete;
161 
162 
163  //- Destructor
164  virtual ~actuationDisk()
165  {}
166 
167 
168  // Member Functions
169 
170  // Checks
171 
172  //- Return the list of fields for which the fvModel adds source term
173  // to the transport equation
174  virtual wordList addSupFields() const;
175 
176 
177  // Add explicit and implicit contributions
178 
179  //- Source term to momentum equation
180  virtual void addSup
181  (
182  const volVectorField& U,
184  ) const;
185 
186  //- Source term to compressible momentum equation
187  virtual void addSup
188  (
189  const volScalarField& rho,
190  const volVectorField& U,
191  fvMatrix<vector>& eqn
192  ) const;
193 
194  //- Explicit and implicit sources for phase equations
195  virtual void addSup
196  (
197  const volScalarField& alpha,
198  const volScalarField& rho,
199  const volVectorField& U,
200  fvMatrix<vector>& eqn
201  ) const;
202 
203 
204  // Mesh changes
205 
206  //- Update for mesh motion
207  virtual bool movePoints();
208 
209  //- Update topology using the given map
210  virtual void topoChange(const polyTopoChangeMap&);
211 
212  //- Update from another mesh using the given map
213  virtual void mapMesh(const polyMeshMap&);
214 
215  //- Redistribute or update using the given distribution map
216  virtual void distribute(const polyDistributionMap&);
217 
218 
219  // IO
220 
221  //- Read dictionary
222  virtual bool read(const dictionary& dict);
223 
224 
225  // Member Operators
226 
227  //- Disallow default bitwise assignment
228  void operator=(const actuationDisk&) = delete;
229 };
230 
231 
232 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
233 
234 } // End namespace fv
235 } // End namespace Foam
236 
237 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
238 
239 #endif
240 
241 // ************************************************************************* //
Generic GeometricField class.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvMatrix.H:118
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:99
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvModelI.H:53
const word & name() const
Return const access to the source name.
Definition: fvModelI.H:47
Actuation disk source.
virtual bool movePoints()
Update for mesh motion.
virtual void addSup(const volVectorField &U, fvMatrix< vector > &eqn) const
Source term to momentum equation.
virtual wordList addSupFields() const
Return the list of fields for which the fvModel adds source term.
scalar Cp_
Power coefficient.
virtual ~actuationDisk()
Destructor.
word UName_
Name of the velocity field.
word phaseName_
The name of the phase to which this fvModel applies.
vector diskDir_
Disk area normal.
void operator=(const actuationDisk &)=delete
Disallow default bitwise assignment.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
virtual bool read(const dictionary &dict)
Read dictionary.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
point upstreamPoint_
Upstream point sample.
actuationDisk(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from components.
fvCellSet set_
The set of cells the fvConstraint applies to.
label upstreamCellId_
Upstream cell ID.
TypeName("actuationDisk")
Runtime type information.
scalar diskArea_
Disk area.
scalar Ct_
Thrust coefficient.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Definition: polyMeshMap.H:51
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A class for handling words, derived from string.
Definition: word.H:62
const cellShapeList & cells
U
Definition: pEqn.H:72
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
Namespace for OpenFOAM.
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
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49
labelList fv(nPoints)
dictionary dict