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-2021 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  fvModel,
40  radialActuationDiskSource,
41  dictionary
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 dictionary& dict,
61  const fvMesh& mesh
62 )
63 :
64  actuationDiskSource(name, modelType, dict, mesh),
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  if (set_.V() > vSmall)
84  {
85  addRadialActuationDiskAxialInertialResistance
86  (
87  Usource,
88  set_.cells(),
89  cellsV,
91  U
92  );
93  }
94 }
95 
96 
98 (
99  const volScalarField& rho,
100  fvMatrix<vector>& eqn,
101  const word& fieldName
102 ) const
103 {
104  const scalarField& cellsV = mesh().V();
105  vectorField& Usource = eqn.source();
106  const vectorField& U = eqn.psi();
107 
108  if (set_.V() > vSmall)
109  {
110  addRadialActuationDiskAxialInertialResistance
111  (
112  Usource,
113  set_.cells(),
114  cellsV,
115  rho,
116  U
117  );
118  }
119 }
120 
121 
123 {
124  if (actuationDiskSource::read(dict))
125  {
126  readCoeffs();
127  return true;
128  }
129  else
130  {
131  return false;
132  }
133 }
134 
135 
136 // ************************************************************************* //
defineTypeNameAndDebug(fixedTemperatureConstraint, 0)
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
const GeometricField< Type, fvPatchField, volMesh > & psi() const
Definition: fvMatrix.H:282
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.
dynamicFvMesh & mesh
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.
addToRunTimeSelectionTable(fvConstraint, fixedTemperatureConstraint, dictionary)
virtual bool read(const dictionary &dict)
Read dictionary.
U
Definition: pEqn.H:72
virtual void addSup(fvMatrix< vector > &eqn, const word &fieldName) const
Source term to momentum equation.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Namespace for OpenFOAM.