From e5cb375ab77f8f790d64823d99688d844eaebf40 Mon Sep 17 00:00:00 2001
From: mattijs <mattijs>
Date: Wed, 15 Jun 2022 11:12:10 +0100
Subject: [PATCH] BUG: (un)refinement: combine topochange+motion. Fixes #2492

---
 .../dynamicMotionSolverTopoFvMesh.C                         | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/topoChangerFvMesh/dynamicMotionSolverTopoFvMesh/dynamicMotionSolverTopoFvMesh.C b/src/topoChangerFvMesh/dynamicMotionSolverTopoFvMesh/dynamicMotionSolverTopoFvMesh.C
index 46f5cd86d83..26eb2bc9266 100644
--- a/src/topoChangerFvMesh/dynamicMotionSolverTopoFvMesh/dynamicMotionSolverTopoFvMesh.C
+++ b/src/topoChangerFvMesh/dynamicMotionSolverTopoFvMesh/dynamicMotionSolverTopoFvMesh.C
@@ -5,7 +5,7 @@
     \\  /    A nd           | www.openfoam.com
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
-    Copyright (C) 2016-2020 OpenCFD Ltd
+    Copyright (C) 2016-2020,2022 OpenCFD Ltd
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -95,6 +95,10 @@ Foam::dynamicMotionSolverTopoFvMesh::~dynamicMotionSolverTopoFvMesh()
 
 bool Foam::dynamicMotionSolverTopoFvMesh::update()
 {
+    // Clear moving flag. This is currently required since geometry calculation
+    // might get triggered when doing processor patches.
+    // (TBD: should be in changeMesh if no inflation?)
+    moving(false);
     // Do mesh changes (not using inflation - points added directly into mesh)
     autoPtr<mapPolyMesh> topoChangeMap = topoChanger_.changeMesh(false);
 
-- 
GitLab