|
| 1 | +#!/usr/bin/env python3 |
| 2 | + |
| 3 | +import math |
| 4 | +import json |
| 5 | + |
| 6 | +N = 256 |
| 7 | + |
| 8 | +Re = 1600 |
| 9 | +L = 1 |
| 10 | +P0 = 101325 |
| 11 | +rho0 = 1 |
| 12 | +C0 = math.sqrt(1.4*P0) |
| 13 | +V0 = 0.1*C0 |
| 14 | +mu = V0*L/Re |
| 15 | + |
| 16 | +cfl = 0.5 |
| 17 | +dx = 2*math.pi*L/(N+1) |
| 18 | + |
| 19 | +dt = cfl * dx / (C0) |
| 20 | + |
| 21 | +tC = L/V0 |
| 22 | +tEnd = 20*tC |
| 23 | + |
| 24 | +Nt = int(tEnd/dt) |
| 25 | + |
| 26 | + |
| 27 | +# Configuring case dictionary |
| 28 | +print(json.dumps({ |
| 29 | + # Logistics ================================================ |
| 30 | + 'run_time_info' : 'T', |
| 31 | + # ========================================================== |
| 32 | + |
| 33 | + # Computational Domain Parameters ========================== |
| 34 | + 'x_domain%beg' : -math.pi*L, |
| 35 | + 'x_domain%end' : math.pi*L, |
| 36 | + 'y_domain%beg' : -math.pi*L, |
| 37 | + 'y_domain%end' : math.pi*L, |
| 38 | + 'z_domain%beg' : -math.pi*L, |
| 39 | + 'z_domain%end' : math.pi*L, |
| 40 | + 'm' : N, |
| 41 | + 'n' : N, |
| 42 | + 'p' : N, |
| 43 | + 'cyl_coord' : 'F', |
| 44 | + 'dt' : dt, |
| 45 | + 't_step_start' : 13529, |
| 46 | + 't_step_stop' : Nt, |
| 47 | + 't_step_save' : int(Nt/100), |
| 48 | + # ========================================================== |
| 49 | + |
| 50 | + # Simulation Algorithm Parameters ========================== |
| 51 | + 'num_patches' : 1, |
| 52 | + 'model_eqns' : 2, |
| 53 | + 'alt_soundspeed' : 'F', |
| 54 | + 'num_fluids' : 1, |
| 55 | + 'mixture_err' : 'T', |
| 56 | + 'time_stepper' : 3, |
| 57 | + 'weno_order' : 5, |
| 58 | + 'weno_eps' : 1.0E-16, |
| 59 | + 'weno_Re_flux' : 'F', |
| 60 | + 'weno_avg' : 'F', |
| 61 | + 'mapped_weno' : 'T', |
| 62 | + 'riemann_solver' : 2, |
| 63 | + 'wave_speeds' : 1, |
| 64 | + 'avg_state' : 2, |
| 65 | + 'bc_x%beg' : -1, |
| 66 | + 'bc_x%end' : -1, |
| 67 | + 'bc_y%beg' : -1, |
| 68 | + 'bc_y%end' : -1, |
| 69 | + 'bc_z%beg' : -1, |
| 70 | + 'bc_z%end' : -1, |
| 71 | + # ========================================================== |
| 72 | + |
| 73 | + # Formatted Database Files Structure Parameters ============ |
| 74 | + 'format' : 1, |
| 75 | + 'precision' : 2, |
| 76 | + # 'prim_vars_wrt' :'T', |
| 77 | + 'omega_wrt(1)' :'T', |
| 78 | + 'omega_wrt(2)' :'T', |
| 79 | + 'omega_wrt(3)' :'T', |
| 80 | + 'qm_wrt' :'T', |
| 81 | + 'fd_order' : 4, |
| 82 | + 'parallel_io' :'T', |
| 83 | + # ========================================================== |
| 84 | + |
| 85 | + # I will use 1 for WATER properties, and 2 for AIR properties |
| 86 | + # Patch 1: Background (AIR - 2) ============================= |
| 87 | + 'patch_icpp(1)%geometry' : 9, |
| 88 | + 'patch_icpp(1)%x_centroid' : 0, |
| 89 | + 'patch_icpp(1)%y_centroid' : 0, |
| 90 | + 'patch_icpp(1)%z_centroid' : 0, |
| 91 | + 'patch_icpp(1)%length_x' : 2*math.pi*L, |
| 92 | + 'patch_icpp(1)%length_y' : 2*math.pi*L, |
| 93 | + 'patch_icpp(1)%length_z' : 2*math.pi*L, |
| 94 | + 'patch_icpp(1)%vel(1)' : f"{V0}*sin(x/{L})*cos(y/{L})*sin(z/{L})", |
| 95 | + 'patch_icpp(1)%vel(2)' : f"-{V0}*cos(x/{L})*sin(y/{L})*sin(z/{L})", |
| 96 | + 'patch_icpp(1)%vel(3)' : 0, |
| 97 | + 'patch_icpp(1)%pres' : f"{P0} + ({rho0}*{V0}**2/16)*(cos(2*x/{L}) + cos(2*y/{L}))*(cos(2*z/{L}) + 2)", |
| 98 | + 'patch_icpp(1)%alpha_rho(1)' : 1, |
| 99 | + 'patch_icpp(1)%alpha(1)' : 1, |
| 100 | + # ========================================================== |
| 101 | + |
| 102 | + # Fluids Physical Parameters =============================== |
| 103 | + 'fluid_pp(1)%gamma' : 1.0E+00/(1.4-1), |
| 104 | + 'fluid_pp(1)%pi_inf' : 0, |
| 105 | + 'fluid_pp(1)%Re(1)' : 1/mu, |
| 106 | + # ========================================================== |
| 107 | +})) |
| 108 | + |
| 109 | +# ============================================================================== |
0 commit comments