ENH: autoLayerDriver: better layering information message
[OpenFOAM-2.0.x.git] / src / finiteVolume / cfdTools / general / fieldSources / basicSource / radialActuationDiskSource / radialActuationDiskSource.C
blobe01a2a57361dbe299df301675f59953669972323
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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 the
13     Free Software Foundation; either version 3 of the License, or (at your
14     option) any later version.
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.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*----------------------------------------------------------------------------*/
27 #include "radialActuationDiskSource.H"
28 #include "geometricOneField.H"
29 #include "addToRunTimeSelectionTable.H"
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33 namespace Foam
35     defineTypeNameAndDebug(radialActuationDiskSource, 0);
36     addToRunTimeSelectionTable
37     (
38         basicSource,
39         radialActuationDiskSource,
40         dictionary
41     );
45 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
47 Foam::radialActuationDiskSource::radialActuationDiskSource
49     const word& name,
50     const word& modelType,
51     const dictionary& dict,
52     const fvMesh& mesh
55     actuationDiskSource(name, modelType, dict, mesh),
56     dict_(dict.subDict(modelType + "Coeffs")),
57     coeffs_()
59     dict_.lookup("coeffs") >> coeffs_;
60     Info<< "    - creating radial actuation disk zone: "
61         << this->name() << endl;
65 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
67 void Foam::radialActuationDiskSource::addSu(fvMatrix<vector>& UEqn)
69     bool compressible = false;
70     if (UEqn.dimensions() == dimensionSet(1, 1, -2, 0, 0))
71     {
72         compressible = true;
73     }
75     const scalarField& cellsV = this->mesh().V();
76     vectorField& Usource = UEqn.source();
77     const vectorField& U = UEqn.psi();
79     if (V() > VSMALL)
80     {
81         if (compressible)
82         {
83             addRadialActuationDiskAxialInertialResistance
84             (
85                 Usource,
86                 cells_,
87                 cellsV,
88                 this->mesh().lookupObject<volScalarField>("rho"),
89                 U
90             );
91         }
92         else
93         {
94             addRadialActuationDiskAxialInertialResistance
95             (
96                 Usource,
97                 cells_,
98                 cellsV,
99                 geometricOneField(),
100                 U
101             );
102         }
103     }
107 void Foam::radialActuationDiskSource::writeData(Ostream& os) const
109     actuationDiskSource::writeData(os);
113 bool Foam::radialActuationDiskSource::read(const dictionary& dict)
115     if (basicSource::read(dict))
116     {
117         const dictionary& sourceDict = dict.subDict(name());
118         const dictionary& subDictCoeffs =
119             sourceDict.subDict(typeName + "Coeffs");
120         subDictCoeffs.readIfPresent("diskDir", diskDir_);
121         subDictCoeffs.readIfPresent("Cp", Cp_);
122         subDictCoeffs.readIfPresent("Ct", Ct_);
123         subDictCoeffs.readIfPresent("diskArea", diskArea_);
124         subDictCoeffs.lookup("coeffs") >> coeffs_;
125         return true;
126     }
127     else
128     {
129         return false;
130     }
134 // ************************************************************************* //