ignitionIO.C
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 -------------------------------------------------------------------------------
11 License
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 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "engineTime.H"
30 #include "ignition.H"
31 
32 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
33 
34 Foam::ignition::ignition
35 (
36  const dictionary& combustionProperties,
37  const Time& db,
38  const fvMesh& mesh
39 )
40 :
41  mesh_(mesh),
42  ignite_(combustionProperties.get<bool>("ignite")),
43  ignSites_
44  (
45  combustionProperties.lookup("ignitionSites"),
47  )
48 {
49  if (ignite_)
50  {
51  Info<< "\nIgnition on" << endl;
52  }
53  else
54  {
55  Info<< "\nIgnition switched off" << endl;
56  }
57 }
58 
59 
60 Foam::ignition::ignition
61 (
62  const dictionary& combustionProperties,
63  const engineTime& edb,
64  const fvMesh& mesh
65 )
66 :
67  mesh_(mesh),
68  ignite_(combustionProperties.get<bool>("ignite")),
69  ignSites_
70  (
71  combustionProperties.lookup("ignitionSites"),
73  )
74 {
75  if (ignite_)
76  {
77  Info<< "\nIgnition on" << endl;
78  }
79  else
80  {
81  Info<< "\nIgnition switched off" << endl;
82  }
83 }
84 
85 
86 // ************************************************************************* //
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
Foam::dictionary::get
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Definition: dictionaryTemplates.C:107
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
ignition.H
Foam::dictionary::lookup
ITstream & lookup(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Definition: dictionary.C:386
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::engineTime
An abstract class for the time description of the piston motion.
Definition: engineTime.H:54
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam::ignitionSite::iNew
Read-construction of PtrLists of ignitionSite.
Definition: ignitionSite.H:95
engineTime.H