From 3968a5c9005bc29299efe03c7c2b3e95765a69df Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Tue, 4 Apr 2017 16:35:14 +0100 Subject: [PATCH] Added support for block-coupled coefficients in fvPatchFields --- .../fvPatchFields/fvPatchField/fvPatchField.H | 163 +++++++++++++----- 1 file changed, 123 insertions(+), 40 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H index daed7adcb..5d4a7b2c8 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H @@ -46,6 +46,7 @@ SourceFiles #include "fvPatch.H" #include "DimensionedField.H" +#include "coeffFields.H" #include "debugSwitch.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -329,6 +330,14 @@ public: return false; } + //- Return true if this patch field is block-coupled in the + // boundary condition, ie. if the coupling coefficient is a + // rank x rank implicit block + virtual bool blockCoupled() const + { + return false; + } + //- Return true if the boundary condition has already been updated bool updated() const { @@ -388,51 +397,125 @@ public: ); - //- Return the matrix diagonal coefficients corresponding to the - // evaluation of the value of this patchField with given weights - virtual tmp > valueInternalCoeffs - ( - const tmp >& - ) const - { - notImplemented + // Decoupled matrix coefficients + + //- Return the matrix diagonal coefficients corresponding to the + // evaluation of the value of this patchField with + // given weights + virtual tmp > valueInternalCoeffs ( - type() - + "::valueInternalCoeffs(const tmp >&)" - ); - return *this; - } + const tmp >& + ) const + { + notImplemented + ( + type() + + "::valueInternalCoeffs(const tmp >&)" + ); - //- Return the matrix source coefficients corresponding to the - // evaluation of the value of this patchField with given weights - virtual tmp > valueBoundaryCoeffs - ( - const tmp >& - ) const - { - notImplemented + return *this; + } + + //- Return the matrix source coefficients corresponding to the + // evaluation of the value of this patchField with given + // weights + virtual tmp > valueBoundaryCoeffs ( - type() - + "::valueBoundaryCoeffs(const tmp >&)" - ); - return *this; - } + const tmp >& + ) const + { + notImplemented + ( + type() + + "::valueBoundaryCoeffs(const tmp >&)" + ); + return *this; + } - //- Return the matrix diagonal coefficients corresponding to the - // evaluation of the gradient of this patchField - virtual tmp > gradientInternalCoeffs() const - { - notImplemented(type() + "::gradientInternalCoeffs()"); - return *this; - } + //- Return the matrix diagonal coefficients corresponding to the + // evaluation of the gradient of this patchField + virtual tmp > gradientInternalCoeffs() const + { + notImplemented(type() + "::gradientInternalCoeffs()"); + return *this; + } - //- Return the matrix source coefficients corresponding to the - // evaluation of the gradient of this patchField - virtual tmp > gradientBoundaryCoeffs() const - { - notImplemented(type() + "::gradientBoundaryCoeffs()"); - return *this; - } + //- Return the matrix source coefficients corresponding to the + // evaluation of the gradient of this patchField + virtual tmp > gradientBoundaryCoeffs() const + { + notImplemented(type() + "::gradientBoundaryCoeffs()"); + return *this; + } + + + // Block-coupled matrix coefficients + + //- Return the matrix diagonal coefficients corresponding to the + // evaluation of the value of this patchField with given + // weights + virtual tmp > blockValueInternalCoeffs + ( + const tmp& + ) const + { + notImplemented + ( + type() + + "::blockValueInternalCoeffs(const tmp >&)" + ); + + return tmp > + ( + new CoeffField(this->size()) + ); + } + + //- Return the matrix source coefficients corresponding to the + // evaluation of the value of this patchField with given + // weights + virtual tmp > blockValueBoundaryCoeffs + ( + const tmp& + ) const + { + notImplemented + ( + type() + + "::blockValueBoundaryCoeffs(const tmp >&)" + ); + + return *this; + } + + //- Return the matrix diagonal coefficients corresponding to the + // evaluation of the gradient of this patchField + virtual tmp > + blockGradientInternalCoeffs() const + { + notImplemented + ( + type() + "blockGradientInternalCoeffs() const" + ); + + return tmp > + ( + new CoeffField(this->size()) + ); + } + + //- Return the matrix source coefficients corresponding to the + // evaluation of the gradient of this patchField + virtual tmp > + blockGradientBoundaryCoeffs() const + { + notImplemented + ( + type() + "::blockGradientBoundaryCoeffs()" + ); + + return *this; + } // Patch interpolation and patch flux