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

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