|
|
|
KRR4.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::KRR4 00027 00028 Description 00029 Foam::KRR4 00030 00031 SourceFiles 00032 KRR4CK.C 00033 KRR4QS.C 00034 00035 \*---------------------------------------------------------------------------*/ 00036 00037 #ifndef KRR4_H 00038 #define KRR4_H 00039 00040 #include "ODESolver.H" 00041 00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00043 00044 namespace Foam 00045 { 00046 00047 /*---------------------------------------------------------------------------*\ 00048 Class KRR4 Declaration 00049 \*---------------------------------------------------------------------------*/ 00050 00051 class KRR4 00052 : 00053 public ODESolver 00054 { 00055 // Private data 00056 00057 mutable scalarField yTemp_; 00058 mutable scalarField dydxTemp_; 00059 mutable scalarField g1_; 00060 mutable scalarField g2_; 00061 mutable scalarField g3_; 00062 mutable scalarField g4_; 00063 mutable scalarField yErr_; 00064 mutable scalarField dfdx_; 00065 mutable scalarSquareMatrix dfdy_; 00066 mutable scalarSquareMatrix a_; 00067 mutable labelList pivotIndices_; 00068 00069 static const int maxtry = 40; 00070 00071 static const scalar safety, grow, pgrow, shrink, pshrink, errcon; 00072 00073 static const scalar 00074 gamma, 00075 a21, a31, a32, 00076 c21, c31, c32, c41, c42, c43, 00077 b1, b2, b3, b4, 00078 e1, e2, e3, e4, 00079 c1X, c2X, c3X, c4X, 00080 a2X, a3X; 00081 00082 00083 public: 00084 00085 //- Runtime type information 00086 TypeName("KRR4"); 00087 00088 00089 // Constructors 00090 00091 //- Construct from ODE 00092 KRR4(const ODE& ode); 00093 00094 00095 // Member Functions 00096 00097 void solve 00098 ( 00099 const ODE& ode, 00100 scalar& x, 00101 scalarField& y, 00102 scalarField& dydx, 00103 const scalar eps, 00104 const scalarField& yScale, 00105 const scalar hTry, 00106 scalar& hDid, 00107 scalar& hNext 00108 ) const; 00109 }; 00110 00111 00112 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00113 00114 } // End namespace Foam 00115 00116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00117 00118 #endif 00119 00120 // ************************************************************************* // |