1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
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
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
29 Two-scheme localBlended differencing scheme.
34 \*---------------------------------------------------------------------------*/
36 #ifndef localBlended_H
37 #define localBlended_H
39 #include "surfaceInterpolationScheme.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 /*---------------------------------------------------------------------------*\
47 Class localBlended Declaration
48 \*---------------------------------------------------------------------------*/
53 public surfaceInterpolationScheme<Type>
55 // Private Member Functions
58 tmp<surfaceInterpolationScheme<Type> > tScheme1_;
61 tmp<surfaceInterpolationScheme<Type> > tScheme2_;
64 //- Disallow default bitwise copy construct
65 localBlended(const localBlended&);
67 //- Disallow default bitwise assignment
68 void operator=(const localBlended&);
73 //- Runtime type information
74 TypeName("localBlended");
79 //- Construct from mesh and Istream.
80 // The name of the flux field is read from the Istream and looked-up
81 // from the mesh objectRegistry
88 surfaceInterpolationScheme<Type>(mesh),
91 surfaceInterpolationScheme<Type>::New(mesh, is)
95 surfaceInterpolationScheme<Type>::New(mesh, is)
99 //- Construct from mesh, faceFlux and Istream
103 const surfaceScalarField& faceFlux,
107 surfaceInterpolationScheme<Type>(mesh),
110 surfaceInterpolationScheme<Type>::New(mesh, faceFlux, is)
114 surfaceInterpolationScheme<Type>::New(mesh, faceFlux, is)
121 //- Return the interpolation weighting factors
122 tmp<surfaceScalarField> weights
124 const GeometricField<Type, fvPatchField, volMesh>& vf
127 const surfaceScalarField& blendingFactor =
128 this->mesh().objectRegistry::
129 lookupObject<const surfaceScalarField>
131 word(vf.name() + "BlendingFactor")
135 blendingFactor*tScheme1_().weights(vf)
136 + (scalar(1) - blendingFactor)*tScheme2_().weights(vf);
139 //- Return the face-interpolate of the given cell field
140 // with explicit correction
141 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
142 interpolate(const GeometricField<Type, fvPatchField, volMesh>& vf) const
144 const surfaceScalarField& blendingFactor =
146 this->mesh().objectRegistry::
147 lookupObject<const surfaceScalarField>
149 word(vf.name() + "BlendingFactor")
154 blendingFactor*tScheme1_().interpolate(vf)
155 + (scalar(1) - blendingFactor)*tScheme2_().interpolate(vf);
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 } // End namespace Foam
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 // ************************************************************************* //