|
| 1 | +import json |
| 2 | +import math |
| 3 | + |
| 4 | +h = 1 |
| 5 | +Re = 5100 |
| 6 | + |
| 7 | +gam_a = 1.4 |
| 8 | +p0 = 1 |
| 9 | +rho0 = 1 |
| 10 | +c0 = math.sqrt(gam_a * p0 / rho0) |
| 11 | +v0 = 0.5 * c0 |
| 12 | +mu = v0 * h / Re |
| 13 | + |
| 14 | +# Configuring case dictionary |
| 15 | +print( |
| 16 | + json.dumps( |
| 17 | + { |
| 18 | + # Logistics |
| 19 | + "run_time_info": "T", |
| 20 | + "x_domain%beg": 0, |
| 21 | + "x_domain%end": 30 * h, |
| 22 | + "y_domain%beg": 0, |
| 23 | + "y_domain%end": 6 * h, |
| 24 | + "cyl_coord": "F", |
| 25 | + "m": 499, |
| 26 | + "n": 99, |
| 27 | + "p": 0, |
| 28 | + "cfl_adap_dt": "T", |
| 29 | + "cfl_target": 0.8, |
| 30 | + "n_start": 0, |
| 31 | + "t_save": 150 / (100 * v0), |
| 32 | + "t_stop": 150 / v0, |
| 33 | + # Simulation Algorithm Parameters |
| 34 | + "num_patches": 2, |
| 35 | + "model_eqns": 2, |
| 36 | + "alt_soundspeed": "F", |
| 37 | + "num_fluids": 1, |
| 38 | + "mpp_lim": "F", |
| 39 | + "mixture_err": "F", |
| 40 | + "time_stepper": 3, |
| 41 | + "weno_order": 5, |
| 42 | + "weno_eps": 1.0e-16, |
| 43 | + "weno_avg": "T", |
| 44 | + "avg_state": 2, |
| 45 | + "mapped_weno": "T", |
| 46 | + "null_weights": "F", |
| 47 | + "mp_weno": "T", |
| 48 | + "riemann_solver": 2, |
| 49 | + "wave_speeds": 1, |
| 50 | + "bc_x%beg": -7, |
| 51 | + "bc_x%end": -8, |
| 52 | + "bc_y%beg": -16, |
| 53 | + "bc_y%end": -6, |
| 54 | + "ib": "T", |
| 55 | + "num_ibs": 1, |
| 56 | + "viscous": "T", |
| 57 | + # Formatted Database Files Structure Parameters |
| 58 | + "format": 1, |
| 59 | + "precision": 2, |
| 60 | + "prim_vars_wrt": "T", |
| 61 | + "parallel_io": "T", |
| 62 | + # Patch 1 Background |
| 63 | + "patch_icpp(1)%geometry": 3, |
| 64 | + "patch_icpp(1)%x_centroid": 15 * h, |
| 65 | + "patch_icpp(1)%y_centroid": 3 * h, |
| 66 | + "patch_icpp(1)%length_x": 30 * h, |
| 67 | + "patch_icpp(1)%length_y": 6 * h, |
| 68 | + "patch_icpp(1)%vel(1)": 0.0, |
| 69 | + "patch_icpp(1)%vel(2)": 0.0, |
| 70 | + "patch_icpp(1)%pres": p0, |
| 71 | + "patch_icpp(1)%alpha_rho(1)": rho0, |
| 72 | + "patch_icpp(1)%alpha(1)": 1.0, |
| 73 | + # Patch 2 Velocity |
| 74 | + "patch_icpp(2)%geometry": 3, |
| 75 | + "patch_icpp(2)%alter_patch(1)": "T", |
| 76 | + "patch_icpp(2)%x_centroid": 4.5 * h, |
| 77 | + "patch_icpp(2)%y_centroid": 3 * h, |
| 78 | + "patch_icpp(2)%length_x": 9 * h, |
| 79 | + "patch_icpp(2)%length_y": 6 * h, |
| 80 | + "patch_icpp(2)%vel(1)": v0, |
| 81 | + "patch_icpp(2)%vel(2)": 0.0, |
| 82 | + "patch_icpp(2)%pres": p0, |
| 83 | + "patch_icpp(2)%alpha_rho(1)": rho0, |
| 84 | + "patch_icpp(2)%alpha(1)": 1.0, |
| 85 | + # Patch: Rectangle |
| 86 | + "patch_ib(1)%geometry": 3, |
| 87 | + "patch_ib(1)%x_centroid": 4 * h, |
| 88 | + "patch_ib(1)%y_centroid": 0 * h, |
| 89 | + "patch_ib(1)%length_x": 12 * h, |
| 90 | + "patch_ib(1)%length_y": 2 * h, |
| 91 | + "patch_ib(1)%slip": "F", |
| 92 | + # Fluids Physical Parameters |
| 93 | + "fluid_pp(1)%gamma": 1.0 / (gam_a - 1.0), |
| 94 | + "fluid_pp(1)%pi_inf": 0.0, |
| 95 | + "fluid_pp(1)%Re(1)": 1 / mu, |
| 96 | + } |
| 97 | + ) |
| 98 | +) |
0 commit comments