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_;
69  mutable scalarField x_p_;
70  mutable scalarField err_;
71 
73  mutable scalarField ySeq_;
74  mutable scalarField yErr_;
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 // ************************************************************************* //
Foam::SIBS::kOpt_
label kOpt_
Definition: SIBS.H:78
Foam::SIBS::ySeq_
scalarField ySeq_
Definition: SIBS.H:72
Foam::SIBS::yErr_
scalarField yErr_
Definition: SIBS.H:73
Foam::ODESolver
Abstract base-class for ODE system solvers.
Definition: ODESolver.H:50
Foam::SIBS::xNew_
scalar xNew_
Definition: SIBS.H:79
Foam::SIBS::alpha_
scalarSquareMatrix alpha_
Definition: SIBS.H:66
Foam::SIBS::SIMPR
void SIMPR(const scalar xStart, const scalarField &y, const scalarField &dydx, const scalarField &dfdx, const scalarSquareMatrix &dfdy, const scalar deltaX, const label nSteps, scalarField &yEnd) const
Definition: SIMPR.C:31
Foam::SIBS::yTemp_
scalarField yTemp_
Definition: SIBS.H:71
Foam::SIBS::TypeName
TypeName("SIBS")
Runtime type information.
Foam::SIBS::scaleMX
static const scalar scaleMX
Definition: SIBS.H:63
Foam::SIBS::dfdy_
scalarSquareMatrix dfdy_
Definition: SIBS.H:76
Foam::SIBS::kMaxX_
static const label kMaxX_
Definition: SIBS.H:60
Foam::SIBS::nSeq_
static const label nSeq_[iMaxX_]
Definition: SIBS.H:61
Foam::SIBS::d_p_
scalarRectangularMatrix d_p_
Definition: SIBS.H:67
Foam::SIBS::kMax_
label kMax_
Definition: SIBS.H:78
Foam::SIBS::redMin
static const scalar redMin
Definition: SIBS.H:63
Foam::label
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
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::SIBS::dfdx_
scalarField dfdx_
Definition: SIBS.H:75
Foam::RectangularMatrix< scalar >
Foam::SIBS::safe2
static const scalar safe2
Definition: SIBS.H:63
Foam::ode
An ODE solver for chemistry.
Definition: ode.H:50
Foam::SIBS::first_
label first_
Definition: SIBS.H:78
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
ODESolver.H
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::SIBS::polyExtrapolate
void polyExtrapolate(const label iest, const scalar xest, const scalarField &yest, scalarField &yz, scalarField &dy, scalarField &x_p, scalarRectangularMatrix &d_p) const
Definition: polyExtrapolate.C:31
Foam::SIBS::a_
scalarField a_
Definition: SIBS.H:65
Foam::SquareMatrix< scalar >
Foam::SIBS::solve
void solve(scalar &x, scalarField &y, scalar &dxTry) const
Solve the ODE system as far as possible upto dxTry.
Definition: SIBS.C:72
Foam::SIBS::x_p_
scalarField x_p_
Definition: SIBS.H:68
Foam::ODESystem
Abstract base class for the systems of ordinary differential equations.
Definition: ODESystem.H:46
Foam::SIBS::dydx0_
scalarField dydx0_
Definition: SIBS.H:74
Foam::SIBS::safe1
static const scalar safe1
Definition: SIBS.H:63
x
x
Definition: LISASMDCalcMethod2.H:52
Foam::SIBS
Foam::SIBS.
Definition: SIBS.H:54
Foam::SIBS::redMax
static const scalar redMax
Definition: SIBS.H:63
Foam::SIBS::iMaxX_
static const label iMaxX_
Definition: SIBS.H:60
Foam::SIBS::err_
scalarField err_
Definition: SIBS.H:69
Foam::SIBS::epsOld_
scalar epsOld_
Definition: SIBS.H:79
Foam::SIBS::SIBS
SIBS(const ODESystem &ode, const dictionary &dict)
Construct from ODE.
Definition: SIBS.C:49
y
scalar y
Definition: LISASMDCalcMethod1.H:14