ignitionSite.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::ignitionSite
26 
27 Description
28  Foam::ignitionSite
29 
30 SourceFiles
31  ignitionSiteI.H
32  ignitionSite.C
33  ignitionSiteIO.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef ignitionSite_H
38 #define ignitionSite_H
39 
40 #include "vector.H"
41 #include "labelList.H"
42 #include "scalarList.H"
43 #include "autoPtr.H"
44 #include "dictionary.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 class Time;
52 class fvMesh;
53 
54 /*---------------------------------------------------------------------------*\
55  Class ignitionSite Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 class ignitionSite
59 {
60  // Private Data
61 
62  const Time& db_;
63  const fvMesh& mesh_;
64 
65  dictionary ignitionSiteDict_;
66 
67  vector location_;
68  scalar diameter_;
69  scalar time_;
70  scalar duration_;
71  scalar strength_;
72 
73  labelList cells_;
74  scalarList cellVolumes_;
75 
76  //- Current time index.
77  // Used during the update for moving meshes
78  mutable label timeIndex_;
79 
80 
81  // Private Member Functions
82 
83  void findIgnitionCells(const fvMesh&);
84 
85 
86 public:
87 
88  // Public classes
89 
90  //- Class used for the read-construction of
91  // PtrLists of ignitionSite
92  class iNew
93  {
94  const Time& db_;
95  const fvMesh& mesh_;
96 
97  public:
98 
99  iNew(const Time& db, const fvMesh& mesh)
100  :
101  db_(db),
102  mesh_(mesh)
103  {}
104 
106  {
107  return autoPtr<ignitionSite>(new ignitionSite(is, db_, mesh_));
108  }
109  };
110 
111 
112  // Constructors
113 
114  //- Construct from Istream and database
115  ignitionSite(Istream&, const Time&, const fvMesh&);
116 
117  //- Copy constructor
118  ignitionSite(const ignitionSite&) = default;
119 
120  //- Clone
122  {
123  return autoPtr<ignitionSite>(new ignitionSite(*this));
124  }
125 
126 
127  // Member Functions
128 
129  // Access
130 
131  const vector& location() const
132  {
133  return location_;
134  }
135 
136  scalar diameter() const
137  {
138  return diameter_;
139  }
140 
141  scalar time() const
142  {
143  return time_;
144  }
145 
146  scalar duration() const
147  {
148  return duration_;
149  }
150 
151  scalar strength() const
152  {
153  return strength_;
154  }
155 
156  //- Return the ignition cells updated if the mesh moved
157  const labelList& cells() const;
158 
159  const scalarList& cellVolumes() const
160  {
161  return cellVolumes_;
162  }
163 
164 
165  // Check
166 
167  bool igniting() const;
168 
169  bool ignited() const;
170 
171 
172  // Member Operators
173 
174  void operator=(const ignitionSite&);
175 };
176 
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 } // End namespace Foam
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 #endif
185 
186 // ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:60
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:76
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:101
Class used for the read-construction of.
Definition: ignitionSite.H:92
autoPtr< ignitionSite > operator()(Istream &is) const
Definition: ignitionSite.H:104
iNew(const Time &db, const fvMesh &mesh)
Definition: ignitionSite.H:98
Foam::ignitionSite.
Definition: ignitionSite.H:58
autoPtr< ignitionSite > clone() const
Clone.
Definition: ignitionSite.H:120
const labelList & cells() const
Return the ignition cells updated if the mesh moved.
Definition: ignitionSite.C:86
scalar duration() const
Definition: ignitionSite.H:145
scalar time() const
Definition: ignitionSite.H:140
scalar diameter() const
Definition: ignitionSite.H:135
const scalarList & cellVolumes() const
Definition: ignitionSite.H:158
bool ignited() const
Definition: ignitionSite.C:112
void operator=(const ignitionSite &)
Definition: ignitionSite.C:123
scalar strength() const
Definition: ignitionSite.H:150
const vector & location() const
Definition: ignitionSite.H:130
bool igniting() const
Definition: ignitionSite.C:98
ignitionSite(Istream &, const Time &, const fvMesh &)
Construct from Istream and database.
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59