1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation, either version 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
28 Fifth-order Cash-Karp embedded Runge-Kutta scheme with error control and
29 adjustive time-step size
30 Numerical Recipes in C, Secn 16.2 page 714-722
31 Alternative reference in Numerical Recipes in C++
36 \*---------------------------------------------------------------------------*/
41 #include "ODESolver.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 /*---------------------------------------------------------------------------*\
50 \*---------------------------------------------------------------------------*/
58 mutable scalarField yTemp_;
59 mutable scalarField ak2_;
60 mutable scalarField ak3_;
61 mutable scalarField ak4_;
62 mutable scalarField ak5_;
63 mutable scalarField ak6_;
65 mutable scalarField yErr_;
66 mutable scalarField yTemp2_;
68 static const scalar safety, pGrow, pShrink, errCon;
72 b21, b31, b32, b41, b42, b43,
73 b51, b52, b53, b54, b61, b62, b63, b64, b65,
75 dc1, dc3, dc4, dc5, dc6;
78 // Private Member Functions
84 const scalarField& dydx,
93 //- Runtime type information
99 //- Construct from ODE
117 const scalarField& yScale,
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 } // End namespace Foam
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 // ************************************************************************* //