From 2853f9ddfd22d6783b5acb37f543d3f076c3f75f Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Wed, 11 Sep 2024 16:52:25 +0100 Subject: [PATCH] movingMappedWallVelocity: Fix calculation of mapped shear velocity --- .../movingMappedWallVelocityFvPatchVectorField.C | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/movingMappedWallVelocity/movingMappedWallVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/movingMappedWallVelocity/movingMappedWallVelocityFvPatchVectorField.C index 318b98810a..812f1c7742 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/movingMappedWallVelocity/movingMappedWallVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/movingMappedWallVelocity/movingMappedWallVelocityFvPatchVectorField.C @@ -107,18 +107,19 @@ void Foam::movingMappedWallVelocityFvPatchVectorField::updateCoeffs() : tmp(new scalarField(fvp.size(), Zero)); // Calculate and map the mesh velocity from the neighbour - vectorField nbrCf0(nbrFvp.size()); + vectorField nbrCf(nbrFvp.size()), nbrCf0(nbrFvp.size()); forAll(nbrCf0, nbrPatchFacei) { + const label nbrPolyFacei = + nbrMesh.polyFacesBf()[nbrFvp.index()][nbrPatchFacei]; + nbrCf[nbrPatchFacei] = + nbrMesh.faceCentres()[nbrPolyFacei]; nbrCf0[nbrPatchFacei] = - nbrMesh.faces() - [ - nbrMesh.polyFacesBf()[nbrFvp.index()][nbrPatchFacei] - ].centre(nbrMesh.oldPoints()); + nbrMesh.faces()[nbrPolyFacei].centre(nbrMesh.oldPoints()); } const vectorField nbrUp ( - (nbrFvp.Cf() - nbrCf0)/db().time().deltaTValue() + (nbrCf - nbrCf0)/db().time().deltaTValue() ); const vectorField Up(mapper.fromNeighbour(nbrUp));