radialActuationDiskSource.C
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-2016 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 \*---------------------------------------------------------------------------*/
27 
29 #include "geometricOneField.H"
31 
32 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
36 namespace fv
37 {
38  defineTypeNameAndDebug(radialActuationDiskSource, 0);
40  (
41  option,
42  radialActuationDiskSource,
43  dictionary
44  );
45 }
46 }
47 
48 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
49 
50 Foam::fv::radialActuationDiskSource::radialActuationDiskSource
51 (
52  const word& name,
53  const word& modelType,
54  const dictionary& dict,
55  const fvMesh& mesh
56 )
57 :
58  actuationDiskSource(name, modelType, dict, mesh),
59  radialCoeffs_(coeffs_.lookup("coeffs"))
60 {
61  Info<< " - creating radial actuation disk zone: " << name_ << endl;
62 }
63 
64 
65 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
66 
68 (
69  fvMatrix<vector>& eqn,
70  const label fieldi
71 )
72 {
73  const scalarField& cellsV = mesh_.V();
74  vectorField& Usource = eqn.source();
75  const vectorField& U = eqn.psi();
76 
77  if (V_ > VSMALL)
78  {
79  addRadialActuationDiskAxialInertialResistance
80  (
81  Usource,
82  cells_,
83  cellsV,
85  U
86  );
87  }
88 }
89 
90 
92 (
93  const volScalarField& rho,
94  fvMatrix<vector>& eqn,
95  const label fieldi
96 )
97 {
98  const scalarField& cellsV = mesh_.V();
99  vectorField& Usource = eqn.source();
100  const vectorField& U = eqn.psi();
101 
102  if (V_ > VSMALL)
103  {
104  addRadialActuationDiskAxialInertialResistance
105  (
106  Usource,
107  cells_,
108  cellsV,
109  rho,
110  U
111  );
112  }
113 }
114 
115 
117 {
119  {
120  coeffs_.readEntry("coeffs", radialCoeffs_);
121  return true;
122  }
123 
124  return false;
125 }
126 
127 
128 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::fv::radialActuationDiskSource::read
virtual bool read(const dictionary &dict)
Read dictionary.
Definition: radialActuationDiskSource.C:116
Foam::geometricOneField
A class representing the concept of a GeometricField of 1 used to avoid unnecessary manipulations for...
Definition: geometricOneField.H:54
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:337
rho
rho
Definition: readInitialConditions.H:96
Foam::fvMatrix::psi
const GeometricField< Type, fvPatchField, volMesh > & psi() const
Definition: fvMatrix.H:285
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< scalar >
Foam::Info
messageStream Info
Information stream (uses stdout - output is on the master only)
Foam::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
Foam::fv::option::coeffs_
dictionary coeffs_
Dictionary containing source coefficients.
Definition: fvOption.H:88
Foam::dictionary::readEntry
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
Definition: dictionaryTemplates.C:314
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
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:84
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
fv
labelList fv(nPoints)
Foam::fv::defineTypeNameAndDebug
defineTypeNameAndDebug(option, 0)
U
U
Definition: pEqn.H:72
Foam::fv::addToRunTimeSelectionTable
addToRunTimeSelectionTable(option, fixedTemperatureConstraint, dictionary)
geometricOneField.H
Foam::fv::radialActuationDiskSource::addSup
virtual void addSup(fvMatrix< vector > &eqn, const label fieldi)
Source term to momentum equation.
Definition: radialActuationDiskSource.C:68
Foam::fvMatrix::source
Field< Type > & source()
Definition: fvMatrix.H:295
Foam::fv::actuationDiskSource::read
virtual bool read(const dictionary &dict)
Read dictionary.
Definition: actuationDiskSource.C:163
radialActuationDiskSource.H
Foam::fvMatrix
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvPatchField.H:76
Foam::GeometricField< scalar, fvPatchField, volMesh >