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
116 
117  //- Check data
118  void checkData() const;
119 
120  //- Add resistance to the UEqn
121  template<class RhoFieldType>
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 // ************************************************************************* //
Foam::fv::actuationDiskSource::diskDir_
vector diskDir_
Disk area normal.
Definition: actuationDiskSource.H:110
Foam::fv::actuationDiskSource::Ct
scalar Ct() const
Return Ct.
Definition: actuationDiskSource.H:187
Foam::fv::actuationDiskSource::Ct_
scalar Ct_
Thrust coefficient.
Definition: actuationDiskSource.H:116
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::fv::cellSetOption
Cell-set options abtract base class. Provides a base set of controls, e.g.
Definition: cellSetOption.H:71
Foam::fv::option::name
const word & name() const
Return const access to the source name.
Definition: fvOptionI.H:28
Foam::fv::actuationDiskSource::Cp
scalar Cp() const
Return Cp.
Definition: actuationDiskSource.H:181
Foam::fv::cellSetOption::V
scalar V() const
Return const access to the total cell volume.
Definition: cellSetOptionI.H:67
Foam::fv::actuationDiskSource::diskArea_
scalar diskArea_
Disk area.
Definition: actuationDiskSource.H:119
cellSetOption.H
Foam::fv::cellSetOption::cells
const labelList & cells() const
Return const access to the cell set.
Definition: cellSetOptionI.H:73
U
U
Definition: pEqn.H:46
Foam::fv::actuationDiskSource::actuationDiskSource
actuationDiskSource(const actuationDiskSource &)
Disallow default bitwise copy construct.
Foam::label
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
Foam::fv::actuationDiskSource
Actuation disk source.
Definition: actuationDiskSource.H:100
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::fv::actuationDiskSource::diskArea
scalar diskArea() const
Disk area.
Definition: actuationDiskSource.H:199
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::fv::actuationDiskSource::operator=
void operator=(const actuationDiskSource &)
Disallow default bitwise assignment.
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::fv::actuationDiskSource::~actuationDiskSource
virtual ~actuationDiskSource()
Destructor.
Definition: actuationDiskSource.H:172
Foam::vector
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49
rho
rho
Definition: pEqn.H:3
fv
labelList fv(nPoints)
Foam::fv::actuationDiskSource::addActuationDiskAxialInertialResistance
void addActuationDiskAxialInertialResistance(vectorField &Usource, const labelList &cells, const scalarField &V, const RhoFieldType &rho, const vectorField &U) const
Add resistance to the UEqn.
Definition: actuationDiskSourceTemplates.C:33
Foam::Vector< scalar >
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::fv::actuationDiskSource::upstreamPoint_
point upstreamPoint_
Upstream point sample.
Definition: actuationDiskSource.H:122
Foam::fv::option::mesh
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvOptionI.H:34
Foam::fv::actuationDiskSource::read
virtual bool read(const dictionary &dict)
Read dictionary.
Definition: actuationDiskSource.C:161
Foam::fvMatrix
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvPatchField.H:68
Foam::fv::actuationDiskSource::checkData
void checkData() const
Check data.
Definition: actuationDiskSource.C:51
actuationDiskSourceTemplates.C
Foam::fv::actuationDiskSource::Cp_
scalar Cp_
Power coefficient.
Definition: actuationDiskSource.H:113
Foam::fv::actuationDiskSource::TypeName
TypeName("actuationDiskSource")
Runtime type information.
Foam::fv::actuationDiskSource::addSup
virtual void addSup(fvMatrix< vector > &eqn, const label fieldI)
Source term to momentum equation.
Definition: actuationDiskSource.C:113
Foam::fv::actuationDiskSource::upstreamCellId_
label upstreamCellId_
Upstream cell ID.
Definition: actuationDiskSource.H:125
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
Foam::fv::actuationDiskSource::diskDir
const vector & diskDir() const
Normal disk direction.
Definition: actuationDiskSource.H:193