00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. 00006 \\/ M anipulation | 00007 ------------------------------------------------------------------------------- 00008 License 00009 This file is part of OpenFOAM. 00010 00011 OpenFOAM is free software: you can redistribute it and/or modify it 00012 under the terms of the GNU General Public License as published by 00013 the Free Software Foundation, either version 3 of the License, or 00014 (at your option) any later version. 00015 00016 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00018 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00019 for more details. 00020 00021 You should have received a copy of the GNU General Public License 00022 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. 00023 00024 Class 00025 Foam::RK 00026 00027 Description 00028 Foam::RK 00029 00030 SourceFiles 00031 RKCK.C 00032 RKQS.C 00033 00034 \*---------------------------------------------------------------------------*/ 00035 00036 #ifndef RK_H 00037 #define RK_H 00038 00039 #include <ODE/ODESolver.H> 00040 00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00042 00043 namespace Foam 00044 { 00045 00046 /*---------------------------------------------------------------------------*\ 00047 Class RK Declaration 00048 \*---------------------------------------------------------------------------*/ 00049 00050 class RK 00051 : 00052 public ODESolver 00053 { 00054 // Private data 00055 00056 mutable scalarField yTemp_; 00057 mutable scalarField ak2_; 00058 mutable scalarField ak3_; 00059 mutable scalarField ak4_; 00060 mutable scalarField ak5_; 00061 mutable scalarField ak6_; 00062 00063 mutable scalarField yErr_; 00064 mutable scalarField yTemp2_; 00065 00066 static const scalar safety, pGrow, pShrink, errCon; 00067 00068 static const scalar 00069 a2, a3, a4, a5, a6, 00070 b21, b31, b32, b41, b42, b43, 00071 b51, b52, b53, b54, b61, b62, b63, b64, b65, 00072 c1, c3, c4, c6, 00073 dc1, dc3, dc4, dc5, dc6; 00074 00075 00076 public: 00077 00078 //- Runtime type information 00079 TypeName("RK"); 00080 00081 00082 // Constructors 00083 00084 //- Construct from ODE 00085 RK(const ODE& ode); 00086 00087 00088 // Member Functions 00089 00090 void solve 00091 ( 00092 const ODE& ode, 00093 const scalar x, 00094 const scalarField& y, 00095 const scalarField& dydx, 00096 const scalar h, 00097 scalarField& yout, 00098 scalarField& yerr 00099 ) const; 00100 00101 00102 void solve 00103 ( 00104 const ODE& ode, 00105 scalar& x, 00106 scalarField& y, 00107 scalarField& dydx, 00108 const scalar eps, 00109 const scalarField& yScale, 00110 const scalar hTry, 00111 scalar& hDid, 00112 scalar& hNext 00113 ) const; 00114 }; 00115 00116 00117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00118 00119 } // End namespace Foam 00120 00121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00122 00123 #endif 00124 00125 // ************************ vim: set sw=4 sts=4 et: ************************ //