From 67e2f83134b6d042cdf4058fbc19c078571c3f36 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Tue, 29 Jan 2019 09:53:30 +0000 Subject: [PATCH] Bugfix: resolving read problem in initialisation of IB patch fields --- .../fixedValueIbFvPatchField.C | 2 +- .../basic/mixedIbFvPatchField/mixedIbFvPatchField.C | 4 ++-- ...movingImmersedBoundaryVelocityFvPatchVectorField.C | 2 +- .../immersedBoundaryFvsPatchField.C | 11 +++++++++-- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/immersedBoundary/immersedBoundary/immersedBoundaryFvPatchFields/basic/fixedValueIbFvPatchField/fixedValueIbFvPatchField.C b/src/immersedBoundary/immersedBoundary/immersedBoundaryFvPatchFields/basic/fixedValueIbFvPatchField/fixedValueIbFvPatchField.C index 9cdc3e107..ba21b5e4c 100644 --- a/src/immersedBoundary/immersedBoundary/immersedBoundaryFvPatchFields/basic/fixedValueIbFvPatchField/fixedValueIbFvPatchField.C +++ b/src/immersedBoundary/immersedBoundary/immersedBoundaryFvPatchFields/basic/fixedValueIbFvPatchField/fixedValueIbFvPatchField.C @@ -66,7 +66,7 @@ fixedValueIbFvPatchField::fixedValueIbFvPatchField const dictionary& dict ) : - fixedValueFvPatchField(p, iF, dict), + fixedValueFvPatchField(p, iF), // Do not read mixed data immersedBoundaryFieldBase ( p, diff --git a/src/immersedBoundary/immersedBoundary/immersedBoundaryFvPatchFields/basic/mixedIbFvPatchField/mixedIbFvPatchField.C b/src/immersedBoundary/immersedBoundary/immersedBoundaryFvPatchFields/basic/mixedIbFvPatchField/mixedIbFvPatchField.C index c8abaaea7..5f688461e 100644 --- a/src/immersedBoundary/immersedBoundary/immersedBoundaryFvPatchFields/basic/mixedIbFvPatchField/mixedIbFvPatchField.C +++ b/src/immersedBoundary/immersedBoundary/immersedBoundaryFvPatchFields/basic/mixedIbFvPatchField/mixedIbFvPatchField.C @@ -70,7 +70,7 @@ mixedIbFvPatchField::mixedIbFvPatchField const dictionary& dict ) : - mixedFvPatchField(p, iF), + mixedFvPatchField(p, iF), // Do not read mixed data immersedBoundaryFieldBase ( p, @@ -109,7 +109,7 @@ mixedIbFvPatchField::mixedIbFvPatchField // the patch is active // Initialise the value to avoid errors // HJ, 1/Dec/2017 - if (this->ibPatch().ibPolyPatch().active()) +// if (this->ibPatch().ibPolyPatch().active()) { // Re-interpolate the data related to immersed boundary this->updateIbValues(); diff --git a/src/immersedBoundary/immersedBoundary/immersedBoundaryFvPatchFields/derived/movingImmersedBoundaryVelocity/movingImmersedBoundaryVelocityFvPatchVectorField.C b/src/immersedBoundary/immersedBoundary/immersedBoundaryFvPatchFields/derived/movingImmersedBoundaryVelocity/movingImmersedBoundaryVelocityFvPatchVectorField.C index 1a61704a5..c79ac392d 100644 --- a/src/immersedBoundary/immersedBoundary/immersedBoundaryFvPatchFields/derived/movingImmersedBoundaryVelocity/movingImmersedBoundaryVelocityFvPatchVectorField.C +++ b/src/immersedBoundary/immersedBoundary/immersedBoundaryFvPatchFields/derived/movingImmersedBoundaryVelocity/movingImmersedBoundaryVelocityFvPatchVectorField.C @@ -65,7 +65,7 @@ movingImmersedBoundaryVelocityFvPatchVectorField const dictionary& dict ) : - fixedValueFvPatchVectorField(p, iF, dict), + fixedValueFvPatchVectorField(p, iF), // Do not read data immersedBoundaryFieldBase ( p, diff --git a/src/immersedBoundary/immersedBoundary/immersedBoundaryFvsPatchFields/immersedBoundaryFvsPatchField/immersedBoundaryFvsPatchField.C b/src/immersedBoundary/immersedBoundary/immersedBoundaryFvsPatchFields/immersedBoundaryFvsPatchField/immersedBoundaryFvsPatchField.C index 255d29b3d..a13df8432 100644 --- a/src/immersedBoundary/immersedBoundary/immersedBoundaryFvsPatchFields/immersedBoundaryFvsPatchField/immersedBoundaryFvsPatchField.C +++ b/src/immersedBoundary/immersedBoundary/immersedBoundaryFvsPatchFields/immersedBoundaryFvsPatchField/immersedBoundaryFvsPatchField.C @@ -66,9 +66,11 @@ immersedBoundaryFvsPatchField::immersedBoundaryFvsPatchField const dictionary& dict ) : - fvsPatchField(p, iF, dict), + fvsPatchField(p, iF), // Do not read base data ibPatch_(refCast(p)) -{} +{ + operator=(pTraits::zero); +} template @@ -149,6 +151,11 @@ void immersedBoundaryFvsPatchField::evaluate ) { this->updateSize(); + + Field::operator= + ( + Field(this->patch().size(), pTraits::zero) + ); }