OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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