Loading...
Searching...
No Matches
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;
59/*---------------------------------------------------------------------------*\
60 Class ignitionSite Declaration
61\*---------------------------------------------------------------------------*/
62
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:
102
103 iNew(const Time& db, const fvMesh& mesh)
104 :
105 db_(db),
106 mesh_(mesh)
107 {}
108
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
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
140
141 const vector& location() const
142 {
143 return location_;
144 }
145
146 scalar diameter() const
147 {
148 return diameter_;
150
151 scalar time() const
152 {
153 return time_;
155
156 scalar duration() const
157 {
158 return duration_;
160
161 scalar strength() const
162 {
163 return strength_;
165
166 //- Return the ignition cells updated if the mesh moved
167 const labelList& cells() const;
168
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:60
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition Time.H:75
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
Definition autoPtr.H:178
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
An abstract class for the time description of the piston motion.
Definition engineTime.H:53
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
autoPtr< ignitionSite > operator()(Istream &is) const
iNew(const Time &db, const fvMesh &mesh)
Foam::ignitionSite.
ignitionSite(const ignitionSite &)=default
Copy construct.
const labelList & cells() const
Return the ignition cells updated if the mesh moved.
autoPtr< ignitionSite > clone() const
Clone.
scalar duration() const
scalar time() const
scalar diameter() const
const vector & location() const
bool ignited() const
void operator=(const ignitionSite &)
scalar strength() const
const scalarList & cellVolumes() const
bool igniting() const
dynamicFvMesh & mesh
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition List.H:62
Vector< scalar > vector
Definition vector.H:57
List< scalar > scalarList
List of scalar.
Definition scalarList.H:32