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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::fv::actuationDiskSource
28 
29 Group
30  grpFvOptionsSources
31 
32 Description
33  Actuation disk source
34 
35  Constant values for momentum source for actuation disk
36  \f[
37  T = 2 \rho A U_{o}^2 a (1-a)
38  \f]
39  and
40  \f[
41  U_1 = (1 - a)U_{o}
42  \f]
43 
44  where:
45  \vartable
46  A | disk area
47  U_o | upstream velocity
48  a | 1 - Cp/Ct
49  U_1 | velocity at the disk
50  \endvartable
51 
52 Usage
53  Example usage:
54  \verbatim
55  fields (U); // names of fields to apply source
56  diskDir (-1 0 0); // disk direction
57  Cp 0.1; // power coefficient
58  Ct 0.5; // thrust coefficient
59  diskArea 5.0; // disk area
60  upstreamPoint (0 0 0); // upstream point
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 "cellSetOption.H"
74 
75 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
76 
77 namespace Foam
78 {
79 namespace fv
80 {
81 
82 /*---------------------------------------------------------------------------*\
83  Class actuationDiskSource Declaration
84 \*---------------------------------------------------------------------------*/
85 
86 class actuationDiskSource
87 :
88  public cellSetOption
89 {
90 
91 protected:
92 
93  // Protected data
94 
95  //- Disk area normal
97 
98  //- Power coefficient
99  scalar Cp_;
100 
101  //- Thrust coefficient
102  scalar Ct_;
103 
104  //- Disk area
105  scalar diskArea_;
106 
107  //- Upstream point sample
109 
110  //- Upstream cell ID
112 
113 
114 private:
115 
116  // Private Member Functions
117 
118  //- Check data
119  void checkData() const;
120 
121  //- Add resistance to the UEqn
122  template<class RhoFieldType>
123  void addActuationDiskAxialInertialResistance
124  (
125  vectorField& Usource,
126  const labelList& cells,
127  const scalarField& V,
128  const RhoFieldType& rho,
129  const vectorField& U
130  ) const;
131 
132  //- No copy construct
133  actuationDiskSource(const actuationDiskSource&) = delete;
134 
135  //- No copy assignment
136  void operator=(const actuationDiskSource&) = delete;
137 
138 
139 public:
140 
141  //- Runtime type information
142  TypeName("actuationDiskSource");
143 
144 
145  // Constructors
146 
147  //- Construct from components
149  (
150  const word& name,
151  const word& modelType,
152  const dictionary& dict,
153  const fvMesh& mesh
154  );
155 
156 
157  //- Destructor
158  virtual ~actuationDiskSource() = default;
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:111
Foam::fv::actuationDiskSource::Ct
scalar Ct() const
Return Ct.
Definition: actuationDiskSource.H:187
Foam::fv::actuationDiskSource::Ct_
scalar Ct_
Thrust coefficient.
Definition: actuationDiskSource.H:117
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::fv::cellSetOption
Cell-set options abtract base class. Provides a base set of controls, e.g.:
Definition: cellSetOption.H:72
Foam::fv::option::name
const word & name() const
Return const access to the source name.
Definition: fvOptionI.H:30
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:69
Foam::fv::actuationDiskSource::diskArea_
scalar diskArea_
Disk area.
Definition: actuationDiskSource.H:120
rho
rho
Definition: readInitialConditions.H:96
cellSetOption.H
Foam::fv::cellSetOption::cells
const labelList & cells() const
Return const access to the cell set.
Definition: cellSetOptionI.H:75
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:62
Foam::fv::actuationDiskSource
Actuation disk source.
Definition: actuationDiskSource.H:101
Foam::Field< vector >
Foam::fv::actuationDiskSource::diskArea
scalar diskArea() const
Disk area.
Definition: actuationDiskSource.H:199
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::fv::actuationDiskSource::~actuationDiskSource
virtual ~actuationDiskSource()=default
Destructor.
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:84
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::vector
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:51
fv
labelList fv(nPoints)
U
U
Definition: pEqn.H:72
Foam::Vector< scalar >
Foam::List< label >
Foam::fv::actuationDiskSource::upstreamPoint_
point upstreamPoint_
Upstream point sample.
Definition: actuationDiskSource.H:123
Foam::fv::option::mesh
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvOptionI.H:36
Foam::fv::actuationDiskSource::read
virtual bool read(const dictionary &dict)
Read dictionary.
Definition: actuationDiskSource.C:163
Foam::fvMatrix
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvPatchField.H:76
actuationDiskSourceTemplates.C
Foam::fv::actuationDiskSource::addSup
virtual void addSup(fvMatrix< vector > &eqn, const label fieldi)
Source term to momentum equation.
Definition: actuationDiskSource.C:115
Foam::fv::actuationDiskSource::Cp_
scalar Cp_
Power coefficient.
Definition: actuationDiskSource.H:114
Foam::fv::actuationDiskSource::TypeName
TypeName("actuationDiskSource")
Runtime type information.
Foam::fv::actuationDiskSource::upstreamCellId_
label upstreamCellId_
Upstream cell ID.
Definition: actuationDiskSource.H:126
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::fv::actuationDiskSource::diskDir
const vector & diskDir() const
Normal disk direction.
Definition: actuationDiskSource.H:193