FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

SIBS.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-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::SIBS
00026 
00027 Description
00028     Foam::SIBS
00029 
00030 SourceFiles
00031     SIMPR.C
00032     polyExtrapolate.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef SIBS_H
00037 #define SIBS_H
00038 
00039 #include <ODE/ODESolver.H>
00040 
00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00042 
00043 namespace Foam
00044 {
00045 
00046 /*---------------------------------------------------------------------------*\
00047                            Class SIBS Declaration
00048 \*---------------------------------------------------------------------------*/
00049 
00050 class SIBS
00051 :
00052     public ODESolver
00053 {
00054     // Private data
00055 
00056         static const label kMaxX_ = 7, iMaxX_ = kMaxX_ + 1;
00057         static const label nSeq_[iMaxX_];
00058 
00059         static const scalar safe1, safe2, redMax, redMin, scaleMX;
00060 
00061         mutable scalarField a_;
00062         mutable scalarSquareMatrix alpha_;
00063         mutable scalarRectangularMatrix d_p_;
00064         mutable scalarField x_p_;
00065         mutable scalarField err_;
00066 
00067         mutable scalarField yTemp_;
00068         mutable scalarField ySeq_;
00069         mutable scalarField yErr_;
00070         mutable scalarField dfdx_;
00071         mutable scalarSquareMatrix dfdy_;
00072 
00073         mutable label first_, kMax_, kOpt_;
00074         mutable scalar epsOld_, xNew_;
00075 
00076 
00077     // Private member functions
00078 
00079         void SIMPR
00080         (
00081             const ODE& ode,
00082             const scalar xStart,
00083             const scalarField& y,
00084             const scalarField& dydx,
00085             const scalarField& dfdx,
00086             const scalarSquareMatrix& dfdy,
00087             const scalar deltaX,
00088             const label nSteps,
00089             scalarField& yEnd
00090         ) const;
00091 
00092         void polyExtrapolate
00093         (
00094             const label iest,
00095             const scalar xest,
00096             const scalarField& yest,
00097             scalarField& yz,
00098             scalarField& dy,
00099             scalarField& x_p,
00100             scalarRectangularMatrix& d_p
00101         ) const;
00102 
00103 
00104 public:
00105 
00106     //- Runtime type information
00107     TypeName("SIBS");
00108 
00109 
00110     // Constructors
00111 
00112         //- Construct from ODE
00113         SIBS(const ODE& ode);
00114 
00115 
00116     // Member Functions
00117 
00118         void solve
00119         (
00120             const ODE& ode,
00121             scalar& x,
00122             scalarField& y,
00123             scalarField& dydx,
00124             const scalar eps,
00125             const scalarField& yScale,
00126             const scalar hTry,
00127             scalar& hDid,
00128             scalar& hNext
00129         ) const;
00130 };
00131 
00132 
00133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00134 
00135 } // End namespace Foam
00136 
00137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00138 
00139 #endif
00140 
00141 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines