|
| 1 | +#!/usr/bin/env python3 |
| 2 | +# Benchmark igr_T_viscous_T |
| 3 | +# Additional Benchmarked Features |
| 4 | +# - igr : T |
| 5 | +# - viscous : T |
| 6 | +# - igr_order : 5 |
| 7 | + |
| 8 | +import json, math, argparse |
| 9 | + |
| 10 | +parser = argparse.ArgumentParser(prog="Benchmarking Case 5", description="This MFC case was created for the purposes of benchmarking MFC.", formatter_class=argparse.ArgumentDefaultsHelpFormatter) |
| 11 | + |
| 12 | +parser.add_argument("--mfc", type=json.loads, default="{}", metavar="DICT", help="MFC's toolchain's internal state.") |
| 13 | +parser.add_argument("--gbpp", type=int, metavar="MEM", default=16, help="Adjusts the problem size per rank to fit into [MEM] GB of GPU memory per GPU.") |
| 14 | + |
| 15 | +ARGS = vars(parser.parse_args()) |
| 16 | +DICT = ARGS["mfc"] |
| 17 | + |
| 18 | +size = 1 if DICT["gpu"] else 0 |
| 19 | + |
| 20 | +ppg = 8000000 / 16.0 |
| 21 | +procs = DICT["nodes"] * DICT["tasks_per_node"] |
| 22 | +ncells = math.floor(ppg * procs * ARGS["gbpp"]) |
| 23 | +s = math.floor((ncells) ** (1 / 3)) |
| 24 | +Nx, Ny, Nz = s, s, s |
| 25 | + |
| 26 | +Re = 1600 |
| 27 | +L = 1 |
| 28 | +P0 = 101325 |
| 29 | +rho0 = 1 |
| 30 | +C0 = math.sqrt(1.4 * P0) |
| 31 | +V0 = 0.1 * C0 |
| 32 | +mu = V0 * L / Re |
| 33 | + |
| 34 | +cfl = 0.5 |
| 35 | +dx = 2 * math.pi * L / (Nx + 1) |
| 36 | + |
| 37 | +dt = cfl * dx / (C0) |
| 38 | + |
| 39 | +tC = L / V0 |
| 40 | +tEnd = 20 * tC |
| 41 | + |
| 42 | +Nt = int(tEnd / dt) |
| 43 | + |
| 44 | +# Configuring case dictionary |
| 45 | +print( |
| 46 | + json.dumps( |
| 47 | + { |
| 48 | + # Logistics |
| 49 | + "run_time_info": "T", |
| 50 | + # Computational Domain Parameters |
| 51 | + "x_domain%beg": -math.pi * L, |
| 52 | + "x_domain%end": math.pi * L, |
| 53 | + "y_domain%beg": -math.pi * L, |
| 54 | + "y_domain%end": math.pi * L, |
| 55 | + "z_domain%beg": -math.pi * L, |
| 56 | + "z_domain%end": math.pi * L, |
| 57 | + "m": Nx, |
| 58 | + "n": Ny, |
| 59 | + "p": Nz, |
| 60 | + "cyl_coord": "F", |
| 61 | + "dt": dt, |
| 62 | + "t_step_start": 0, |
| 63 | + "t_step_stop": int(20 * (5 * size + 5)), |
| 64 | + "t_step_save": int(20 * (5 * size + 5)), |
| 65 | + # Simulation Algorithm Parameters |
| 66 | + "num_patches": 1, |
| 67 | + "model_eqns": 2, |
| 68 | + "num_fluids": 1, |
| 69 | + "time_stepper": 3, |
| 70 | + "bc_x%beg": -1, |
| 71 | + "bc_x%end": -1, |
| 72 | + "bc_y%beg": -1, |
| 73 | + "bc_y%end": -1, |
| 74 | + "bc_z%beg": -1, |
| 75 | + "bc_z%end": -1, |
| 76 | + "igr": "T", |
| 77 | + "igr_order": 5, |
| 78 | + "igr_iter_solver": 1, |
| 79 | + "num_igr_iters": 3, |
| 80 | + "num_igr_warm_start_iters": 3, |
| 81 | + "alf_factor": 10, |
| 82 | + "viscous": "T", |
| 83 | + # Formatted Database Files Structure Parameters |
| 84 | + "format": 1, |
| 85 | + "precision": 2, |
| 86 | + "prim_vars_wrt": "T", |
| 87 | + "omega_wrt(1)": "T", |
| 88 | + "omega_wrt(2)": "T", |
| 89 | + "omega_wrt(3)": "T", |
| 90 | + "qm_wrt": "T", |
| 91 | + "fd_order": 4, |
| 92 | + "parallel_io": "T", |
| 93 | + # Patch 1: Background (AIR - 2) |
| 94 | + "patch_icpp(1)%geometry": 9, |
| 95 | + "patch_icpp(1)%x_centroid": 0, |
| 96 | + "patch_icpp(1)%y_centroid": 0, |
| 97 | + "patch_icpp(1)%z_centroid": 0, |
| 98 | + "patch_icpp(1)%length_x": 2 * math.pi * L, |
| 99 | + "patch_icpp(1)%length_y": 2 * math.pi * L, |
| 100 | + "patch_icpp(1)%length_z": 2 * math.pi * L, |
| 101 | + "patch_icpp(1)%vel(1)": f"{V0}*sin(x/{L})*cos(y/{L})*sin(z/{L})", |
| 102 | + "patch_icpp(1)%vel(2)": f"-{V0}*cos(x/{L})*sin(y/{L})*sin(z/{L})", |
| 103 | + "patch_icpp(1)%vel(3)": 0, |
| 104 | + "patch_icpp(1)%pres": f"{P0} + ({rho0}*{V0}**2/16)*(cos(2*x/{L}) + cos(2*y/{L}))*(cos(2*z/{L}) + 2)", |
| 105 | + "patch_icpp(1)%alpha_rho(1)": 1, |
| 106 | + "patch_icpp(1)%alpha(1)": 1, |
| 107 | + # Fluids Physical Parameters |
| 108 | + "fluid_pp(1)%gamma": 1.0e00 / (1.4 - 1), |
| 109 | + "fluid_pp(1)%pi_inf": 0, |
| 110 | + "fluid_pp(1)%Re(1)": 1 / mu, |
| 111 | + } |
| 112 | + ) |
| 113 | +) |
0 commit comments