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

UpwindFitData.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::UpwindFitData
00027 
00028 Description
00029     Data for the quadratic fit correction interpolation scheme to be used with
00030     upwind biased stencil.
00031     - linearCorrection = true : fit calculated for corrected linear scheme
00032     - linearCorrection = false : fit calculated for corrected upwind scheme
00033 
00034 SourceFiles
00035     UpwindFitData.C
00036 
00037 \*---------------------------------------------------------------------------*/
00038 
00039 #ifndef UpwindFitData_H
00040 #define UpwindFitData_H
00041 
00042 #include "FitData.H"
00043 
00044 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00045 
00046 namespace Foam
00047 {
00048 
00049 class extendedUpwindCellToFaceStencil;
00050 
00051 /*---------------------------------------------------------------------------*\
00052                     Class UpwindFitData Declaration
00053 \*---------------------------------------------------------------------------*/
00054 
00055 template<class Polynomial>
00056 class UpwindFitData
00057 :
00058     public FitData
00059     <
00060         UpwindFitData<Polynomial>,
00061         extendedUpwindCellToFaceStencil,
00062         Polynomial
00063     >
00064 {
00065     // Private data
00066 
00067         //- For each face of the mesh store the coefficients to multiply the
00068         //  stencil cell values by if the flow is from the owner
00069         List<scalarList> owncoeffs_;
00070 
00071         //- For each face of the mesh store the coefficients to multiply the
00072         //  stencil cell values by if the flow is from the neighbour
00073         List<scalarList> neicoeffs_;
00074 
00075 
00076     // Private member functions
00077 
00078         //- Calculate the fit for the all the mesh faces
00079         //  and set the coefficients
00080         void calcFit();
00081 
00082 
00083 public:
00084 
00085     TypeName("UpwindFitData");
00086 
00087 
00088     // Constructors
00089 
00090         //- Construct from components
00091         UpwindFitData
00092         (
00093             const fvMesh& mesh,
00094             const extendedUpwindCellToFaceStencil& stencil,
00095             const bool linearCorrection,
00096             const scalar linearLimitFactor,
00097             const scalar centralWeight
00098         );
00099 
00100 
00101     //- Destructor
00102     virtual ~UpwindFitData()
00103     {}
00104 
00105 
00106     // Member functions
00107 
00108         //- Return reference to owner fit coefficients
00109         const List<scalarList>& owncoeffs() const
00110         {
00111             return owncoeffs_;
00112         }
00113 
00114         //- Return reference to neighbour fit coefficients
00115         const List<scalarList>& neicoeffs() const
00116         {
00117             return neicoeffs_;
00118         }
00119 };
00120 
00121 
00122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00123 
00124 } // End namespace Foam
00125 
00126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00127 
00128 #ifdef NoRepository
00129 #   include "UpwindFitData.C"
00130 #endif
00131 
00132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00133 
00134 #endif
00135 
00136 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd