From 32b7a26b72fc8db656e9af6dd968afd27e7623c1 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Mon, 10 Aug 2015 12:06:13 +0100 Subject: [PATCH] transformFvPatchField: Specialize valueInternalCoeffs for scalar Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1820 --- .../basic/transform/transformFvPatchField.C | 35 ++++++++----------- .../basic/transform/transformFvPatchField.H | 10 ++++-- .../transform/transformFvPatchScalarField.C | 24 +++++++------ 3 files changed, 37 insertions(+), 32 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/basic/transform/transformFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/basic/transform/transformFvPatchField.C index 2af9131b02..901c81e9cc 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/transform/transformFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/basic/transform/transformFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -27,15 +27,10 @@ License #include "IOstreams.H" #include "transformField.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -transformFvPatchField::transformFvPatchField +Foam::transformFvPatchField::transformFvPatchField ( const fvPatch& p, const DimensionedField& iF @@ -46,7 +41,7 @@ transformFvPatchField::transformFvPatchField template -transformFvPatchField::transformFvPatchField +Foam::transformFvPatchField::transformFvPatchField ( const transformFvPatchField& ptf, const fvPatch& p, @@ -59,7 +54,7 @@ transformFvPatchField::transformFvPatchField template -transformFvPatchField::transformFvPatchField +Foam::transformFvPatchField::transformFvPatchField ( const fvPatch& p, const DimensionedField& iF, @@ -71,7 +66,7 @@ transformFvPatchField::transformFvPatchField template -transformFvPatchField::transformFvPatchField +Foam::transformFvPatchField::transformFvPatchField ( const transformFvPatchField& ptf ) @@ -81,7 +76,7 @@ transformFvPatchField::transformFvPatchField template -transformFvPatchField::transformFvPatchField +Foam::transformFvPatchField::transformFvPatchField ( const transformFvPatchField& ptf, const DimensionedField& iF @@ -94,7 +89,8 @@ transformFvPatchField::transformFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -tmp > transformFvPatchField::valueInternalCoeffs +Foam::tmp > +Foam::transformFvPatchField::valueInternalCoeffs ( const tmp& ) const @@ -104,7 +100,8 @@ tmp > transformFvPatchField::valueInternalCoeffs template -tmp > transformFvPatchField::valueBoundaryCoeffs +Foam::tmp > +Foam::transformFvPatchField::valueBoundaryCoeffs ( const tmp& ) const @@ -120,14 +117,16 @@ tmp > transformFvPatchField::valueBoundaryCoeffs template -tmp > transformFvPatchField::gradientInternalCoeffs() const +Foam::tmp > +Foam::transformFvPatchField::gradientInternalCoeffs() const { return -this->patch().deltaCoeffs()*snGradTransformDiag(); } template -tmp > transformFvPatchField::gradientBoundaryCoeffs() const +Foam::tmp > +Foam::transformFvPatchField::gradientBoundaryCoeffs() const { return snGrad() @@ -138,7 +137,7 @@ tmp > transformFvPatchField::gradientBoundaryCoeffs() const // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // template -void transformFvPatchField::operator= +void Foam::transformFvPatchField::operator= ( const fvPatchField& ptf ) @@ -147,8 +146,4 @@ void transformFvPatchField::operator= } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/basic/transform/transformFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/basic/transform/transformFvPatchField.H index 0eab206104..76174f2627 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/transform/transformFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/transform/transformFvPatchField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -153,7 +153,13 @@ public: // * * * * * * * * * * * Template Specialisations * * * * * * * * * * * * * // template<> -tmp transformFvPatchField::gradientInternalCoeffs() const; +tmp transformFvPatchField::valueInternalCoeffs +( + const tmp& +) const; + +template<> +tmp transformFvPatchField::gradientInternalCoeffs() const; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/basic/transform/transformFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/basic/transform/transformFvPatchScalarField.C index 506374c742..81947be896 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/transform/transformFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/basic/transform/transformFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,21 +25,25 @@ License #include "transformFvPatchField.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<> -tmp transformFvPatchField::gradientInternalCoeffs() const +Foam::tmp +Foam::transformFvPatchField::valueInternalCoeffs +( + const tmp& +) const { - return tmp(new scalarField(size(), 0.0)); + return tmp(new scalarField(size(), 1.0)); } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace Foam +template<> +Foam::tmp +Foam::transformFvPatchField::gradientInternalCoeffs() const +{ + return tmp(new scalarField(size(), 0.0)); +} + // ************************************************************************* //