|
|
|
RK.HGo to the documentation of this file.00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2009 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 the 00013 Free Software Foundation; either version 2 of the License, or (at your 00014 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, write to the Free Software Foundation, 00023 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00024 00025 Class 00026 Foam::RK 00027 00028 Description 00029 Foam::RK 00030 00031 SourceFiles 00032 RKCK.C 00033 RKQS.C 00034 00035 \*---------------------------------------------------------------------------*/ 00036 00037 #ifndef RK_H 00038 #define RK_H 00039 00040 #include "ODESolver.H" 00041 00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00043 00044 namespace Foam 00045 { 00046 00047 /*---------------------------------------------------------------------------*\ 00048 Class RK Declaration 00049 \*---------------------------------------------------------------------------*/ 00050 00051 class RK 00052 : 00053 public ODESolver 00054 { 00055 // Private data 00056 00057 mutable scalarField yTemp_; 00058 mutable scalarField ak2_; 00059 mutable scalarField ak3_; 00060 mutable scalarField ak4_; 00061 mutable scalarField ak5_; 00062 mutable scalarField ak6_; 00063 00064 mutable scalarField yErr_; 00065 mutable scalarField yTemp2_; 00066 00067 static const scalar safety, pGrow, pShrink, errCon; 00068 00069 static const scalar 00070 a2, a3, a4, a5, a6, 00071 b21, b31, b32, b41, b42, b43, 00072 b51, b52, b53, b54, b61, b62, b63, b64, b65, 00073 c1, c3, c4, c6, 00074 dc1, dc3, dc4, dc5, dc6; 00075 00076 00077 public: 00078 00079 //- Runtime type information 00080 TypeName("RK"); 00081 00082 00083 // Constructors 00084 00085 //- Construct from ODE 00086 RK(const ODE& ode); 00087 00088 00089 // Member Functions 00090 00091 void solve 00092 ( 00093 const ODE& ode, 00094 const scalar x, 00095 const scalarField& y, 00096 const scalarField& dydx, 00097 const scalar h, 00098 scalarField& yout, 00099 scalarField& yerr 00100 ) const; 00101 00102 00103 void solve 00104 ( 00105 const ODE& ode, 00106 scalar& x, 00107 scalarField& y, 00108 scalarField& dydx, 00109 const scalar eps, 00110 const scalarField& yScale, 00111 const scalar hTry, 00112 scalar& hDid, 00113 scalar& hNext 00114 ) const; 00115 }; 00116 00117 00118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00119 00120 } // End namespace Foam 00121 00122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00123 00124 #endif 00125 00126 // ************************************************************************* // |