OpenFOAM logo
Open Source CFD Toolkit

KRR4.H

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