FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

actuationDiskSource.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 2010-2010 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 3 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Foam::actuationDiskSource
00027 
00028 Description
00029     Actuation disk zone definition.
00030     Constant values for momentum source for actuation disk
00031 
00032     T = 2*rho*A*sqr(Uo)*a*(1-a)
00033     U1 = (1 -a)Uo
00034     where:
00035           A: disk area
00036           Uo: upstream velocity
00037           a: 1 - Cp/Ct
00038           U1: velocity at the disk
00039 
00040 SourceFiles
00041     actuationDiskSource.C
00042     actuationDiskSourceTemplates.C
00043 
00044 \*---------------------------------------------------------------------------*/
00045 
00046 #ifndef actuationDiskSource_H
00047 #define actuationDiskSource_H
00048 
00049 #include <OpenFOAM/IOdictionary.H>
00050 #include <meshTools/coordinateSystem.H>
00051 #include <meshTools/coordinateSystems.H>
00052 #include <OpenFOAM/wordList.H>
00053 #include <OpenFOAM/labelList.H>
00054 #include <OpenFOAM/DimensionedField.H>
00055 #include <finiteVolume/volFieldsFwd.H>
00056 #include <finiteVolume/fvMatricesFwd.H>
00057 #include <finiteVolume/basicSource.H>
00058 
00059 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00060 
00061 namespace Foam
00062 {
00063 
00064 /*---------------------------------------------------------------------------*\
00065                      Class actuationDiskSource Declaration
00066 \*---------------------------------------------------------------------------*/
00067 
00068 class actuationDiskSource
00069 :
00070     public basicSource
00071 {
00072     // Private data
00073 
00074         //- Cell zone ID
00075         label cellZoneID_;
00076 
00077         //- Sub dictionary with actuationDisk information
00078         const dictionary& dict_;
00079 
00080         //- Disk area normal
00081         vector diskDir_;
00082 
00083         //- Power coefficient
00084         scalar Cp_;
00085 
00086         //- Thrust coefficient
00087         scalar Ct_;
00088 
00089         //- Disk area
00090         scalar diskArea_;
00091 
00092 
00093     // Private Member Functions
00094 
00095         //- Check data
00096         void checkData();
00097 
00098         //- Add resistance to the UEqn
00099         template<class RhoFieldType>
00100         void addActuationDiskAxialInertialResistance
00101         (
00102             vectorField& Usource,
00103             const labelList& cells,
00104             const scalarField& V,
00105             const RhoFieldType& rho,
00106             const vectorField& U
00107         ) const;
00108 
00109         //- Disallow default bitwise copy construct
00110         actuationDiskSource(const actuationDiskSource&);
00111 
00112         //- Disallow default bitwise assignment
00113         void operator=(const actuationDiskSource&);
00114 
00115 
00116 public:
00117 
00118     //- Runtime type information
00119     TypeName("actuationDiskSource");
00120 
00121 
00122     // Constructors
00123 
00124         //- Construct from components
00125         actuationDiskSource
00126         (
00127             const word& name,
00128             const dictionary& dict,
00129             const fvMesh& mesh
00130         );
00131 
00132 
00133     //- Destructor
00134     virtual ~actuationDiskSource()
00135     {}
00136 
00137 
00138     // Member Functions
00139 
00140         // Access
00141 
00142             //- cellZone number
00143             label zoneId() const
00144             {
00145                 return cellZoneID_;
00146             }
00147 
00148             //- Return Cp
00149             scalar Cp() const
00150             {
00151                 return Cp_;
00152             }
00153 
00154             //- Return Ct
00155             scalar Ct() const
00156             {
00157                 return Ct_;
00158             }
00159 
00160             //- Normal disk direction
00161             const vector& diskDir() const
00162             {
00163                 return diskDir_;
00164             }
00165 
00166             //- Disk area
00167             scalar diskArea() const
00168             {
00169                 return diskArea_;
00170             }
00171 
00172 
00173         // Public Functions
00174 
00175             //-Source term to fvMatrix<vector>
00176             virtual void addSu(fvMatrix<vector>& UEqn);
00177 
00178             //-Source term to fvMatrix<scalar>
00179             virtual void addSu(fvMatrix<scalar>& UEqn){}
00180 
00181             //- Add all explicit source
00182             virtual void addExplicitSources(){}
00183 
00184             //- Add source to scalar field
00185             virtual void addSu(DimensionedField<scalar, volMesh>& field){}
00186 
00187             //- Add source to vector field
00188             virtual void addSu(DimensionedField<vector, volMesh>& field){}
00189 
00190 
00191         // I-O
00192 
00193             //- Write data
00194             virtual void writeData(Ostream&) const;
00195 
00196             //- Read dictionary
00197             virtual bool read(const dictionary& dict);
00198 };
00199 
00200 
00201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00202 
00203 } // End namespace Foam
00204 
00205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00206 
00207 #ifdef NoRepository
00208 #   include "actuationDiskSourceTemplates.C"
00209 #endif
00210 
00211 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00212 
00213 #endif
00214 
00215 // ************************************************************************* //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines