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-2023 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 {
38  (
39  fvModel,
42  );
43 }
44 }
45 
46 // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
47 
48 void Foam::fv::radialActuationDiskSource::readCoeffs()
49 {
50  coeffs().lookup("coeffs") >> radialCoeffs_;
51 }
52 
53 
54 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
55 
57 (
58  const word& name,
59  const word& modelType,
60  const fvMesh& mesh,
61  const dictionary& dict
62 )
63 :
64  actuationDiskSource(name, modelType, mesh, dict),
65  radialCoeffs_()
66 {
67  readCoeffs();
68 }
69 
70 
71 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
72 
74 (
75  fvMatrix<vector>& eqn,
76  const word& fieldName
77 ) const
78 {
79  const scalarField& cellsV = mesh().V();
80  vectorField& Usource = eqn.source();
81  const vectorField& U = eqn.psi();
82 
83  addRadialActuationDiskAxialInertialResistance
84  (
85  Usource,
86  set_.cells(),
87  cellsV,
89  U
90  );
91 }
92 
93 
95 (
96  const volScalarField& rho,
97  fvMatrix<vector>& eqn,
98  const word& fieldName
99 ) const
100 {
101  const scalarField& cellsV = mesh().V();
102  vectorField& Usource = eqn.source();
103  const vectorField& U = eqn.psi();
104 
105  addRadialActuationDiskAxialInertialResistance
106  (
107  Usource,
108  set_.cells(),
109  cellsV,
110  rho,
111  U
112  );
113 }
114 
115 
117 {
119  {
120  readCoeffs();
121  return true;
122  }
123  else
124  {
125  return false;
126  }
127 }
128 
129 
130 // ************************************************************************* //
Macros for easy insertion into run-time selection tables.
Generic GeometricField class.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Definition: dictionary.C:860
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvMatrix.H:118
Field< Type > & source()
Definition: fvMatrix.H:307
VolField< Type > & psi()
Definition: fvMatrix.H:289
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:101
Finite volume model abstract base class.
Definition: fvModel.H:59
const dictionary & coeffs() const
Return dictionary.
Definition: fvModelI.H:40
virtual bool read(const dictionary &dict)
Read dictionary.
Actuation disk source including radial thrust.
radialActuationDiskSource(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from components.
virtual bool read(const dictionary &dict)
Read dictionary.
virtual void addSup(fvMatrix< vector > &eqn, const word &fieldName) const
Source term to momentum equation.
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:62
U
Definition: pEqn.H:72
addToRunTimeSelectionTable(fvConstraint, bound, dictionary)
defineTypeNameAndDebug(bound, 0)
Namespace for OpenFOAM.
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
labelList fv(nPoints)
dictionary dict