radialActuationDiskSource.C
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-2018 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 \*---------------------------------------------------------------------------*/
25 
27 #include "geometricOneField.H"
29 
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31 
32 namespace Foam
33 {
34 namespace fv
35 {
36  defineTypeNameAndDebug(radialActuationDiskSource, 0);
38  (
39  option,
40  radialActuationDiskSource,
41  dictionary
42  );
43 }
44 }
45 
46 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
47 
49 (
50  const word& name,
51  const word& modelType,
52  const dictionary& dict,
53  const fvMesh& mesh
54 )
55 :
56  actuationDiskSource(name, modelType, dict, mesh),
57  radialCoeffs_(coeffs_.lookup("coeffs"))
58 {
59  Info<< " - creating radial actuation disk zone: " << name_ << endl;
60 }
61 
62 
63 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
64 
66 (
67  fvMatrix<vector>& eqn,
68  const label fieldi
69 )
70 {
71  const scalarField& cellsV = mesh_.V();
72  vectorField& Usource = eqn.source();
73  const vectorField& U = eqn.psi();
74 
75  if (V_ > vSmall)
76  {
77  addRadialActuationDiskAxialInertialResistance
78  (
79  Usource,
80  cells_,
81  cellsV,
83  U
84  );
85  }
86 }
87 
88 
90 (
91  const volScalarField& rho,
92  fvMatrix<vector>& eqn,
93  const label fieldi
94 )
95 {
96  const scalarField& cellsV = mesh_.V();
97  vectorField& Usource = eqn.source();
98  const vectorField& U = eqn.psi();
99 
100  if (V_ > vSmall)
101  {
102  addRadialActuationDiskAxialInertialResistance
103  (
104  Usource,
105  cells_,
106  cellsV,
107  rho,
108  U
109  );
110  }
111 }
112 
113 
115 {
116  if (actuationDiskSource::read(dict))
117  {
118  coeffs_.lookup("coeffs") >> radialCoeffs_;
119  return true;
120  }
121  else
122  {
123  return false;
124  }
125 }
126 
127 
128 // ************************************************************************* //
defineTypeNameAndDebug(option, 0)
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 list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
const GeometricField< Type, fvPatchField, volMesh > & psi() const
Definition: fvMatrix.H:282
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
addToRunTimeSelectionTable(option, fixedTemperatureConstraint, dictionary)
virtual void addSup(fvMatrix< vector > &eqn, const label fieldi)
Source term to momentum equation.
Macros for easy insertion into run-time selection tables.
radialActuationDiskSource(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
A class representing the concept of a GeometricField of 1 used to avoid unnecessary manipulations for...
A class for handling words, derived from string.
Definition: word.H:59
labelList fv(nPoints)
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
Field< Type > & source()
Definition: fvMatrix.H:292
virtual bool read(const dictionary &dict)
Read dictionary.
virtual bool read(const dictionary &dict)
Read dictionary.
U
Definition: pEqn.H:72
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
messageStream Info
Namespace for OpenFOAM.