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-2022 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 (\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  actuationDiskSource1
49  {
50  type actuationDiskSource;
51 
52  selectionMode 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 
64 SourceFiles
65  actuationDiskSource.C
66  actuationDiskSourceTemplates.C
67 
68 \*---------------------------------------------------------------------------*/
69 
70 #ifndef actuationDiskSource_H
71 #define actuationDiskSource_H
72 
73 #include "fvModel.H"
74 #include "fvCellSet.H"
75 
76 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
77 
78 namespace Foam
79 {
80 namespace fv
81 {
82 
83 /*---------------------------------------------------------------------------*\
84  Class actuationDiskSource Declaration
85 \*---------------------------------------------------------------------------*/
86 
87 class actuationDiskSource
88 :
89  public fvModel
90 {
91 protected:
92 
93  // Protected Data
94 
95  //- The set of cells the fvConstraint applies to
96  fvCellSet set_;
97 
98  //- The name of the phase to which this fvModel applies
99  word phaseName_;
100 
101  //- Name of the velocity field
102  word UName_;
103 
104  //- Disk area normal
106 
107  //- Power coefficient
108  scalar Cp_;
109 
110  //- Thrust coefficient
111  scalar Ct_;
112 
113  //- Disk area
114  scalar diskArea_;
115 
116  //- Upstream point sample
118 
119  //- Upstream cell ID
121 
123 private:
124 
125  // Private Member Functions
126 
127  //- Non-virtual read
128  void readCoeffs();
129 
130  //- Add resistance to the UEqn
131  template<class AlphaFieldType, class RhoFieldType>
132  void addActuationDiskAxialInertialResistance
133  (
134  vectorField& Usource,
135  const labelList& cells,
136  const scalarField& V,
137  const AlphaFieldType& alpha,
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  //- Explicit and implicit sources for phase equations
196  virtual void addSup
197  (
198  const volScalarField& alpha,
199  const volScalarField& rho,
200  fvMatrix<vector>& eqn,
201  const word& fieldName
202  ) const;
203 
204 
205  // Mesh changes
206 
207  //- Update for mesh motion
208  virtual bool movePoints();
209 
210  //- Update topology using the given map
211  virtual void topoChange(const polyTopoChangeMap&);
212 
213  //- Update from another mesh using the given map
214  virtual void mapMesh(const polyMeshMap&);
215 
216  //- Redistribute or update using the given distribution map
217  virtual void distribute(const polyDistributionMap&);
218 
219 
220  // IO
221 
222  //- Read dictionary
223  virtual bool read(const dictionary& dict);
224 
225 
226  // Member Operators
227 
228  //- Disallow default bitwise assignment
229  void operator=(const actuationDiskSource&) = delete;
230 };
231 
232 
233 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
234 
235 } // End namespace fv
236 } // End namespace Foam
237 
238 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
239 
240 #ifdef NoRepository
242 #endif
243 
244 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
245 
246 #endif
247 
248 // ************************************************************************* //
vector diskDir_
Disk area normal.
TypeName("actuationDiskSource")
Runtime type information.
label upstreamCellId_
Upstream cell ID.
dictionary dict
virtual ~actuationDiskSource()
Destructor.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
U
Definition: pEqn.H:72
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.
volScalarField alpha(IOobject("alpha", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
word UName_
Name of the velocity field.
actuationDiskSource(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvModelI.H:34
void operator=(const actuationDiskSource &)=delete
Disallow default bitwise assignment.
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)
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
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.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:95
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
Class containing mesh-to-mesh mapping information.
Definition: polyMeshMap.H:50
word phaseName_
The name of the phase to which this fvModel applies.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual bool movePoints()
Update for mesh motion.
Namespace for OpenFOAM.