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

DispersionModel.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) 1991-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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::DispersionModel
00026 
00027 Description
00028 
00029 \*---------------------------------------------------------------------------*/
00030 
00031 #ifndef DispersionModel_H
00032 #define DispersionModel_H
00033 
00034 #include <OpenFOAM/IOdictionary.H>
00035 #include <OpenFOAM/autoPtr.H>
00036 #include <OpenFOAM/runTimeSelectionTables.H>
00037 
00038 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00039 
00040 namespace Foam
00041 {
00042 
00043 /*---------------------------------------------------------------------------*\
00044                         Class DispersionModel Declaration
00045 \*---------------------------------------------------------------------------*/
00046 
00047 template<class CloudType>
00048 class DispersionModel
00049 {
00050 
00051     // Private data
00052 
00053         //- Cloud dictionary
00054         const dictionary& dict_;
00055 
00056         //- Reference to the owner cloud class
00057         CloudType& owner_;
00058 
00059 
00060 public:
00061 
00062     //- Runtime type information
00063     TypeName("DispersionModel");
00064 
00065 
00066     // Declare runtime constructor selection table
00067 
00068     declareRunTimeSelectionTable
00069     (
00070         autoPtr,
00071         DispersionModel,
00072         dictionary,
00073         (
00074             const dictionary& dict,
00075             CloudType& owner
00076         ),
00077         (dict, owner)
00078     );
00079 
00080 
00081     // Constructors
00082 
00083         //- Construct null from owner
00084         DispersionModel(CloudType& owner);
00085 
00086         //- Construct from components
00087         DispersionModel
00088         (
00089             const dictionary& dict,
00090             CloudType& owner
00091         );
00092 
00093 
00094     //- Destructor
00095     virtual ~DispersionModel();
00096 
00097 
00098     //- Selector
00099     static autoPtr<DispersionModel<CloudType> > New
00100     (
00101         const dictionary& dict,
00102         CloudType& owner
00103     );
00104 
00105 
00106     // Access
00107 
00108         //- Return the owner cloud object
00109         const CloudType& owner() const;
00110 
00111         //- Return the owner cloud object
00112         CloudType& owner();
00113 
00114         //- Return the dictionary
00115         const dictionary& dict() const;
00116 
00117 
00118     // Member Functions
00119 
00120         //- Flag to indicate whether model activates injection model
00121         virtual bool active() const = 0;
00122 
00123         //- Cache carrier fields
00124         virtual void cacheFields(const bool store) = 0;
00125 
00126         //- Update (disperse particles)
00127         virtual vector update
00128         (
00129             const scalar dt,
00130             const label celli,
00131             const vector& U,
00132             const vector& Uc,
00133             vector& UTurb,
00134             scalar& tTurb
00135         ) = 0;
00136 };
00137 
00138 
00139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00140 
00141 } // End namespace Foam
00142 
00143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00144 
00145 #define makeDispersionModel(CloudType)                                        \
00146                                                                               \
00147     defineNamedTemplateTypeNameAndDebug(DispersionModel<CloudType>, 0);       \
00148                                                                               \
00149     defineTemplateRunTimeSelectionTable                                       \
00150     (                                                                         \
00151         DispersionModel<CloudType>,                                           \
00152         dictionary                                                            \
00153     );
00154 
00155 
00156 #define makeDispersionModelType(SS, CloudType, ParcelType)                    \
00157                                                                               \
00158     defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0);       \
00159                                                                               \
00160     DispersionModel<CloudType<ParcelType> >::                                 \
00161         adddictionaryConstructorToTable<SS<CloudType<ParcelType> > >          \
00162             add##SS##CloudType##ParcelType##ConstructorToTable_;
00163 
00164 
00165 #define makeDispersionModelThermoType(SS, CloudType, ParcelType, ThermoType)  \
00166                                                                               \
00167     defineNamedTemplateTypeNameAndDebug                                       \
00168     (                                                                         \
00169         SS<CloudType<ParcelType<ThermoType> > >,                              \
00170         0                                                                     \
00171     );                                                                        \
00172                                                                               \
00173     DispersionModel<CloudType<ParcelType<ThermoType> > >::                    \
00174         adddictionaryConstructorToTable                                       \
00175             <SS<CloudType<ParcelType<ThermoType> > > >                        \
00176             add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_;
00177 
00178 
00179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00180 
00181 #ifdef NoRepository
00182 #   include <lagrangianIntermediate/DispersionModel.C>
00183 #endif
00184 
00185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00186 
00187 #endif
00188 
00189 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines