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-2019 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  fields (U); // names of fields to apply source
51  diskDir (-1 0 0); // disk direction
52  Cp 0.1; // power coefficient
53  Ct 0.5; // thrust coefficient
54  diskArea 5.0; // disk area
55  upstreamPoint (0 0 0); // upstream point
56  \endverbatim
57 
58 
59 SourceFiles
60  actuationDiskSource.C
61  actuationDiskSourceTemplates.C
62 
63 \*---------------------------------------------------------------------------*/
64 
65 #ifndef actuationDiskSource_H
66 #define actuationDiskSource_H
67 
68 #include "cellSetOption.H"
69 
70 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
71 
72 namespace Foam
73 {
74 namespace fv
75 {
76 
77 /*---------------------------------------------------------------------------*\
78  Class actuationDiskSource Declaration
79 \*---------------------------------------------------------------------------*/
80 
81 class actuationDiskSource
82 :
83  public cellSetOption
84 {
85 
86 protected:
87 
88  // Protected data
89 
90  //- Disk area normal
92 
93  //- Power coefficient
94  scalar Cp_;
95 
96  //- Thrust coefficient
97  scalar Ct_;
98 
99  //- Disk area
100  scalar diskArea_;
101 
102  //- Upstream point sample
104 
105  //- Upstream cell ID
107 
108 
109 private:
110 
111  // Private Member Functions
113  //- Check data
114  void checkData() const;
116  //- Add resistance to the UEqn
117  template<class RhoFieldType>
118  void addActuationDiskAxialInertialResistance
119  (
120  vectorField& Usource,
121  const labelList& cells,
122  const scalarField& V,
123  const RhoFieldType& rho,
124  const vectorField& U
125  ) const;
126 
127 
128 public:
129 
130  //- Runtime type information
131  TypeName("actuationDiskSource");
132 
133 
134  // Constructors
135 
136  //- Construct from components
138  (
139  const word& name,
140  const word& modelType,
141  const dictionary& dict,
142  const fvMesh& mesh
143  );
144 
145  //- Disallow default bitwise copy construction
146  actuationDiskSource(const actuationDiskSource&) = delete;
147 
148 
149  //- Destructor
150  virtual ~actuationDiskSource()
151  {}
152 
153 
154  // Member Functions
155 
156  // Access
157 
158  //- Return Cp
159  scalar Cp() const
160  {
161  return Cp_;
162  }
163 
164  //- Return Ct
165  scalar Ct() const
166  {
167  return Ct_;
168  }
169 
170  //- Normal disk direction
171  const vector& diskDir() const
172  {
173  return diskDir_;
174  }
175 
176  //- Disk area
177  scalar diskArea() const
178  {
179  return diskArea_;
180  }
181 
182 
183  // Add explicit and implicit contributions
184 
185  //- Source term to momentum equation
186  virtual void addSup
187  (
188  fvMatrix<vector>& eqn,
189  const label fieldi
190  );
191 
192  //- Source term to compressible momentum equation
193  virtual void addSup
194  (
195  const volScalarField& rho,
196  fvMatrix<vector>& eqn,
197  const label fieldi
198  );
199 
200 
201  // IO
202 
203  //- Read dictionary
204  virtual bool read(const dictionary& dict);
205 
206 
207  // Member Operators
208 
209  //- Disallow default bitwise assignment
210  void operator=(const actuationDiskSource&) = delete;
211 };
212 
213 
214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215 
216 } // End namespace fv
217 } // End namespace Foam
218 
219 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220 
221 #ifdef NoRepository
223 #endif
224 
225 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
226 
227 #endif
228 
229 // ************************************************************************* //
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
scalar diskArea() const
Disk area.
const vector & diskDir() const
Normal disk direction.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
point upstreamPoint_
Upstream point sample.
scalar Cp() const
Return Cp.
const labelList & cells() const
Return const access to the cell set.
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: fvOptionI.H:34
scalar V() const
Return const access to the total cell volume.
void operator=(const actuationDiskSource &)=delete
Disallow default bitwise assignment.
A class for handling words, derived from string.
Definition: word.H:59
labelList fv(nPoints)
virtual void addSup(fvMatrix< vector > &eqn, const label fieldi)
Source term to momentum equation.
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
const word & name() const
Return const access to the source name.
Definition: fvOptionI.H:28
scalar Cp_
Power coefficient.
virtual bool read(const dictionary &dict)
Read dictionary.
scalar Ct() const
Return Ct.
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.