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