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

multivariateScheme.C

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 \*---------------------------------------------------------------------------*/
00026 
00027 #include "volFields.H"
00028 #include "surfaceFields.H"
00029 #include "upwind.H"
00030 
00031 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00032 
00033 namespace Foam
00034 {
00035 
00036 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00037 
00038 template<class Type, class Scheme>
00039 multivariateScheme<Type, Scheme>::multivariateScheme
00040 (
00041     const fvMesh& mesh,
00042     const typename multivariateSurfaceInterpolationScheme<Type>::
00043         fieldTable& fields,
00044     const surfaceScalarField& faceFlux,
00045     Istream& schemeData
00046 )
00047 :
00048     multivariateSurfaceInterpolationScheme<Type>
00049     (
00050         mesh,
00051         fields,
00052         faceFlux,
00053         schemeData
00054     ),
00055     Scheme::LimiterType(schemeData),
00056     faceFlux_(faceFlux),
00057     weights_
00058     (
00059         IOobject
00060         (
00061             "multivariateWeights",
00062             mesh.time().timeName(),
00063             mesh
00064         ),
00065         mesh,
00066         dimless
00067     )
00068 {
00069     typename multivariateSurfaceInterpolationScheme<Type>::
00070         fieldTable::const_iterator iter = this->fields().begin();
00071 
00072     surfaceScalarField limiter = 
00073         Scheme(mesh, faceFlux_, *this).limiter(*iter());
00074 
00075     for (++iter; iter != this->fields().end(); ++iter)
00076     {
00077         limiter = min
00078         (
00079             limiter,
00080             Scheme(mesh, faceFlux_, *this).limiter(*iter())
00081         );
00082     }
00083 
00084     weights_ = 
00085         limiter*mesh.surfaceInterpolation::weights()
00086       + (scalar(1) - limiter)*upwind<Type>(mesh, faceFlux_).weights();
00087 }
00088 
00089 
00090 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00091 
00092 } // End namespace Foam
00093 
00094 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd