ode.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 | Copyright (C) 2011-2016 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  autoPtr<ODESolver> odeSolver_;
59 
60  // Solver data
61  mutable scalarField cTp_;
62 
63 
64 public:
65 
66  //- Runtime type information
67  TypeName("ode");
68 
69 
70  // Constructors
71 
72  //- Construct from mesh and phase name
73  ode(const fvMesh& mesh, const word& phaseName);
74 
75 
76  //- Destructor
77  virtual ~ode();
78 
79 
80  // Member Functions
81 
82  //- Update the concentrations and return the chemical time
83  virtual void solve
84  (
85  scalarField& c,
86  scalar& T,
87  scalar& p,
88  scalar& deltaT,
89  scalar& subDeltaT
90  ) const;
91 };
92 
93 
94 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
95 
96 } // End namespace Foam
97 
98 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
99 
100 #ifdef NoRepository
101  #include "ode.C"
102 #endif
103 
104 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
105 
106 #endif
107 
108 // ************************************************************************* //
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:137
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:56
An ODE solver for chemistry.
Definition: ode.H:50
ode(const fvMesh &mesh, const word &phaseName)
Construct from mesh and phase name.
Definition: ode.C:33
dynamicFvMesh & mesh
TypeName("ode")
Runtime type information.
A class for handling words, derived from string.
Definition: word.H:59
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
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:53
volScalarField & p
virtual ~ode()
Destructor.
Definition: ode.C:48
Namespace for OpenFOAM.