OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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