SIBS.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-2013 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::SIBS
26 
27 Description
28  Foam::SIBS
29 
30  Bader, G. and Deuflhard, P.
31  "A Semi-Implicit Mid-Point Rule for
32  Stiff Systems of Ordinary Differential Equations."
33  Numer. Math. 41, 373-398, 1983.
34 
35 SourceFiles
36  SIMPR.C
37  polyExtrapolate.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef SIBS_H
42 #define SIBS_H
43 
44 #include "ODESolver.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class SIBS Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 class SIBS
56 :
57  public ODESolver
58 {
59  // Private data
60 
61  static const label kMaxX_ = 7, iMaxX_ = kMaxX_ + 1;
62  static const label nSeq_[iMaxX_];
63 
64  static const scalar safe1, safe2, redMax, redMin, scaleMX;
65 
66  mutable scalarField a_;
67  mutable scalarSquareMatrix alpha_;
68  mutable scalarRectangularMatrix d_p_;
69  mutable scalarField x_p_;
70  mutable scalarField err_;
71 
72  mutable scalarField yTemp_;
73  mutable scalarField ySeq_;
74  mutable scalarField yErr_;
75  mutable scalarField dydx0_;
76  mutable scalarField dfdx_;
77  mutable scalarSquareMatrix dfdy_;
78 
79  mutable label first_, kMax_, kOpt_;
80  mutable scalar epsOld_, xNew_;
81 
82 
83  // Private Member Functions
84 
85  void SIMPR
86  (
87  const scalar xStart,
88  const scalarField& y,
89  const scalarField& dydx,
90  const scalarField& dfdx,
91  const scalarSquareMatrix& dfdy,
92  const scalar deltaX,
93  const label nSteps,
94  scalarField& yEnd
95  ) const;
96 
97  void polyExtrapolate
98  (
99  const label iest,
100  const scalar xest,
101  const scalarField& yest,
102  scalarField& yz,
103  scalarField& dy,
104  scalarField& x_p,
106  ) const;
107 
108 
109 public:
110 
111  //- Runtime type information
112  TypeName("SIBS");
113 
114 
115  // Constructors
116 
117  //- Construct from ODE
118  SIBS(const ODESystem& ode, const dictionary& dict);
119 
120 
121  // Member Functions
122 
123  void solve
124  (
125  scalar& x,
126  scalarField& y,
127  scalar& dxTry
128  ) const;
129 };
130 
131 
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 
134 } // End namespace Foam
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
138 #endif
139 
140 // ************************************************************************* //
dictionary dict
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Abstract base class for the systems of ordinary differential equations.
Definition: ODESystem.H:46
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Foam::SIBS.
Definition: SIBS.H:54
An ODE solver for chemistry.
Definition: ode.H:50
scalar y
SIBS(const ODESystem &ode, const dictionary &dict)
Construct from ODE.
Definition: SIBS.C:49
TypeName("SIBS")
Runtime type information.
Abstract base-class for ODE system solvers.
Definition: ODESolver.H:50
void solve(scalar &x, scalarField &y, scalar &dxTry) const
Solve the ODE system as far as possible upto dxTry.
Definition: SIBS.C:72
Namespace for OpenFOAM.