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  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
30 #include "geometricOneField.H"
32 
33 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34 
35 namespace Foam
36 {
37 namespace fv
38 {
39  defineTypeNameAndDebug(radialActuationDiskSource, 0);
40  addToRunTimeSelectionTable(option, radialActuationDiskSource, dictionary);
41 }
42 }
43 
44 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
45 
47 (
48  const word& name,
49  const word& modelType,
50  const dictionary& dict,
51  const fvMesh& mesh
52 )
53 :
54  actuationDiskSource(name, modelType, dict, mesh),
55  radialCoeffs_(coeffs_.lookup("coeffs"))
56 {
57  Info<< " - creating radial actuation disk zone: " << name_ << endl;
58 }
59 
60 
61 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
62 
64 (
65  fvMatrix<vector>& eqn,
66  const label fieldi
67 )
68 {
69  const scalarField& cellsV = mesh_.V();
70  vectorField& Usource = eqn.source();
71  const vectorField& U = eqn.psi();
72 
73  if (V_ > VSMALL)
74  {
75  addRadialActuationDiskAxialInertialResistance
76  (
77  Usource,
78  cells_,
79  cellsV,
81  U
82  );
83  }
84 }
85 
86 
88 (
89  const volScalarField& rho,
90  fvMatrix<vector>& eqn,
91  const label fieldi
92 )
93 {
94  const scalarField& cellsV = mesh_.V();
95  vectorField& Usource = eqn.source();
96  const vectorField& U = eqn.psi();
97 
98  if (V_ > VSMALL)
99  {
100  addRadialActuationDiskAxialInertialResistance
101  (
102  Usource,
103  cells_,
104  cellsV,
105  rho,
106  U
107  );
108  }
109 }
110 
111 
113 {
115  {
116  coeffs_.readEntry("coeffs", radialCoeffs_);
117 
118  return true;
119  }
120 
121  return false;
122 }
123 
124 
125 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::fv::radialActuationDiskSource::read
virtual bool read(const dictionary &dict)
Read source dictionary.
Definition: radialActuationDiskSource.C:112
Foam::geometricOneField
A class representing the concept of a GeometricField of 1 used to avoid unnecessary manipulations for...
Definition: geometricOneField.H:55
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
rho
rho
Definition: readInitialConditions.H:88
Foam::fv::actuationDiskSource
Applies sources on velocity (i.e. U) within a specified region to enable actuator disk models for aer...
Definition: actuationDiskSource.H:365
Foam::Field< scalar >
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
Foam::fv::option::coeffs_
dictionary coeffs_
Dictionary containing source coefficients.
Definition: fvOption.H:145
Foam::dictionary::readEntry
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
Definition: dictionaryTemplates.C:302
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::fvMatrix::psi
const GeometricField< Type, fvPatchField, volMesh > & psi(const label i=0) const
Return psi.
Definition: fvMatrix.H:399
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::fv::radialActuationDiskSource::radialActuationDiskSource
radialActuationDiskSource(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
Definition: radialActuationDiskSource.C:47
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:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
fv
labelList fv(nPoints)
U
U
Definition: pEqn.H:72
geometricOneField.H
Foam::fv::radialActuationDiskSource::addSup
virtual void addSup(fvMatrix< vector > &eqn, const label fieldi)
Add explicit contribution to momentum equation.
Definition: radialActuationDiskSource.C:64
Foam::fvMatrix::source
Field< Type > & source()
Definition: fvMatrix.H:445
Foam::fv::actuationDiskSource::read
virtual bool read(const dictionary &dict)
Read dictionary.
Definition: actuationDiskSource.C:279
radialActuationDiskSource.H
Foam::fvMatrix
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvPatchField.H:68
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
Foam::fv::defineTypeNameAndDebug
defineTypeNameAndDebug(atmAmbientTurbSource, 0)
Foam::fv::addToRunTimeSelectionTable
addToRunTimeSelectionTable(option, atmAmbientTurbSource, dictionary)
Foam::GeometricField< scalar, fvPatchField, volMesh >