Fix tutorials: typo in tutorials/viscoelastic/viscoelasticFluidFoam/S-MDCPP/constant...
[OpenFOAM-1.6-ext.git] / src / finiteVolume / interpolation / surfaceInterpolation / limitedSchemes / upwind / upwind.H
blob1c4ea7048a28cda902ec51bc16b5f004e526e4a5
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright held by original author
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software; you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::upwind
28 Description
29     Upwind differencing scheme class.
31 SourceFiles
32     upwind.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef upwind_H
37 #define upwind_H
39 #include "limitedSurfaceInterpolationScheme.H"
40 #include "volFields.H"
41 #include "surfaceFields.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 /*---------------------------------------------------------------------------*\
49                            Class upwind Declaration
50 \*---------------------------------------------------------------------------*/
52 template<class Type>
53 class upwind
55     public limitedSurfaceInterpolationScheme<Type>
57     // Private Member Functions
59         //- Disallow default bitwise assignment
60         void operator=(const upwind&);
63 public:
65     //- Runtime type information
66     TypeName("upwind");
69     // Constructors
71         //- Construct from faceFlux
72         upwind
73         (
74             const fvMesh& mesh,
75             const surfaceScalarField& faceFlux
76         )
77         :
78             limitedSurfaceInterpolationScheme<Type>(mesh, faceFlux)
79         {}
81         //- Construct from Istream.
82         //  The name of the flux field is read from the Istream and looked-up
83         //  from the mesh objectRegistry
84         upwind
85         (
86             const fvMesh& mesh,
87             Istream& is
88         )
89         :
90             limitedSurfaceInterpolationScheme<Type>(mesh, is)
91         {}
93         //- Construct from faceFlux and Istream
94         upwind
95         (
96             const fvMesh& mesh,
97             const surfaceScalarField& faceFlux,
98             Istream&
99         )
100         :
101             limitedSurfaceInterpolationScheme<Type>(mesh, faceFlux)
102         {}
105     // Member Functions
107         //- Return the interpolation limiter
108         virtual tmp<surfaceScalarField> limiter
109         (
110             const GeometricField<Type, fvPatchField, volMesh>&
111         ) const
112         {
113             return tmp<surfaceScalarField>
114             (
115                 new surfaceScalarField
116                 (
117                     IOobject
118                     (
119                         "upwindLimiter",
120                         this->mesh().time().timeName(),
121                         this->mesh()
122                     ),
123                     this->mesh(),
124                     dimensionedScalar("upwindLimiter", dimless, 0.0)
125                 )
126             );
127         }
129         //- Return the interpolation weighting factors
130         tmp<surfaceScalarField> weights() const
131         {
132             return pos(this->faceFlux_);
133         }
135         //- Return the interpolation weighting factors
136         virtual tmp<surfaceScalarField> weights
137         (
138             const GeometricField<Type, fvPatchField, volMesh>&
139         ) const
140         {
141             return weights();
142         }
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 } // End namespace Foam
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 #endif
154 // ************************************************************************* //