|
| 1 | +#!/usr/bin/env python3 |
| 2 | +import math |
| 3 | +import json |
| 4 | + |
| 5 | +Ma = 1.4 |
| 6 | +ps = 238558 |
| 7 | +rho_post_a = 2.18 |
| 8 | +rho_a = 1.204 |
| 9 | +rho_w = 1000 |
| 10 | +gam_a = 1.4 |
| 11 | +gam_w = 6.12 |
| 12 | +pi_w = 3.43e8 |
| 13 | +vel = 226 |
| 14 | +rho = 1 |
| 15 | +c_l = math.sqrt(1.4 * ps / rho) |
| 16 | +eps = 1e-9 |
| 17 | + |
| 18 | +D = 0.048 |
| 19 | +Ny = 99.0 |
| 20 | +Nx = 399.0 |
| 21 | +dx = 0.25 / Nx # 8.3e-6 |
| 22 | + |
| 23 | +time_end = 0.005 # 50us |
| 24 | +cfl = 0.25 |
| 25 | + |
| 26 | +dt = cfl * dx / c_l # 5.3E-9 |
| 27 | +Nt = int(time_end / dt) # 10000 |
| 28 | + |
| 29 | +print( |
| 30 | + json.dumps( |
| 31 | + { |
| 32 | + # Logistics |
| 33 | + "run_time_info": "F", |
| 34 | + # Computational Domain Parameters |
| 35 | + "x_domain%beg": -4 * D, |
| 36 | + "x_domain%end": 20 * D, |
| 37 | + "y_domain%beg": 0, |
| 38 | + "y_domain%end": 6 * D, |
| 39 | + "stretch_y": "T", |
| 40 | + "a_y": 3.67, |
| 41 | + "y_a": -5.7 * D, |
| 42 | + "y_b": 5.7 * D, |
| 43 | + "loops_y": 2, |
| 44 | + "m": int(Nx), |
| 45 | + "n": int(Ny), |
| 46 | + "p": 0, |
| 47 | + "dt": dt, |
| 48 | + "t_step_start": 0, |
| 49 | + "t_step_stop": Nt, |
| 50 | + "t_step_save": math.ceil(Nt/100), |
| 51 | + # Simulation Algorithm Parameters |
| 52 | + "num_patches": 3, |
| 53 | + "model_eqns": 2, |
| 54 | + "alt_soundspeed": "F", |
| 55 | + "num_fluids": 2, |
| 56 | + "mpp_lim": "T", |
| 57 | + "mixture_err": "T", |
| 58 | + "time_stepper": 3, |
| 59 | + "recon_type": 2, |
| 60 | + "muscl_order": 2, |
| 61 | + "muscl_lim": 4, |
| 62 | + "int_comp": "F", |
| 63 | + "null_weights": "F", |
| 64 | + "riemann_solver": 2, |
| 65 | + "wave_speeds": 1, |
| 66 | + "avg_state": 2, |
| 67 | + "bc_x%beg": -6, # 11, |
| 68 | + "bc_x%end": -6, # 12 |
| 69 | + "bc_y%beg": -2, |
| 70 | + "bc_y%end": -3, |
| 71 | + # Formatted Database Files Structure Parameters |
| 72 | + "format": 1, |
| 73 | + "precision": 2, |
| 74 | + "prim_vars_wrt": "T", |
| 75 | + "parallel_io": "T", |
| 76 | + # Patch 1: Background |
| 77 | + "patch_icpp(1)%geometry": 3, |
| 78 | + "patch_icpp(1)%x_centroid": 8 * D, |
| 79 | + "patch_icpp(1)%y_centroid": 6 * D, |
| 80 | + "patch_icpp(1)%length_x": 24 * D, |
| 81 | + "patch_icpp(1)%length_y": 14 * D, |
| 82 | + "patch_icpp(1)%vel(1)": 0.0, |
| 83 | + "patch_icpp(1)%vel(2)": 0.0e00, |
| 84 | + "patch_icpp(1)%pres": 101325.0, |
| 85 | + "patch_icpp(1)%alpha_rho(1)": eps * 1000, |
| 86 | + "patch_icpp(1)%alpha_rho(2)": (1 - eps) * 1.17, |
| 87 | + "patch_icpp(1)%alpha(1)": eps, |
| 88 | + "patch_icpp(1)%alpha(2)": 1 - eps, |
| 89 | + # Patch 2: Shocked state |
| 90 | + "patch_icpp(2)%geometry": 3, |
| 91 | + "patch_icpp(2)%alter_patch(1)": "T", |
| 92 | + "patch_icpp(2)%x_centroid": -2.5 * D, |
| 93 | + "patch_icpp(2)%y_centroid": 6 * D, |
| 94 | + "patch_icpp(2)%length_x": 3 * D, |
| 95 | + "patch_icpp(2)%length_y": 14 * D, |
| 96 | + "patch_icpp(2)%vel(1)": vel, |
| 97 | + "patch_icpp(2)%vel(2)": 0.0e00, |
| 98 | + "patch_icpp(2)%pres": ps, |
| 99 | + "patch_icpp(2)%alpha_rho(1)": eps * 1000, |
| 100 | + "patch_icpp(2)%alpha_rho(2)": (1 - eps) * rho_post_a, |
| 101 | + "patch_icpp(2)%alpha(1)": eps, |
| 102 | + "patch_icpp(2)%alpha(2)": 1 - eps, |
| 103 | + # Patch 3: Bubble |
| 104 | + "patch_icpp(3)%geometry": 2, |
| 105 | + "patch_icpp(3)%x_centroid": 0, |
| 106 | + "patch_icpp(3)%y_centroid": 0, |
| 107 | + "patch_icpp(3)%radius": D / 2, |
| 108 | + "patch_icpp(3)%alter_patch(1)": "T", |
| 109 | + "patch_icpp(3)%vel(1)": 0.0, |
| 110 | + "patch_icpp(3)%vel(2)": 0.0e00, |
| 111 | + "patch_icpp(3)%pres": 101325.0, |
| 112 | + "patch_icpp(3)%alpha_rho(1)": (1 - eps) * rho_w, |
| 113 | + "patch_icpp(3)%alpha_rho(2)": eps * 1.17, |
| 114 | + "patch_icpp(3)%alpha(1)": 1 - eps, # 0.95 |
| 115 | + "patch_icpp(3)%alpha(2)": eps, # 0.05, |
| 116 | + # Fluids Physical Parameters |
| 117 | + "fluid_pp(1)%gamma": 1.0e00 / (gam_w - 1.0e00), |
| 118 | + "fluid_pp(1)%pi_inf": pi_w * gam_w / (gam_w - 1.0e00), |
| 119 | + "fluid_pp(2)%gamma": 1.0e00 / (gam_a - 1.0e00), |
| 120 | + "fluid_pp(2)%pi_inf": 0.0e00, |
| 121 | + } |
| 122 | + ) |
| 123 | +) |
0 commit comments