1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
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
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 * * * * * * * * * * * * * //
35 defineTypeNameAndDebug(radialActuationDiskSource, 0);
36 addToRunTimeSelectionTable
39 radialActuationDiskSource,
45 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
47 Foam::radialActuationDiskSource::radialActuationDiskSource
50 const word& modelType,
51 const dictionary& dict,
55 actuationDiskSource(name, modelType, dict, mesh),
56 dict_(dict.subDict(modelType + "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))
75 const scalarField& cellsV = this->mesh().V();
76 vectorField& Usource = UEqn.source();
77 const vectorField& U = UEqn.psi();
83 addRadialActuationDiskAxialInertialResistance
88 this->mesh().lookupObject<volScalarField>("rho"),
94 addRadialActuationDiskAxialInertialResistance
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))
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_;
134 // ************************************************************************* //