From a7ec2f7fd4fab816c92c1f92b1fdad416faf75cc Mon Sep 17 00:00:00 2001 From: Henry Date: Mon, 27 Apr 2015 20:22:01 +0100 Subject: [PATCH] surfaceNormalFixedValueFvPatchVectorField: Update fixedValue field to handle mesh-motion Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1667 --- .../derived/fixedMean/fixedMeanFvPatchField.C | 25 ++++++------------- ...urfaceNormalFixedValueFvPatchVectorField.C | 14 ++++++++++- ...urfaceNormalFixedValueFvPatchVectorField.H | 6 +++++ 3 files changed, 27 insertions(+), 18 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedMean/fixedMeanFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedMean/fixedMeanFvPatchField.C index e59f98910e..e1eebee79c 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedMean/fixedMeanFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedMean/fixedMeanFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,15 +26,10 @@ License #include "fixedMeanFvPatchField.H" #include "volFields.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template -fixedMeanFvPatchField::fixedMeanFvPatchField +Foam::fixedMeanFvPatchField::fixedMeanFvPatchField ( const fvPatch& p, const DimensionedField& iF @@ -46,7 +41,7 @@ fixedMeanFvPatchField::fixedMeanFvPatchField template -fixedMeanFvPatchField::fixedMeanFvPatchField +Foam::fixedMeanFvPatchField::fixedMeanFvPatchField ( const fixedMeanFvPatchField& ptf, const fvPatch& p, @@ -60,7 +55,7 @@ fixedMeanFvPatchField::fixedMeanFvPatchField template -fixedMeanFvPatchField::fixedMeanFvPatchField +Foam::fixedMeanFvPatchField::fixedMeanFvPatchField ( const fvPatch& p, const DimensionedField& iF, @@ -73,7 +68,7 @@ fixedMeanFvPatchField::fixedMeanFvPatchField template -fixedMeanFvPatchField::fixedMeanFvPatchField +Foam::fixedMeanFvPatchField::fixedMeanFvPatchField ( const fixedMeanFvPatchField& ptf ) @@ -84,7 +79,7 @@ fixedMeanFvPatchField::fixedMeanFvPatchField template -fixedMeanFvPatchField::fixedMeanFvPatchField +Foam::fixedMeanFvPatchField::fixedMeanFvPatchField ( const fixedMeanFvPatchField& ptf, const DimensionedField& iF @@ -98,7 +93,7 @@ fixedMeanFvPatchField::fixedMeanFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void fixedMeanFvPatchField::updateCoeffs() +void Foam::fixedMeanFvPatchField::updateCoeffs() { if (this->updated()) { @@ -127,7 +122,7 @@ void fixedMeanFvPatchField::updateCoeffs() template -void fixedMeanFvPatchField::write(Ostream& os) const +void Foam::fixedMeanFvPatchField::write(Ostream& os) const { fvPatchField::write(os); os.writeKeyword("meanValue") << meanValue_ << token::END_STATEMENT << nl; @@ -135,8 +130,4 @@ void fixedMeanFvPatchField::write(Ostream& os) const } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.C index 237e602e98..bc6cc097d9 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.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 @@ -132,6 +132,18 @@ void Foam::surfaceNormalFixedValueFvPatchVectorField::rmap } +void Foam::surfaceNormalFixedValueFvPatchVectorField::updateCoeffs() +{ + if (updated()) + { + return; + } + + fvPatchVectorField::operator=(refValue_*patch().nf()); + fvPatchVectorField::updateCoeffs(); +} + + void Foam::surfaceNormalFixedValueFvPatchVectorField::write(Ostream& os) const { fvPatchVectorField::write(os); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.H index 77876be49a..dae8437c75 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.H @@ -175,6 +175,12 @@ public: ); + // Evaluation functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + //- Write virtual void write(Ostream&) const; };