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

InflowBoundaryModel.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) 2009-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::InflowBoundaryModel
00027 
00028 
00029 Description
00030     Templated inflow boundary model class
00031 
00032 SourceFiles
00033     InflowBoundaryModel.C
00034     NewInflowBoundaryModel.C
00035 
00036 \*---------------------------------------------------------------------------*/
00037 
00038 #ifndef InflowBoundaryModel_H
00039 #define InflowBoundaryModel_H
00040 
00041 #include "IOdictionary.H"
00042 #include "autoPtr.H"
00043 #include "runTimeSelectionTables.H"
00044 
00045 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00046 
00047 namespace Foam
00048 {
00049 
00050 /*---------------------------------------------------------------------------*\
00051                      Class InflowBoundaryModel Declaration
00052 \*---------------------------------------------------------------------------*/
00053 
00054 template<class CloudType>
00055 class InflowBoundaryModel
00056 {
00057     // Private data
00058 
00059         //- The cloud dictionary
00060         const dictionary& dict_;
00061 
00062         // Reference to the owner cloud class
00063         CloudType& owner_;
00064 
00065         //- The coefficients dictionary
00066         const dictionary coeffDict_;
00067 
00068 
00069 public:
00070 
00071     //- Runtime type information
00072     TypeName("InflowBoundaryModel");
00073 
00074     //- Declare runtime constructor selection table
00075     declareRunTimeSelectionTable
00076     (
00077         autoPtr,
00078         InflowBoundaryModel,
00079         dictionary,
00080         (
00081             const dictionary& dict,
00082             CloudType& owner
00083         ),
00084         (dict, owner)
00085     );
00086 
00087 
00088     // Constructors
00089 
00090         //- Construct from dictionary
00091         InflowBoundaryModel
00092         (
00093             const dictionary& dict,
00094             CloudType& owner,
00095             const word& type
00096         );
00097 
00098 
00099     //- Destructor
00100     virtual ~InflowBoundaryModel();
00101 
00102 
00103     //- Selector
00104     static autoPtr<InflowBoundaryModel<CloudType> > New
00105     (
00106         const dictionary& dict,
00107         CloudType& owner
00108     );
00109 
00110 
00111     // Access
00112 
00113         //- Return const access the owner cloud object
00114         inline const CloudType& owner() const;
00115 
00116         //- Return non-const access the owner cloud object for manipulation
00117         inline CloudType& owner();
00118 
00119         //- Return the owner cloud dictionary
00120         inline const dictionary& dict() const;
00121 
00122         //- Return the coefficients dictionary
00123         inline const dictionary& coeffDict() const;
00124 
00125     //- Introduce particles
00126     virtual void inflow() = 0;
00127 };
00128 
00129 
00130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00131 
00132 } // End namespace Foam
00133 
00134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00135 
00136 #define makeInflowBoundaryModel(CloudType)                                    \
00137                                                                               \
00138     defineNamedTemplateTypeNameAndDebug(InflowBoundaryModel<CloudType>, 0);   \
00139                                                                               \
00140     defineTemplateRunTimeSelectionTable                                       \
00141     (                                                                         \
00142         InflowBoundaryModel<CloudType>,                                       \
00143         dictionary                                                            \
00144     );
00145 
00146 
00147 #define makeInflowBoundaryModelType(SS, CloudType, ParcelType)                \
00148                                                                               \
00149     defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0);       \
00150                                                                               \
00151     InflowBoundaryModel<CloudType<ParcelType> >::                             \
00152         adddictionaryConstructorToTable<SS<CloudType<ParcelType> > >          \
00153             add##SS##CloudType##ParcelType##ConstructorToTable_;
00154 
00155 
00156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00157 
00158 #ifdef NoRepository
00159 #   include "InflowBoundaryModel.C"
00160 #endif
00161 
00162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00163 
00164 #endif
00165 
00166 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd