FreeFOAM The Cross-Platform CFD Toolkit
KRR4.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) 1991-2010 OpenCFD Ltd.
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::KRR4
26 
27 Description
28  Foam::KRR4
29 
30 SourceFiles
31  KRR4CK.C
32  KRR4QS.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef KRR4_H
37 #define KRR4_H
38 
39 #include <ODE/ODESolver.H>
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class KRR4 Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 class KRR4
51 :
52  public ODESolver
53 {
54  // Private data
55 
56  mutable scalarField yTemp_;
57  mutable scalarField dydxTemp_;
58  mutable scalarField g1_;
59  mutable scalarField g2_;
60  mutable scalarField g3_;
61  mutable scalarField g4_;
62  mutable scalarField yErr_;
63  mutable scalarField dfdx_;
64  mutable scalarSquareMatrix dfdy_;
65  mutable scalarSquareMatrix a_;
66  mutable labelList pivotIndices_;
67 
68  static const int maxtry = 40;
69 
70  static const scalar safety, grow, pgrow, shrink, pshrink, errcon;
71 
72  static const scalar
73  gamma,
74  a21, a31, a32,
75  c21, c31, c32, c41, c42, c43,
76  b1, b2, b3, b4,
77  e1, e2, e3, e4,
78  c1X, c2X, c3X, c4X,
79  a2X, a3X;
80 
81 
82 public:
83 
84  //- Runtime type information
85  TypeName("KRR4");
86 
87 
88  // Constructors
89 
90  //- Construct from ODE
91  KRR4(const ODE& ode);
92 
93 
94  // Member Functions
95 
96  void solve
97  (
98  const ODE& ode,
99  scalar& x,
100  scalarField& y,
101  scalarField& dydx,
102  const scalar eps,
103  const scalarField& yScale,
104  const scalar hTry,
105  scalar& hDid,
106  scalar& hNext
107  ) const;
108 };
109 
110 
111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
112 
113 } // End namespace Foam
114 
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 
117 #endif
118 
119 // ************************ vim: set sw=4 sts=4 et: ************************ //