From 094039ec2427d8948910a9c5e0804ccb1773cf8d Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Thu, 6 Sep 2018 18:33:34 +0100 Subject: [PATCH] Fix set dead cell value for moving immersed boundary --- ...mersedBoundaryVelocityFvPatchVectorField.C | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/immersedBoundary/immersedBoundary/immersedBoundaryFvPatchFields/derived/movingImmersedBoundaryVelocity/movingImmersedBoundaryVelocityFvPatchVectorField.C b/src/immersedBoundary/immersedBoundary/immersedBoundaryFvPatchFields/derived/movingImmersedBoundaryVelocity/movingImmersedBoundaryVelocityFvPatchVectorField.C index 52594f09e..6097cc36d 100644 --- a/src/immersedBoundary/immersedBoundary/immersedBoundaryFvPatchFields/derived/movingImmersedBoundaryVelocity/movingImmersedBoundaryVelocityFvPatchVectorField.C +++ b/src/immersedBoundary/immersedBoundary/immersedBoundaryFvPatchFields/derived/movingImmersedBoundaryVelocity/movingImmersedBoundaryVelocityFvPatchVectorField.C @@ -66,7 +66,12 @@ movingImmersedBoundaryVelocityFvPatchVectorField ) : fixedValueFvPatchVectorField(p, iF), // Do not read data - immersedBoundaryFieldBase(p, false, vector::zero) + immersedBoundaryFieldBase + ( + p, + Switch(dict.lookup("setDeadValue")), + vector(dict.lookup("deadValue")) + ) { readPatchType(dict); updateIbValues(); @@ -83,7 +88,7 @@ movingImmersedBoundaryVelocityFvPatchVectorField ) : fixedValueFvPatchVectorField(p, iF), // Do not data - immersedBoundaryFieldBase(p, false, vector::zero) + immersedBoundaryFieldBase(p, ptf.setDeadValue(), ptf.deadValue()) { updateIbValues(); } @@ -96,7 +101,12 @@ movingImmersedBoundaryVelocityFvPatchVectorField ) : fixedValueFvPatchVectorField(ptf), - immersedBoundaryFieldBase(ptf.ibPatch(), false, vector::zero) + immersedBoundaryFieldBase + ( + ptf.ibPatch(), + ptf.setDeadValue(), + ptf.deadValue() + ) {} @@ -108,7 +118,12 @@ movingImmersedBoundaryVelocityFvPatchVectorField ) : fixedValueFvPatchVectorField(ptf, iF), - immersedBoundaryFieldBase(ptf.ibPatch(), false, vector::zero) + immersedBoundaryFieldBase + ( + ptf.ibPatch(), + ptf.setDeadValue(), + ptf.deadValue() + ) {} @@ -138,10 +153,8 @@ void Foam::movingImmersedBoundaryVelocityFvPatchVectorField::rmap void Foam::movingImmersedBoundaryVelocityFvPatchVectorField::updateOnMotion() { - Info<< "Update on motion, 1" << endl; if (size() != ibPatch().size()) { - Info<< "Update on motion, 2" << endl; updateIbValues(); } } @@ -208,6 +221,8 @@ void Foam::movingImmersedBoundaryVelocityFvPatchVectorField::write { fvPatchVectorField::write(os); + this->writeDeadData(os); + vectorField::null().writeEntry("value", os); // writeEntry("value", os);