Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions examples/2D_IGR_forward_facing_step/case.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
import json
import math

h = 0.2

# Radius as a percentage of height (h)
rc = 0.2

gam_a = 1.4
p0 = 1
rho0 = 1.4
c0 = math.sqrt(gam_a * p0 / rho0)
v0 = 3 * c0
mu = rho0 * v0 * h / 2e5

# Configuring case dictionary
print(
json.dumps(
{
# Logistics
"run_time_info": "T",
"x_domain%beg": 0,
"x_domain%end": 15 * h,
"y_domain%beg": 0,
"y_domain%end": 5 * h,
"cyl_coord": "F",
"m": 1499,
"n": 499,
"p": 0,
"cfl_adap_dt": "T",
"cfl_target": 0.6,
"n_start": 0,
"t_save": 0.04,
"t_stop": 4,
# Simulation Algorithm Parameters
"num_patches": 1,
"model_eqns": 2,
"alt_soundspeed": "F",
"num_fluids": 1,
"mpp_lim": "F",
"mixture_err": "F",
"time_stepper": 3,
"igr": "T",
"igr_pres_lim": "T",
"igr_order": 3,
"igr_iter_solver": 1,
"num_igr_iters": 5,
"num_igr_warm_start_iters": 50,
"bc_x%beg": -3,
"bc_x%end": -3,
"bc_y%beg": -2,
"bc_y%end": -2,
"ib": "T",
"num_ibs": 3,
# Formatted Database Files Structure Parameters
"format": 1,
"precision": 2,
"prim_vars_wrt": "T",
"parallel_io": "T",
# Patch 1 Background
"patch_icpp(1)%geometry": 3,
"patch_icpp(1)%x_centroid": 7.5 * h,
"patch_icpp(1)%y_centroid": 2.5 * h,
"patch_icpp(1)%length_x": 15 * h,
"patch_icpp(1)%length_y": 5 * h,
"patch_icpp(1)%vel(1)": v0,
"patch_icpp(1)%vel(2)": 0.0,
"patch_icpp(1)%pres": p0,
"patch_icpp(1)%alpha_rho(1)": rho0,
"patch_icpp(1)%alpha(1)": 1.0,
# Patch: No slip rectangle with rouded corner
"patch_ib(1)%geometry": 3,
"patch_ib(1)%x_centroid": 11.5 * h + rc*h,
"patch_ib(1)%y_centroid": 0 * h,
"patch_ib(1)%length_x": 17 * h,
"patch_ib(1)%length_y": 2 * h,
Comment on lines +72 to +76
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Immersed boundary patch extends beyond domain boundary.

The first immersed boundary patch (patch_ib(1)) appears to extend beyond the computational domain:

  • Centroid x-position: 11.5 * h + rc * h = 2.34
  • Length in x: 17 * h = 3.4
  • Right edge: 2.34 + 3.4/2 = 4.04
  • Domain x-boundary: x_domain%end = 15 * h = 3.0

The patch extends approximately 1.04 units beyond the domain boundary. Please verify this geometry is correct for the forward-facing step configuration.

🤖 Prompt for AI Agents
In examples/2D_IGR_forward_facing_step/case.py around lines 72-76, patch_ib(1)
currently extends past the domain right boundary; fix by either moving the
centroid left or shrinking the patch so its right edge <= x_domain%end.
Concretely, set patch_ib(1)%x_centroid to x_domain%end - patch_ib(1)%length_x/2
(or reduce patch_ib(1)%length_x to 2*(x_domain%end - current_centroid)) so the
computed right edge does not exceed 15*h, and re-run geometry checks for the
forward-facing step configuration.

"patch_ib(1)%slip": "T",
Comment on lines +71 to +77
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix typo and resolve slip/no-slip contradiction.

The comment on Line 71 contains issues:

  1. Typo: "rouded" should be "rounded"
  2. Contradiction: The comment states "No slip" but slip is set to "T" (true), which typically indicates a slip boundary condition

Please clarify whether the immersed boundaries should use slip or no-slip conditions and update either the comment or the configuration accordingly.

🤖 Prompt for AI Agents
In examples/2D_IGR_forward_facing_step/case.py around lines 71 to 77, fix the
typo "rouded" -> "rounded" in the comment and resolve the slip/no-slip
contradiction: either update the comment to describe a "slip rectangle with
rounded corner" if the immersed boundary should be slip (leave
"patch_ib(1)%slip": "T"), or change the configuration to "patch_ib(1)%slip": "F"
if it should be no-slip; make the comment and the slip flag consistent and keep
wording clear (e.g., "No-slip rectangle with rounded corner" when slip is "F").

"patch_ib(2)%geometry": 3,
"patch_ib(2)%x_centroid": (3 + rc/2)*h,
"patch_ib(2)%y_centroid": -rc * h,
"patch_ib(2)%length_x": rc*h,
"patch_ib(2)%length_y": 2 * h,
"patch_ib(2)%slip": "T",
Comment on lines +78 to +83
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Immersed boundary patch extends below domain boundary.

The second immersed boundary patch (patch_ib(2)) extends below the computational domain:

  • Centroid y-position: -rc * h = -0.04
  • Length in y: 2 * h = 0.4
  • Bottom edge: -0.04 - 0.4/2 = -0.24
  • Domain y-boundary: y_domain%beg = 0

The patch extends 0.24 units below the domain. If this is intentional (e.g., to model the bottom wall of the step), please confirm. Otherwise, adjust the geometry.

🤖 Prompt for AI Agents
In examples/2D_IGR_forward_facing_step/case.py around lines 78-83, patch_ib(2)
currently has y_centroid = -rc*h and length_y = 2*h which places the bottom edge
below the domain (y_domain%beg = 0); if that was not intentional, adjust the
geometry so the patch does not extend below y=0 by ensuring y_centroid -
length_y/2 >= 0; concretely either set a positive y_centroid (for example
y_centroid = rc*h) or reduce length_y so length_y <= 2*y_centroid (or both) to
satisfy the inequality, or if the negative placement is intentional, add a
comment explaining it models the bottom wall.

"patch_ib(3)%geometry": 2,
"patch_ib(3)%x_centroid": (3 + rc)*h,
"patch_ib(3)%y_centroid": (1 - rc)*h,
"patch_ib(3)%radius" : rc*h,
"patch_ib(3)%slip": "T",
# Fluids Physical Parameters
"fluid_pp(1)%gamma": 1.0 / (gam_a - 1.0),
"fluid_pp(1)%pi_inf": 0.0,
"viscous": "T",
"fluid_pp(1)%Re(1)": 1 / mu,
},
indent=4,
)
)
Comment on lines +1 to +97
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Address the formatting error flagged by the pipeline.

The MFC formatting step failed during the CI pipeline. Please run the project's formatting tool locally to identify and fix the formatting issues in this file.

🧰 Tools
🪛 GitHub Actions: Pretty

[error] 1-1: mfc formatting step exited with code 1. Formatting process encountered an error after applying patches to case.py.

🤖 Prompt for AI Agents
In examples/2D_IGR_forward_facing_step/case.py around lines 1 to 97, the CI
pipeline flagged a formatting error; run the project's formatter (the MFC
formatting tool or the repo's configured formatter, e.g., precommit/mfc) locally
against this file, apply the automatic fixes (ensure proper indentation,
spacing, and final newline), re-run the formatter to confirm no changes remain,
and commit the reformatted file so the CI formatting check passes.

Loading
Loading