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

ignitionSite.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::ignitionSite
00026 
00027 Description
00028     Foam::ignitionSite
00029 
00030 SourceFiles
00031     ignitionSiteI.H
00032     ignitionSite.C
00033     ignitionSiteIO.C
00034 
00035 \*---------------------------------------------------------------------------*/
00036 
00037 #ifndef ignitionSite_H
00038 #define ignitionSite_H
00039 
00040 #include <OpenFOAM/vector.H>
00041 #include <OpenFOAM/labelList.H>
00042 #include <OpenFOAM/scalarList.H>
00043 #include <OpenFOAM/autoPtr.H>
00044 #include <OpenFOAM/dictionary.H>
00045 
00046 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00047 
00048 namespace Foam
00049 {
00050 
00051 class Time;
00052 class engineTime;
00053 class fvMesh;
00054 
00055 /*---------------------------------------------------------------------------*\
00056                            Class ignitionSite Declaration
00057 \*---------------------------------------------------------------------------*/
00058 
00059 class ignitionSite
00060 {
00061     // Private data
00062 
00063         const Time& db_;
00064         const fvMesh& mesh_;
00065 
00066         dictionary ignitionSiteDict_;
00067 
00068         vector location_;
00069         scalar diameter_;
00070         scalar time_;
00071         scalar duration_;
00072         scalar strength_;
00073 
00074         labelList cells_;
00075         scalarList cellVolumes_;
00076 
00077         //- Current time index.
00078         //  Used during the update for moving meshes
00079         mutable label timeIndex_;
00080 
00081 
00082     // Private Member Functions
00083 
00084         void findIgnitionCells(const fvMesh&);
00085 
00086 
00087 public:
00088 
00089     // Public classes
00090 
00091         //- Class used for the read-construction of
00092         //  PtrLists of ignitionSite
00093         class iNew
00094         {
00095             const Time& db_;
00096             const fvMesh& mesh_;
00097         
00098         public:
00099 
00100             iNew(const Time& db, const fvMesh& mesh)
00101             :
00102                 db_(db),
00103                 mesh_(mesh)
00104             {}
00105 
00106             autoPtr<ignitionSite> operator()(Istream& is) const
00107             {
00108                 return autoPtr<ignitionSite>(new ignitionSite(is, db_, mesh_));
00109             }
00110         };
00111 
00112 
00113     // Constructors
00114 
00115         //- Construct from Istream and database
00116         ignitionSite(Istream&, const Time&, const fvMesh&);
00117 
00118         //- Construct from Istream and engineTime
00119         ignitionSite(Istream&, const engineTime&, const fvMesh&);
00120 
00121         //- Clone
00122         autoPtr<ignitionSite> clone() const
00123         {
00124             return autoPtr<ignitionSite>(new ignitionSite(*this));
00125         }
00126 
00127 
00128     // Member Functions
00129 
00130         // Access
00131 
00132             const vector& location() const
00133             {
00134                 return location_;
00135             }
00136 
00137             scalar diameter() const
00138             {
00139                 return diameter_;
00140             }
00141 
00142             scalar time() const
00143             {
00144                 return time_;
00145             }
00146 
00147             scalar duration() const
00148             {
00149                 return duration_;
00150             }
00151 
00152             scalar strength() const
00153             {
00154                 return strength_;
00155             }
00156 
00157             //- Return the ignition cells updated if the mesh moved
00158             const labelList& cells() const;
00159 
00160             const scalarList& cellVolumes() const
00161             {
00162                 return cellVolumes_;
00163             }
00164 
00165 
00166         // Check
00167 
00168             bool igniting() const;
00169 
00170             bool ignited() const;
00171 
00172 
00173     // Member Operators
00174 
00175         void operator=(const ignitionSite&);
00176 };
00177 
00178 
00179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00180 
00181 } // End namespace Foam
00182 
00183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00184 
00185 #endif
00186 
00187 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines