Added support for limitWith scheme.

This commit is contained in:
henry
2008-09-13 10:36:59 +01:00
parent fc4de936c2
commit 165bac9745
3 changed files with 30 additions and 14 deletions

View File

@ -187,6 +187,7 @@ $(limitedSchemes)/Phi/Phi.C
$(limitedSchemes)/filteredLinear/filteredLinear.C $(limitedSchemes)/filteredLinear/filteredLinear.C
$(limitedSchemes)/filteredLinear2/filteredLinear2.C $(limitedSchemes)/filteredLinear2/filteredLinear2.C
$(limitedSchemes)/filteredLinear3/filteredLinear3.C $(limitedSchemes)/filteredLinear3/filteredLinear3.C
$(limitedSchemes)/limitWith/limitWith.C
multivariateSchemes = $(surfaceInterpolation)/multivariateSchemes multivariateSchemes = $(surfaceInterpolation)/multivariateSchemes
$(multivariateSchemes)/multivariateSurfaceInterpolationScheme/multivariateSurfaceInterpolationSchemes.C $(multivariateSchemes)/multivariateSurfaceInterpolationScheme/multivariateSurfaceInterpolationSchemes.C

View File

@ -22,9 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation, along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Abstract base class for surface interpolation schemes.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "limitedSurfaceInterpolationScheme.H" #include "limitedSurfaceInterpolationScheme.H"
@ -39,7 +36,6 @@ namespace Foam
// * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
// Return weighting factors for scheme given by name in dictionary
template<class Type> template<class Type>
tmp<limitedSurfaceInterpolationScheme<Type> > tmp<limitedSurfaceInterpolationScheme<Type> >
limitedSurfaceInterpolationScheme<Type>::New limitedSurfaceInterpolationScheme<Type>::New
@ -160,17 +156,14 @@ limitedSurfaceInterpolationScheme<Type>::~limitedSurfaceInterpolationScheme()
template<class Type> template<class Type>
tmp<surfaceScalarField> limitedSurfaceInterpolationScheme<Type>::weights tmp<surfaceScalarField> limitedSurfaceInterpolationScheme<Type>::weights
( (
const GeometricField<Type, fvPatchField, volMesh>& phi const GeometricField<Type, fvPatchField, volMesh>& phi,
const surfaceScalarField& CDweights,
tmp<surfaceScalarField> tLimiter
) const ) const
{ {
const fvMesh& mesh = this->mesh();
// Note that here the weights field is initialised as the limiter // Note that here the weights field is initialised as the limiter
// from which the weight is calculated using the limiter value // from which the weight is calculated using the limiter value
tmp<surfaceScalarField> tWeights(this->limiter(phi)); surfaceScalarField& Weights = tLimiter();
surfaceScalarField& Weights = tWeights();
const surfaceScalarField& CDweights = mesh.surfaceInterpolation::weights();
scalarField& pWeights = Weights.internalField(); scalarField& pWeights = Weights.internalField();
@ -199,9 +192,22 @@ tmp<surfaceScalarField> limitedSurfaceInterpolationScheme<Type>::weights
} }
} }
return tWeights; return tLimiter;
} }
template<class Type>
tmp<surfaceScalarField> limitedSurfaceInterpolationScheme<Type>::weights
(
const GeometricField<Type, fvPatchField, volMesh>& phi
) const
{
return this->weights
(
phi,
this->mesh().surfaceInterpolation::weights(),
this->limiter(phi)
);
}
template<class Type> template<class Type>
tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >

View File

@ -26,7 +26,7 @@ Class
Foam::limitedSurfaceInterpolationScheme Foam::limitedSurfaceInterpolationScheme
Description Description
Abstract base class for surface interpolation schemes. Abstract base class for limited surface interpolation schemes.
SourceFiles SourceFiles
limitedSurfaceInterpolationScheme.C limitedSurfaceInterpolationScheme.C
@ -119,7 +119,7 @@ public:
{} {}
//- Construct from mesh and Istream. //- Construct from mesh and Istream.
// The name of the flux field is read from the Istream and looked-up // The name of the flux field is read from the Istream and looked-up
// from the mesh objectRegistry // from the mesh objectRegistry
limitedSurfaceInterpolationScheme limitedSurfaceInterpolationScheme
@ -170,6 +170,15 @@ public:
const GeometricField<Type, fvPatchField, volMesh>& const GeometricField<Type, fvPatchField, volMesh>&
) const = 0; ) const = 0;
//- Return the interpolation weighting factors for the given field,
// by limiting the given weights with the given limiter
tmp<surfaceScalarField> weights
(
const GeometricField<Type, fvPatchField, volMesh>&,
const surfaceScalarField& CDweights,
tmp<surfaceScalarField> tLimiter
) const;
//- Return the interpolation weighting factors for the given field //- Return the interpolation weighting factors for the given field
virtual tmp<surfaceScalarField> weights virtual tmp<surfaceScalarField> weights
( (