From dd65056e2f89e8e61ca5fc5408b2c7deb64850cf Mon Sep 17 00:00:00 2001 From: John Date: Thu, 17 Sep 2026 12:55:17 -0400 Subject: [PATCH 1/2] DOC: update OpenFOAM-14 AMR redistribution setup --- tutorials/AMB2018-02-B/README.md | 27 ++++++++++++++++++- .../AMB2018-02-B/constant/dynamicMeshDict | 13 +++++++++ .../AMB2018-02-B/system/decomposeParDict | 14 +++++++++- 3 files changed, 52 insertions(+), 2 deletions(-) diff --git a/tutorials/AMB2018-02-B/README.md b/tutorials/AMB2018-02-B/README.md index ffa1705..210a5a7 100644 --- a/tutorials/AMB2018-02-B/README.md +++ b/tutorials/AMB2018-02-B/README.md @@ -57,7 +57,16 @@ Defines the laser path, laser power, and scan speed or dwell time. constant/dynamicMeshDict ``` -Defines the dynamic mesh/refinement settings. +Defines the dynamic mesh/refinement settings and cell-count-based runtime +redistribution. + +```text +system/decomposeParDict +``` + +Selects Scotch for the initial decomposition and PT-Scotch for optional runtime +redistribution. It also enables the `refinementHistory` constraint required to +keep refinement siblings together for unrefinement. ```text system/blockMeshDict @@ -152,6 +161,17 @@ refinement The refinement region projects along the heat source path and targets a desired average cell load per processor. +Runtime redistribution is disabled by default with `type none` in +`constant/dynamicMeshDict`. Change it to `type distributor` to enable the +provided PT-Scotch configuration. The mesh distributor then checks every 10 +time steps and redistributes when an active refinement model creates more than +10% cell-count imbalance. These are starting values; production cases should +tune `redistributionInterval` and `maxImbalance` for their mesh and MPI count. + +The tutorial uses OpenFOAM's generic `distributor`, which balances cell counts. +Do not change its type to `loadBalancer`: that component requires registered +per-cell `cpuLoad` objects that AdditiveFOAM does not currently provide. + ### Coefficients `model` @@ -233,6 +253,11 @@ enabled false; `solidificationData` writes solidification events for CET analysis. `ExaCA` writes temperature history data for ExaCA input files. +The ExaCA function object supports refinement on a fixed processor +decomposition but not runtime mesh redistribution. Keep the distributor set to +`type none` in `constant/dynamicMeshDict` when combining ExaCA with an active +refinement model. + The `Allrun` script calls the reconstruction helpers after the solver finishes: ```sh diff --git a/tutorials/AMB2018-02-B/constant/dynamicMeshDict b/tutorials/AMB2018-02-B/constant/dynamicMeshDict index 5def0f0..20bfa1b 100644 --- a/tutorials/AMB2018-02-B/constant/dynamicMeshDict +++ b/tutorials/AMB2018-02-B/constant/dynamicMeshDict @@ -36,4 +36,17 @@ topoChanger dumpLevel true; } +// Cell-count-based redistribution for parallel AMR. To enable it, change +// the type from none to distributor. +distributor +{ + type none; + + libs ("libfvMeshDistributors.so"); + + redistributionInterval 10; + + maxImbalance 0.10; +} + // ************************************************************************* // diff --git a/tutorials/AMB2018-02-B/system/decomposeParDict b/tutorials/AMB2018-02-B/system/decomposeParDict index da6a847..bdb38ce 100644 --- a/tutorials/AMB2018-02-B/system/decomposeParDict +++ b/tutorials/AMB2018-02-B/system/decomposeParDict @@ -17,6 +17,18 @@ FoamFile numberOfSubdomains 8; -method scotch; +decomposer scotch; + +distributor ptscotch; + +libs ("libptscotchDecomp.so"); + +constraints +{ + refinementHistory + { + type refinementHistory; + } +} // ************************************************************************* // From 47090544e4c9225c8f86a191d28c0c5b438ecf9b Mon Sep 17 00:00:00 2001 From: John Coleman <103219962+colemanjs@users.noreply.github.com> Date: Thu, 17 Sep 2026 12:58:37 -0400 Subject: [PATCH 2/2] Clarify comments in dynamicMeshDict Updated comments for clarity in dynamicMeshDict. --- tutorials/AMB2018-02-B/constant/dynamicMeshDict | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tutorials/AMB2018-02-B/constant/dynamicMeshDict b/tutorials/AMB2018-02-B/constant/dynamicMeshDict index 20bfa1b..0ba4eb7 100644 --- a/tutorials/AMB2018-02-B/constant/dynamicMeshDict +++ b/tutorials/AMB2018-02-B/constant/dynamicMeshDict @@ -36,8 +36,8 @@ topoChanger dumpLevel true; } -// Cell-count-based redistribution for parallel AMR. To enable it, change -// the type from none to distributor. +// Cell-count-based redistribution for parallel AMR. +// To enable, change type from "none" to "distributor". distributor { type none;