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