From 7904a2734fbd13b9cbe50d98ddca86dcdd79494a Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 6 Jan 2025 11:30:02 +0000 Subject: [PATCH 1/7] BUG: twoPhaseEuler: incorrect phase. Fixes #3295. --- applications/solvers/multiphase/twoPhaseEulerFoam/EEqns.H | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/EEqns.H b/applications/solvers/multiphase/twoPhaseEulerFoam/EEqns.H index e6dec13b3f..67ae812c71 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/EEqns.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/EEqns.H @@ -50,7 +50,7 @@ + ( he2.name() == thermo2.phasePropertyName("e") ? fvc::div(fvc::absolute(alphaPhi2, alpha2, U2), p) - + p*fvc::ddt(alpha1) + + p*fvc::ddt(alpha2) : -alpha2*dpdt ) From 5aa40389c2758e83183be91ec68b48ac9013ac68 Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 6 Jan 2025 17:40:45 +0000 Subject: [PATCH 2/7] BUG: snappyHexMesh: update dependent vars. Fixes #3297 --- src/mesh/snappyHexMesh/snappyHexMeshDriver/snappySnapDriver.C | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappySnapDriver.C b/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappySnapDriver.C index 7d19b0aef5..9a6d3f9b97 100644 --- a/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappySnapDriver.C +++ b/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappySnapDriver.C @@ -3262,6 +3262,10 @@ void Foam::snappySnapDriver::doSnap // Update mesh mover ppPtr = meshRefinement::makePatch(mesh, adaptPatchIDs); + + // Update distance to attract to nearest feature on surface + snapDist = calcSnapDistance(mesh, snapParams, ppPtr()); + meshMoverPtr.reset ( new motionSmoother From cb1aa273fd76391dc590b7915f3e98dc1f862ad3 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 9 Jan 2025 11:45:01 +0100 Subject: [PATCH 3/7] SUBMODULE: update external-solver, OpenQBMM for v2412 --- modules/OpenQBMM | 2 +- modules/external-solver | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/OpenQBMM b/modules/OpenQBMM index dfbb204b70..9826f810ea 160000 --- a/modules/OpenQBMM +++ b/modules/OpenQBMM @@ -1 +1 @@ -Subproject commit dfbb204b703b0245b00ff82d60ba45e185d4c433 +Subproject commit 9826f810ea9e8d29c66de2cd8e9d5e734d7b1ea8 diff --git a/modules/external-solver b/modules/external-solver index 60323b8a06..090b5a7452 160000 --- a/modules/external-solver +++ b/modules/external-solver @@ -1 +1 @@ -Subproject commit 60323b8a06af9442040b446e6cca8d7f8a7cb0c2 +Subproject commit 090b5a74521214664ea91bb4128c2f4ad62c761c From 4fe3f55e4d2cf7250ae17653fc26ba2f0f0666ad Mon Sep 17 00:00:00 2001 From: Johan Roenby Date: Fri, 10 Jan 2025 15:32:29 +0000 Subject: [PATCH 4/7] BUG: Fixes bug in plicRDF interface reconstruction across cyclic boundaries (fixes #3279) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Description: The plicRDF interface reconstruction scheme calculates a reconstructed distance function (RDF) in all interface cells and their point neighbours. In point neighbours to interface cells, the RDF is calculated as a weighted average of the distances to all adjacent interface cell centres with the weight being the inverse distance to the cell centre. By using the zoneDistribute class written by Henning Scheufler, the required stencil data is communicated efficiently for stencil cells living on different sides of one or more processor patches. Some of the data required for the RDF reconstruction are cell centre and interface centre positions. When a stencil extends across a cyclic patch these positions have so far not been properly transformed in OpenFOAM. This issue is fixed by the current contribution. The fix is done by modifying the zoneDistribute class to hold the required information about zone cells adjacent to cyclic patches. Positions are then communicated with a new getPosition function which replaces getValue for position data in the reconstructedDistanceFunction and plicRDF classes. The implementation does not change the behaviour for cells not on a cyclic patch and should have insignificant effect on efficiency for these. The implementation can probably be optimised in terms of efficiency for zone cells on cyclic patches, but we note that there are generally only very few of these (interface cells and their point neighbours on cyclic patches) and so the potential for speedup is expected to be limited. Current limitations: - In parallel, the user must constrain the decomposition to preserve cyclic patches on the same processor, for the implementation to work properly. - See an example here: tutorials/discInConstantFlowCyclicBCs/system/decomposeParDict - In the case of parallel rotational cyclics that are split by the decomposition the current bugfix does not work and therefore throws an error. This is ongoing work and should be reported and fixed by a future patch. For further details, please see the modified files and the comments therein: - $FOAM_SRC/finiteVolume/fvMesh/zoneDistribute/zoneDistribute.H - $FOAM_SRC/finiteVolume/fvMesh/zoneDistribute/zoneDistribute.C - $FOAM_SRC/finiteVolume/fvMesh/zoneDistribute/zoneDistributeI.H - $FOAM_SRC/transportModels/geometricVoF/reconstructedDistanceFunction/reconstructedDistanceFunction.C - $FOAM_SRC/src/transportModels/geometricVoF/reconstructionSchemes/plicSchemes/plicRDF/plicRDF.C Co-authored-by: David Müller <> KIT Co-authored-by: Konstantinos Missios <> Roskilde University Co-authored-by: Johan Roenby <> Roskilde University and STROMNING --- .../fvMesh/zoneDistribute/zoneDistribute.C | 262 +++++++++++++++++- .../fvMesh/zoneDistribute/zoneDistribute.H | 41 +++ .../fvMesh/zoneDistribute/zoneDistributeI.H | 54 +++- .../reconstructedDistanceFunction.C | 31 ++- .../plicSchemes/plicRDF/plicRDF.C | 24 +- .../discInConstantFlowCyclicBCs/Allclean | 2 + .../discInConstantFlowCyclicBCs/Allrun | 12 +- .../system/controlDict | 2 +- .../system/decomposeParDict | 8 + .../system/fvSolution | 6 +- 10 files changed, 424 insertions(+), 18 deletions(-) diff --git a/src/finiteVolume/fvMesh/zoneDistribute/zoneDistribute.C b/src/finiteVolume/fvMesh/zoneDistribute/zoneDistribute.C index 0aa301237d..b52943570c 100644 --- a/src/finiteVolume/fvMesh/zoneDistribute/zoneDistribute.C +++ b/src/finiteVolume/fvMesh/zoneDistribute/zoneDistribute.C @@ -27,6 +27,7 @@ License \*---------------------------------------------------------------------------*/ #include "zoneDistribute.H" +#include "processorPolyPatch.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -44,10 +45,48 @@ Foam::zoneDistribute::zoneDistribute(const fvMesh& mesh) stencil_(zoneCPCStencil::New(mesh)), globalNumbering_(stencil_.globalNumbering()), send_(UPstream::nProcs()), - pBufs_(UPstream::commsTypes::nonBlocking) + pBufs_(UPstream::commsTypes::nonBlocking), + cyclicBoundaryCells_(mesh.nCells(), false) { // Don't clear storage on persistent buffer pBufs_.allowClearRecv(false); + + // Loop over boundary patches and store cells with a face on a cyclic patch + bool hasCyclicPatches = false; + forAll(mesh.boundaryMesh(), patchi) + { + const cyclicPolyPatch* cpp = + isA(mesh.boundaryMesh()[patchi]); + + if (cpp) + { + cyclicBoundaryCells_.set(cpp->faceCells()); + hasCyclicPatches = true; + } + } + + // Populate cyclicCentres_ + if(hasCyclicPatches) + { + // Make a boolList from the bitSet + boolList isCyclicCell(mesh.nCells(), false); + + forAll(cyclicBoundaryCells_, celli) + { + if (cyclicBoundaryCells_.test(celli)) + { + isCyclicCell[celli] = true; + } + } + + // Use getFields to get map of cell centres across processor boundaries + setUpCommforZone(isCyclicCell, true); + + cyclicCentres_.reset + ( + new Map(getFields(isCyclicCell, mesh_.C())) + ); + } } @@ -141,5 +180,226 @@ void Foam::zoneDistribute::setUpCommforZone } } +Foam::List Foam::zoneDistribute::getCyclicPatches +( + const label celli, + const label globalIdx +) const +{ + // Initialise cyclic patch label list + List