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

PatchInjection.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-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::PatchInjection
00026 
00027 Description
00028     Patch injection
00029 
00030     - User specifies
00031       - Total mass to inject
00032       - Name of patch
00033       - Injection duration
00034       - Initial parcel velocity
00035       - Injection volume flow rate
00036     - Parcel diameters obtained by PDF model
00037     - Parcels injected at cell centres adjacent to patch
00038 
00039 SourceFiles
00040     PatchInjection.C
00041 
00042 \*---------------------------------------------------------------------------*/
00043 
00044 #ifndef PatchInjection_H
00045 #define PatchInjection_H
00046 
00047 #include <lagrangianIntermediate/InjectionModel.H>
00048 
00049 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00050 
00051 namespace Foam
00052 {
00053 
00054 template<class Type>
00055 class DataEntry;
00056 
00057 class pdf;
00058 
00059 /*---------------------------------------------------------------------------*\
00060                        Class PatchInjection Declaration
00061 \*---------------------------------------------------------------------------*/
00062 
00063 template<class CloudType>
00064 class PatchInjection
00065 :
00066     public InjectionModel<CloudType>
00067 {
00068     // Private data
00069 
00070         //- Name of patch
00071         const word patchName_;
00072 
00073         //- Injection duration [s]
00074         const scalar duration_;
00075 
00076         //- Number of parcels to introduce per second []
00077         const label parcelsPerSecond_;
00078 
00079         //- Initial parcel velocity [m/s]
00080         const vector U0_;
00081 
00082         //- Volume flow rate of parcels to introduce relative to SOI [m^3/s]
00083         const autoPtr<DataEntry<scalar> > volumeFlowRate_;
00084 
00085         //- Parcel size PDF model
00086         const autoPtr<pdfs::pdf> parcelPDF_;
00087 
00088         //- Cell owners
00089         labelList cellOwners_;
00090 
00091         //- Fraction of injection controlled by this processor
00092         scalar fraction_;
00093 
00094 
00095 protected:
00096 
00097     // Protected member functions
00098 
00099         //- Number of parcels to introduce over the time step relative to SOI
00100         label parcelsToInject
00101         (
00102             const scalar time0,
00103             const scalar time1
00104         ) const;
00105 
00106         //- Volume of parcels to introduce over the time step relative to SOI
00107         scalar volumeToInject
00108         (
00109             const scalar time0,
00110             const scalar time1
00111         ) const;
00112 
00113 
00114 public:
00115 
00116     //- Runtime type information
00117     TypeName("PatchInjection");
00118 
00119 
00120     // Constructors
00121 
00122         //- Construct from dictionary
00123         PatchInjection
00124         (
00125             const dictionary& dict,
00126             CloudType& owner
00127         );
00128 
00129 
00130     //- Destructor
00131     virtual ~PatchInjection();
00132 
00133 
00134     // Member Functions
00135 
00136         //- Flag to indicate whether model activates injection model
00137         bool active() const;
00138 
00139         //- Return the end-of-injection time
00140         scalar timeEnd() const;
00141 
00142 
00143         // Injection geometry
00144 
00145             //- Set the injection position and owner cell
00146             virtual void setPositionAndCell
00147             (
00148                 const label parcelI,
00149                 const label nParcels,
00150                 const scalar time,
00151                 vector& position,
00152                 label& cellOwner
00153             );
00154 
00155             virtual void setProperties
00156             (
00157                 const label parcelI,
00158                 const label nParcels,
00159                 const scalar time,
00160                 typename CloudType::parcelType& parcel
00161             );
00162 
00163             //- Flag to identify whether model fully describes the parcel
00164             virtual bool fullyDescribed() const;
00165 
00166             //- Return flag to identify whether or not injection of parcelI is
00167             //  permitted
00168             virtual bool validInjection(const label parcelI);
00169 };
00170 
00171 
00172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00173 
00174 } // End namespace Foam
00175 
00176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00177 
00178 #ifdef NoRepository
00179 #   include "PatchInjection.C"
00180 #endif
00181 
00182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00183 
00184 #endif
00185 
00186 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines