From b022118ff219ff200f8aebed1578ae24755b1aca Mon Sep 17 00:00:00 2001 From: Jon Rood Date: Wed, 25 Mar 2026 09:35:51 -0600 Subject: [PATCH 1/5] Deallocate in BPatch destructor. --- Source/PeleLMeX_BPatch.H | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/Source/PeleLMeX_BPatch.H b/Source/PeleLMeX_BPatch.H index e60aa6739..90a1d8743 100644 --- a/Source/PeleLMeX_BPatch.H +++ b/Source/PeleLMeX_BPatch.H @@ -11,7 +11,7 @@ class BPatch public: BPatch() = default; - ~BPatch() = default; + ~BPatch() { deallocate(); } BPatch( const std::string& patch_name, @@ -171,20 +171,22 @@ public: patch_rect_ann_outer_lo_touse[m_boundary_dir] = 0.0; patch_rect_ann_outer_hi_touse[m_boundary_dir] = 0.0; - if (((xp >= patch_rect_ann_outer_lo_touse[0] && - xp <= patch_rect_ann_outer_hi_touse[0]) && - (yp >= patch_rect_ann_outer_lo_touse[1] && - yp <= patch_rect_ann_outer_hi_touse[1]) && - (zp >= patch_rect_ann_outer_lo_touse[2] && - zp <= patch_rect_ann_outer_hi_touse[2]))) { + if ( + ((xp >= patch_rect_ann_outer_lo_touse[0] && + xp <= patch_rect_ann_outer_hi_touse[0]) && + (yp >= patch_rect_ann_outer_lo_touse[1] && + yp <= patch_rect_ann_outer_hi_touse[1]) && + (zp >= patch_rect_ann_outer_lo_touse[2] && + zp <= patch_rect_ann_outer_hi_touse[2]))) { inside_outer = true; } - if (((xp >= patch_rect_ann_inner_lo_touse[0] && - xp <= patch_rect_ann_inner_hi_touse[0]) && - (yp >= patch_rect_ann_inner_lo_touse[1] && - yp <= patch_rect_ann_inner_hi_touse[1]) && - (zp >= patch_rect_ann_inner_lo_touse[2] && - zp <= patch_rect_ann_inner_hi_touse[2]))) { + if ( + ((xp >= patch_rect_ann_inner_lo_touse[0] && + xp <= patch_rect_ann_inner_hi_touse[0]) && + (yp >= patch_rect_ann_inner_lo_touse[1] && + yp <= patch_rect_ann_inner_hi_touse[1]) && + (zp >= patch_rect_ann_inner_lo_touse[2] && + zp <= patch_rect_ann_inner_hi_touse[2]))) { inside_inner = true; } if (inside_outer && !inside_inner) { From 0802f6073f2a730e0469701a7a6d65c96d713ca6 Mon Sep 17 00:00:00 2001 From: Jon Rood Date: Wed, 25 Mar 2026 10:05:12 -0600 Subject: [PATCH 2/5] Formatting. --- Source/PeleLMeX_BPatch.H | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/Source/PeleLMeX_BPatch.H b/Source/PeleLMeX_BPatch.H index 90a1d8743..273d8af42 100644 --- a/Source/PeleLMeX_BPatch.H +++ b/Source/PeleLMeX_BPatch.H @@ -11,7 +11,7 @@ class BPatch public: BPatch() = default; - ~BPatch() { deallocate(); } + ~BPatch() = { deallocate(); } BPatch( const std::string& patch_name, @@ -171,22 +171,20 @@ public: patch_rect_ann_outer_lo_touse[m_boundary_dir] = 0.0; patch_rect_ann_outer_hi_touse[m_boundary_dir] = 0.0; - if ( - ((xp >= patch_rect_ann_outer_lo_touse[0] && - xp <= patch_rect_ann_outer_hi_touse[0]) && - (yp >= patch_rect_ann_outer_lo_touse[1] && - yp <= patch_rect_ann_outer_hi_touse[1]) && - (zp >= patch_rect_ann_outer_lo_touse[2] && - zp <= patch_rect_ann_outer_hi_touse[2]))) { + if (((xp >= patch_rect_ann_outer_lo_touse[0] && + xp <= patch_rect_ann_outer_hi_touse[0]) && + (yp >= patch_rect_ann_outer_lo_touse[1] && + yp <= patch_rect_ann_outer_hi_touse[1]) && + (zp >= patch_rect_ann_outer_lo_touse[2] && + zp <= patch_rect_ann_outer_hi_touse[2]))) { inside_outer = true; } - if ( - ((xp >= patch_rect_ann_inner_lo_touse[0] && - xp <= patch_rect_ann_inner_hi_touse[0]) && - (yp >= patch_rect_ann_inner_lo_touse[1] && - yp <= patch_rect_ann_inner_hi_touse[1]) && - (zp >= patch_rect_ann_inner_lo_touse[2] && - zp <= patch_rect_ann_inner_hi_touse[2]))) { + if (((xp >= patch_rect_ann_inner_lo_touse[0] && + xp <= patch_rect_ann_inner_hi_touse[0]) && + (yp >= patch_rect_ann_inner_lo_touse[1] && + yp <= patch_rect_ann_inner_hi_touse[1]) && + (zp >= patch_rect_ann_inner_lo_touse[2] && + zp <= patch_rect_ann_inner_hi_touse[2]))) { inside_inner = true; } if (inside_outer && !inside_inner) { From 89013d831a745f5617f7c644ecfabc83c16bbdcb Mon Sep 17 00:00:00 2001 From: Jon Rood Date: Wed, 25 Mar 2026 10:08:27 -0600 Subject: [PATCH 3/5] Fix mistake. --- Source/PeleLMeX_BPatch.H | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/PeleLMeX_BPatch.H b/Source/PeleLMeX_BPatch.H index 273d8af42..ec0cce56c 100644 --- a/Source/PeleLMeX_BPatch.H +++ b/Source/PeleLMeX_BPatch.H @@ -11,7 +11,7 @@ class BPatch public: BPatch() = default; - ~BPatch() = { deallocate(); } + ~BPatch() { deallocate(); } BPatch( const std::string& patch_name, From 6106121165cea9da0414e0ce2435c836d671a988 Mon Sep 17 00:00:00 2001 From: Bruce Perry Date: Wed, 25 Mar 2026 17:08:42 -0600 Subject: [PATCH 4/5] remove unused BPatch pointers from PeleLMeX class --- Source/PeleLMeX.H | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Source/PeleLMeX.H b/Source/PeleLMeX.H index b37379226..d9b614eda 100644 --- a/Source/PeleLMeX.H +++ b/Source/PeleLMeX.H @@ -1875,10 +1875,6 @@ public: ProbParm* prob_parm = nullptr; ProbParm* prob_parm_d = nullptr; - // Patch parameters - BPatch* boundary_patches = nullptr; - BPatch* boundary_patches_d = nullptr; - #ifdef PELE_USE_SOOT // Soot parameters SootModel* soot_model = nullptr; From a6afc56e5281dea34844dae5323f5c8489868d17 Mon Sep 17 00:00:00 2001 From: Bruce Perry Date: Wed, 25 Mar 2026 17:23:14 -0600 Subject: [PATCH 5/5] adjust triple flame test to actually test active control and boundary patches --- Exec/RegTests/TripleFlame/tripleflame-2d.inp | 34 +++++++++++++------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/Exec/RegTests/TripleFlame/tripleflame-2d.inp b/Exec/RegTests/TripleFlame/tripleflame-2d.inp index 3f3dee0ba..f418bf21e 100644 --- a/Exec/RegTests/TripleFlame/tripleflame-2d.inp +++ b/Exec/RegTests/TripleFlame/tripleflame-2d.inp @@ -39,6 +39,16 @@ peleLM.do_extremas = 1 # Compute state extremas peleLM.do_mass_balance = 1 # Compute mass balance peleLM.do_species_balance = 1 # Compute species balance +# Patches +peleLM.do_patch_mfr = 1 +peleLM.bpatch.patchnames = outlet +bpatch.outlet.patchtype = line # (full-boundary,circle,rectangle,circle-annular,rectangle-annular) +bpatch.outlet.patch_line_radius = 0.005 +bpatch.outlet.patch_line_center = 0.005 0 +bpatch.outlet.boundary_direction = 1 +bpatch.outlet.boundary_lo_or_hi = 0 +bpatch.outlet.species = O2 N2 CH4 + #---------------------- Time Stepping CONTROL -------------------- amr.max_step = 20 # Maximum number of time steps amr.stop_time = 4.00 # final simulation physical time @@ -53,18 +63,18 @@ amr.plot_int = 20 # Frequency of pltfile output amr.derive_plot_vars = avg_pressure mag_vort mass_fractions mixture_fraction progress_variable #---------------------- AC CONTROL ------------------------------- -active_control.on = 0 # Use AC ? -# active_control.use_temp = 1 # Default in fuel mass, rather use iso-T position ? -# active_control.temperature = 1400.0 # Value of iso-T ? -# active_control.tau = 5.0e-4 # Control tau (should ~ 10 dt) -# active_control.height = 0.01 # Where is the flame held ? Default assumes coordinate along Y in 2D or Z in 3D. -# active_control.v = 1 # verbose -# active_control.method = 1 # Controller: 1 - Linear, 2 - Quadratic, 3 - Weighted quadratic -# active_control.velMax = 2.0 # Optional: limit inlet velocity -# active_control.changeMax = 0.1 # Optional: limit inlet velocity changes (absolute m/s) -# active_control.flow_dir = 1 # Optional: flame main direction. Default: AMREX_SPACEDIM-1 -# active_control.pseudo_gravity = 1 # Optional: add density proportional force to compensate for the acceleration - # of the gas due to inlet velocity changes +active_control.on = 1 # Use AC ? +active_control.use_temp = 1 # Default in fuel mass, rather use iso-T position ? +active_control.temperature = 1400.0 # Value of iso-T ? +active_control.tau = 5.0e-4 # Control tau (should ~ 10 dt) +active_control.height = 0.01 # Where is the flame held ? Default assumes coordinate along Y in 2D or Z in 3D. +active_control.v = 1 # verbose +active_control.method = 1 # Controller: 1 - Linear, 2 - Quadratic, 3 - Weighted quadratic +active_control.velMax = 2.0 # Optional: limit inlet velocity +active_control.changeMax = 0.1 # Optional: limit inlet velocity changes (absolute m/s) +active_control.flow_dir = 1 # Optional: flame main direction. Default: AMREX_SPACEDIM-1 +active_control.pseudo_gravity = 1 # Optional: add density proportional force to compensate for the acceleration + # of the gas due to inlet velocity changes #---------------------- Derived CONTROLS ------------------------- peleLM.fuel_name = CH4