|
| 1 | +#!/usr/bin/env python3 |
| 2 | +import math |
| 3 | +import json |
| 4 | + |
| 5 | +# Domain parameters |
| 6 | +D = 2.5 # Jet diameter |
| 7 | +Nd = 711 # Cells per jet diameter |
| 8 | + |
| 9 | +x0 = 0 # x_beg coordinate |
| 10 | +x1 = 19 * D # x_end coordinate |
| 11 | +y0 = -22 * D / 2 # y_beg coordinate |
| 12 | +y1 = 22 * D / 2 # y_end coordinate |
| 13 | +z0 = -22 * D / 2 # y_beg coordinate |
| 14 | +z1 = 22 * D / 2 # y_end coordinate |
| 15 | +Nx = int(Nd * (x1 - x0) / D) - 1 |
| 16 | +Ny = int(Nd * (y1 - y0) / D) - 1 |
| 17 | +Nz = int(Nd * (z1 - z0) / D) - 1 |
| 18 | + |
| 19 | +time_end = 5 |
| 20 | +igrIters = 5 |
| 21 | + |
| 22 | +dx = D / Nd |
| 23 | +dt = dx / 36 |
| 24 | + |
| 25 | +Nt = int(time_end / dt) |
| 26 | + |
| 27 | +# Configuring case dictionary |
| 28 | +print( |
| 29 | + json.dumps( |
| 30 | + { |
| 31 | + # Logistics |
| 32 | + "run_time_info": "T", |
| 33 | + # Computational Domain Parameters |
| 34 | + "x_domain%beg": x0, |
| 35 | + "x_domain%end": x1, |
| 36 | + "y_domain%beg": y0, |
| 37 | + "y_domain%end": y1, |
| 38 | + "z_domain%beg": z0, |
| 39 | + "z_domain%end": z1, |
| 40 | + "m": int(Nx), |
| 41 | + "n": int(Ny), |
| 42 | + "p": int(Nz), |
| 43 | + "dt": dt, |
| 44 | + "t_step_start": 0, |
| 45 | + "t_step_stop": 10, # Nt, |
| 46 | + "t_step_save": 10, # int(Nt/50), |
| 47 | + # Simulation Algorithm Parameters |
| 48 | + "num_patches": 1, |
| 49 | + "num_bc_patches": 0, |
| 50 | + "model_eqns": 2, |
| 51 | + "alt_soundspeed": "F", |
| 52 | + "num_fluids": 1, |
| 53 | + "mpp_lim": "F", |
| 54 | + "time_stepper": 3, |
| 55 | + "igr": "T", |
| 56 | + "igr_order": 3, |
| 57 | + "igr_pres_lim": "T", |
| 58 | + "igr_iter_solver": 1, |
| 59 | + "num_igr_iters": igrIters, |
| 60 | + "num_igr_warm_start_iters": 10 * igrIters, |
| 61 | + "alf_factor": 10, |
| 62 | + "bc_x%beg": -17, |
| 63 | + "bc_x%end": -3, |
| 64 | + "bc_y%beg": -3, |
| 65 | + "bc_y%end": -3, |
| 66 | + "bc_z%beg": -3, |
| 67 | + "bc_z%end": -3, |
| 68 | + # Formatted Database Files Structure Parameters |
| 69 | + "format": 1, |
| 70 | + "precision": 1, |
| 71 | + "prim_vars_wrt": "T", |
| 72 | + "file_per_process": "T", |
| 73 | + "parallel_io": "T", |
| 74 | + "down_sample": "T", |
| 75 | + # Patch |
| 76 | + "patch_icpp(1)%geometry": 9, |
| 77 | + "patch_icpp(1)%x_centroid": (x1 + x0) / 2, |
| 78 | + "patch_icpp(1)%y_centroid": (y1 + y0) / 2, |
| 79 | + "patch_icpp(1)%z_centroid": (z1 + z0) / 2, |
| 80 | + "patch_icpp(1)%length_x": 2 * (x1 - x0), |
| 81 | + "patch_icpp(1)%length_y": 2 * (y1 - y0), |
| 82 | + "patch_icpp(1)%length_z": 2 * (z1 - z0), |
| 83 | + "patch_icpp(1)%hcid": 303, |
| 84 | + "patch_icpp(1)%vel(1)": 0.0e00, |
| 85 | + "patch_icpp(1)%vel(2)": 0.0e00, |
| 86 | + "patch_icpp(1)%vel(3)": 0.0e00, |
| 87 | + "patch_icpp(1)%pres": 1.0e00, |
| 88 | + "patch_icpp(1)%alpha_rho(1)": 1.0, |
| 89 | + "patch_icpp(1)%alpha(1)": 1.0, |
| 90 | + # Perturbation of velocity field |
| 91 | + "simplex_perturb": "T", |
| 92 | + "simplex_params%perturb_vel(1)": "T", |
| 93 | + "simplex_params%perturb_vel_freq(1)": 3, |
| 94 | + "simplex_params%perturb_vel_scale(1)": 0.02, |
| 95 | + "simplex_params%perturb_vel_offset(1,1)": 12.3, |
| 96 | + "simplex_params%perturb_vel_offset(1,2)": -11.3, |
| 97 | + "simplex_params%perturb_vel_offset(1,3)": 34.6, |
| 98 | + "simplex_params%perturb_vel(2)": "T", |
| 99 | + "simplex_params%perturb_vel_freq(2)": 2, |
| 100 | + "simplex_params%perturb_vel_scale(2)": 0.02, |
| 101 | + "simplex_params%perturb_vel_offset(2,1)": -70.3, |
| 102 | + "simplex_params%perturb_vel_offset(2,2)": 33.4, |
| 103 | + "simplex_params%perturb_vel_offset(2,3)": -34.6, |
| 104 | + "simplex_params%perturb_vel(3)": "T", |
| 105 | + "simplex_params%perturb_vel_freq(3)": 2, |
| 106 | + "simplex_params%perturb_vel_scale(3)": 0.02, |
| 107 | + "simplex_params%perturb_vel_offset(3,1)": 123.3, |
| 108 | + "simplex_params%perturb_vel_offset(3,2)": -654.3, |
| 109 | + "simplex_params%perturb_vel_offset(3,3)": -64.5, |
| 110 | + # Fluids Physical Parameters |
| 111 | + "fluid_pp(1)%gamma": 1.0e00 / (1.4e00 - 1.0e00), |
| 112 | + "fluid_pp(1)%pi_inf": 0.0, |
| 113 | + "viscous": "T", |
| 114 | + "fluid_pp(1)%Re(1)": 5e5, |
| 115 | + }, |
| 116 | + indent=4, |
| 117 | + ) |
| 118 | +) |
0 commit comments