Skip to content

Commit f5ef7e7

Browse files
authored
Copy the ib flag to the device (#1937)
1 parent 98c1f4e commit f5ef7e7

4 files changed

Lines changed: 206 additions & 3 deletions

File tree

‎src/simulation/m_global_parameters.fpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,7 @@ contains
991991
992992
$:GPU_UPDATE(device='[alt_soundspeed, acoustic_source, num_source]')
993993
$:GPU_UPDATE(device='[dt, sys_size, buff_size, eqn_idx, mpp_lim, bubbles_euler, hypoelasticity, alt_soundspeed, &
994-
& avg_state, model_eqns, mixture_err, grid_geometry, cyl_coord, mp_weno, weno_eps, teno_CT, low_Mach]')
994+
& avg_state, model_eqns, mixture_err, grid_geometry, cyl_coord, mp_weno, weno_eps, teno_CT, low_Mach, ib]')
995995
$:GPU_UPDATE(device='[riemann_hypo_ADC, ADC_kappa, hll_u_interface, hypo_hll_interface_rhs, hypo_nc_mode]')
996996
997997
$:GPU_UPDATE(device='[Bx0]')

‎tests/09FDDC81/golden-metadata.txt‎

Lines changed: 162 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tests/09FDDC81/golden.txt‎

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎toolchain/mfc/test/cases.py‎

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@ def alter_num_fluids(dimInfo):
844844
alter_low_Mach_correction()
845845
if num_fluids == 1:
846846
alter_eos()
847-
alter_ib(dimInfo)
847+
alter_ib(dimInfo, num_fluids=num_fluids)
848848
if len(dimInfo[0]) > 1:
849849
alter_igr()
850850

@@ -1194,7 +1194,7 @@ def alter_ppn(dimInfo):
11941194
if ARG("rdma_mpi"):
11951195
cases.append(define_case_d(stack, "2 MPI Ranks -> RDMA MPI", {"rdma_mpi": "T"}, ppn=2))
11961196

1197-
def alter_ib(dimInfo, six_eqn_model=False, viscous=False):
1197+
def alter_ib(dimInfo, six_eqn_model=False, viscous=False, num_fluids=1):
11981198
for slip in [True, False]:
11991199
stack.push(
12001200
"IBM",
@@ -1328,6 +1328,37 @@ def alter_ib(dimInfo, six_eqn_model=False, viscous=False):
13281328
)
13291329
)
13301330

1331+
if len(dimInfo[0]) == 2 and not viscous and num_fluids == 1:
1332+
# IB-interior cells must not set the adaptive dt. A body moving through gas at rest carries its velocity into
1333+
# its interior, so there |u| + c exceeds anywhere in the fluid and dt shrinks ~8% if those cells are counted.
1334+
# The edges sit on cell faces and the body moves 0.2 dx, so no cell crosses the surface.
1335+
cases.append(
1336+
define_case_d(
1337+
stack,
1338+
"IBM -> Adaptive dt",
1339+
{
1340+
"ib": "T",
1341+
"num_ibs": 1,
1342+
"fd_order": 2,
1343+
"n": 49,
1344+
"cfl_adap_dt": "T",
1345+
"cfl_target": 0.5,
1346+
"n_start": 0,
1347+
"t_save": 0.04,
1348+
"t_stop": 0.04,
1349+
**{f"patch_icpp({i})%{k}": v for i in range(1, 4) for k, v in [("pres", 1.0), ("alpha_rho(1)", 1.0), ("vel(1)", 0.0)]},
1350+
"patch_ib(1)%geometry": 3,
1351+
"patch_ib(1)%x_centroid": 0.5,
1352+
"patch_ib(1)%y_centroid": 0.5,
1353+
"patch_ib(1)%length_x": 0.2,
1354+
"patch_ib(1)%length_y": 0.2,
1355+
"patch_ib(1)%slip": "F",
1356+
"patch_ib(1)%moving_ibm": 2,
1357+
"patch_ib(1)%vel(1)": 0.1,
1358+
},
1359+
)
1360+
)
1361+
13311362
if len(dimInfo[0]) == 2 and not viscous:
13321363
cases.append(
13331364
define_case_d(

0 commit comments

Comments
 (0)