All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ode.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-2019 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::ode
26 
27 Description
28  An ODE solver for chemistry
29 
30 SourceFiles
31  ode.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef ode_H
36 #define ode_H
37 
38 #include "chemistrySolver.H"
39 #include "ODESolver.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class ode Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 template<class ChemistryModel>
51 class ode
52 :
53  public chemistrySolver<ChemistryModel>
54 {
55  // Private Data
56 
57  dictionary coeffsDict_;
58 
59  mutable autoPtr<ODESolver> odeSolver_;
60 
61  // Solver data
62  mutable scalarField cTp_;
63 
64 
65 public:
66 
67  //- Runtime type information
68  TypeName("ode");
69 
70 
71  // Constructors
72 
73  //- Construct from thermo
74  ode(typename ChemistryModel::reactionThermo& thermo);
75 
76 
77  //- Destructor
78  virtual ~ode();
79 
80 
81  // Member Functions
82 
83  //- Update the concentrations and return the chemical time
84  virtual void solve
85  (
86  scalarField& c,
87  scalar& T,
88  scalar& p,
89  scalar& deltaT,
90  scalar& subDeltaT
91  ) const;
92 };
93 
94 
95 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
96 
97 } // End namespace Foam
98 
99 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
100 
101 #ifdef NoRepository
102  #include "ode.C"
103 #endif
104 
105 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
106 
107 #endif
108 
109 // ************************************************************************* //
An abstract base class for solving chemistry.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
rhoReactionThermo & thermo
Definition: createFields.H:28
An ODE solver for chemistry.
Definition: ode.H:50
TypeName("ode")
Runtime type information.
virtual void solve(scalarField &c, scalar &T, scalar &p, scalar &deltaT, scalar &subDeltaT) const
Update the concentrations and return the chemical time.
Definition: ode.C:51
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
ode(typename ChemistryModel::reactionThermo &thermo)
Construct from thermo.
Definition: ode.C:31
const dimensionedScalar c
Speed of light in a vacuum.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
volScalarField & p
virtual ~ode()
Destructor.
Definition: ode.C:43
Namespace for OpenFOAM.