|
| 1 | +import json |
| 2 | +import math |
| 3 | + |
| 4 | +Mu = 1.84E-05 |
| 5 | +gam_a = 1.4 |
| 6 | +gam_b = 1.1 |
| 7 | + |
| 8 | + |
| 9 | +x0 = 10E-06 |
| 10 | +p0 = 101325. |
| 11 | +rho0 = 1.E+03 |
| 12 | +c0 = math.sqrt( p0/rho0 ) |
| 13 | +patm = 1. |
| 14 | + |
| 15 | +#water props |
| 16 | +n_tait = 7.1 |
| 17 | +B_tait = 3.43E+05/ p0 |
| 18 | +mul0 = 1.002E-03 #viscosity |
| 19 | +ss = 0.07275 #surface tension |
| 20 | +pv = 2.3388E+03 #vapor pressure |
| 21 | + |
| 22 | +gamma_v = 1.33 |
| 23 | +M_v = 18.02 |
| 24 | +mu_v = 0.8816E-05 |
| 25 | +k_v = 0.019426 |
| 26 | + |
| 27 | +#air props |
| 28 | +gamma_n = 1.4 |
| 29 | +M_n = 28.97 |
| 30 | +mu_n = 1.8E-05 |
| 31 | +k_n = 0.02556 |
| 32 | + |
| 33 | +#air props |
| 34 | +# gamma_gas = gamma_n |
| 35 | +gamma_gas = 1.4 |
| 36 | + |
| 37 | +#reference bubble size |
| 38 | +R0ref = 10.E-06 |
| 39 | + |
| 40 | +pa = 0.1 * 1.E+06 / 101325. |
| 41 | + |
| 42 | +#Characteristic velocity |
| 43 | +uu = math.sqrt( p0/rho0 ) |
| 44 | +#Cavitation number |
| 45 | +Ca = (p0 - pv)/(rho0*(uu**2.)) |
| 46 | +#Weber number |
| 47 | +We = rho0*(uu**2.)*R0ref/ss |
| 48 | +#Inv. bubble Reynolds number |
| 49 | +Re_inv = mul0/(rho0*uu*R0ref) |
| 50 | + |
| 51 | +vft = 1E-12 |
| 52 | +vf0 = 1E-03 |
| 53 | + |
| 54 | +cact = math.sqrt(n_tait*(p0 + p0*B_tait) / ((1 - vf0) * rho0) ) |
| 55 | +cfl = 0.3 |
| 56 | +Nx = 400 |
| 57 | +Ny = 200 |
| 58 | +dx = 6.E-03 / (x0*float(Nx)) |
| 59 | +dt = cfl*dx*c0/cact |
| 60 | +dt = dt |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | +Min = 1.2 |
| 65 | +beta = (n_tait + 1) * Min**2 / (Min**2 * (n_tait - 1 + 2*vf0) + 2 * (1 - vf0)) |
| 66 | +vel = Min * cact * (beta - 1) / beta |
| 67 | +delta = (1 - vf0) + n_tait * Min**2 * (beta - 1) * (1 + B_tait) / beta |
| 68 | + |
| 69 | +# Configuring case dictionary |
| 70 | +print(json.dumps({ |
| 71 | + # Logistics ================================================================ |
| 72 | + 'run_time_info' : 'F', |
| 73 | + # ========================================================================== |
| 74 | + |
| 75 | + # Computational Domain Parameters ========================================== |
| 76 | + 'x_domain%beg' : 0.0E+00, |
| 77 | + 'x_domain%end' : 6.0E-03 / x0, |
| 78 | + 'y_domain%beg' : 0.0E+00, |
| 79 | + 'y_domain%end' : 3.0E-03 / x0, |
| 80 | + 'cyl_coord' : 'F', |
| 81 | + 'm' : Nx, |
| 82 | + 'n' : Ny, |
| 83 | + 'p' : 0, |
| 84 | + 'dt' : dt, |
| 85 | + 't_step_start' : 0, |
| 86 | + 't_step_stop' : 1000, #3000 |
| 87 | + 't_step_save' : 10, #10 |
| 88 | + # ========================================================================== |
| 89 | + |
| 90 | + # Simulation Algorithm Parameters ========================================== |
| 91 | + 'num_patches' : 2, |
| 92 | + # Use the 5 equation model |
| 93 | + 'model_eqns' : 2, |
| 94 | + 'alt_soundspeed' : 'F', |
| 95 | + 'num_fluids' : 1, |
| 96 | + # Advect both volume fractions |
| 97 | + 'adv_alphan' : 'T', |
| 98 | + # No need to ensure the volume fractions sum to unity at the end of each |
| 99 | + # time step |
| 100 | + 'mpp_lim' : 'F', |
| 101 | + # Correct errors when computing speed of sound |
| 102 | + 'mixture_err' : 'T', |
| 103 | + # Use TVD RK3 for time marching |
| 104 | + 'time_stepper' : 3, |
| 105 | + # Reconstruct the primitive variables to minimize spurious |
| 106 | + # Use WENO5 |
| 107 | + 'weno_order' : 5, |
| 108 | + 'weno_eps' : 1.E-16, |
| 109 | + 'weno_Re_flux' : 'F', |
| 110 | + 'weno_avg' : 'T', |
| 111 | + 'avg_state' : 2, |
| 112 | + # Use the mapped WENO weights to maintain monotinicity |
| 113 | + 'mapped_weno' : 'T', |
| 114 | + 'null_weights' : 'F', |
| 115 | + 'mp_weno' : 'F', |
| 116 | + # Use the HLLC Riemann solver |
| 117 | + 'riemann_solver' : 2, |
| 118 | + 'wave_speeds' : 1, |
| 119 | + 'bc_x%beg' : -6, |
| 120 | + 'bc_x%end' : -3, |
| 121 | + 'bc_y%beg' : -3, |
| 122 | + 'bc_y%end' : -3, |
| 123 | + # Set IB to True and add 1 patch |
| 124 | + 'ib' : 'T', |
| 125 | + 'num_ibs' : 1, |
| 126 | + # ========================================================================== |
| 127 | + |
| 128 | + # Formatted Database Files Structure Parameters ============================ |
| 129 | + # Export primitive variables in double precision with parallel |
| 130 | + # I/O to minimize I/O computational time during large simulations |
| 131 | + 'format' : 1, |
| 132 | + 'precision' : 2, |
| 133 | + 'prim_vars_wrt' :'T', |
| 134 | + 'ib_wrt' :'T', |
| 135 | + 'fd_order' : 1, |
| 136 | + 'omega_wrt(3)' :'T', |
| 137 | + 'parallel_io' :'T', |
| 138 | + # ========================================================================== |
| 139 | + |
| 140 | + #Ambient State ===================================== |
| 141 | + 'patch_icpp(1)%geometry' : 3, |
| 142 | + 'patch_icpp(1)%x_centroid' : 3.0E-03 / x0, |
| 143 | + 'patch_icpp(1)%y_centroid' : 1.50E-03 / x0, |
| 144 | + 'patch_icpp(1)%length_x' : 6.0E-03 / x0, |
| 145 | + 'patch_icpp(1)%length_y' : 3.0E-03 / x0, |
| 146 | + 'patch_icpp(1)%alpha_rho(1)' : (1.-vf0), |
| 147 | + 'patch_icpp(1)%alpha(1)' : vf0, |
| 148 | + 'patch_icpp(1)%vel(1)' : 1.5, |
| 149 | + 'patch_icpp(1)%vel(2)' : 0.0E+00, |
| 150 | + 'patch_icpp(1)%pres' : 1.E+00, |
| 151 | + 'patch_icpp(1)%r0' : 1., |
| 152 | + 'patch_icpp(1)%v0' : 0.0E+00, |
| 153 | + # # ======================================================================== |
| 154 | + |
| 155 | + #Shocked State ===================================== |
| 156 | + 'patch_icpp(2)%geometry' : 3, |
| 157 | + 'patch_icpp(2)%x_centroid' : 0.5E-03 / x0, |
| 158 | + 'patch_icpp(2)%y_centroid' : 1.50E-03 / x0, |
| 159 | + 'patch_icpp(2)%length_x' : 1.0E-03 / x0, |
| 160 | + 'patch_icpp(2)%length_y' : 3.0E-03 / x0, |
| 161 | + 'patch_icpp(2)%alpha_rho(1)' : beta, |
| 162 | + 'patch_icpp(2)%alpha(1)' : beta*vf0, |
| 163 | + 'patch_icpp(2)%vel(1)' : vel / c0, |
| 164 | + 'patch_icpp(2)%vel(2)' : 0.0E+00, |
| 165 | + 'patch_icpp(2)%pres' : delta, |
| 166 | + 'patch_icpp(2)%r0' : 1., |
| 167 | + 'patch_icpp(2)%v0' : 0.0E+00, |
| 168 | + 'patch_icpp(2)%alter_patch(1)' : 'T', |
| 169 | + # # ======================================================================== |
| 170 | + |
| 171 | + # Patch: Cylinder Immersed Boundary ======================================== |
| 172 | + 'patch_ib(1)%geometry' : 4, |
| 173 | + 'patch_ib(1)%x_centroid' : 1.5E-03 / x0, |
| 174 | + 'patch_ib(1)%y_centroid' : 1.5E-03 / x0, |
| 175 | + 'patch_ib(1)%c' : 1.0E-03 / x0, |
| 176 | + 'patch_ib(1)%t' : 0.15, |
| 177 | + 'patch_ib(1)%p' : 0.4, |
| 178 | + 'patch_ib(1)%m' : 0.02, |
| 179 | + 'patch_ib(1)%slip' : 'F', |
| 180 | + 'patch_ib(1)%theta' : 15, |
| 181 | + # # ========================================================================= |
| 182 | + 'pref' : p0, |
| 183 | + 'rhoref' : rho0, |
| 184 | + # Fluids Physical Parameters =============================== |
| 185 | + # Surrounding liquid |
| 186 | + 'fluid_pp(1)%gamma' : 1.E+00/(n_tait-1.E+00), |
| 187 | + 'fluid_pp(1)%pi_inf' : n_tait*B_tait/(n_tait-1.), |
| 188 | + 'fluid_pp(1)%mul0' : mul0, |
| 189 | + 'fluid_pp(1)%ss' : ss, |
| 190 | + 'fluid_pp(1)%pv' : pv, |
| 191 | + 'fluid_pp(1)%gamma_v' : gamma_v, |
| 192 | + 'fluid_pp(1)%M_v' : M_v, |
| 193 | + 'fluid_pp(1)%mu_v' : mu_v, |
| 194 | + 'fluid_pp(1)%k_v' : k_v, |
| 195 | + #'fluid_pp(1)%Re(1)' : 80000, |
| 196 | + |
| 197 | + # Last fluid_pp is always reserved for bubble gas state === |
| 198 | + # if applicable ========================================== |
| 199 | + 'fluid_pp(2)%gamma' : 1./(gamma_gas-1.), |
| 200 | + 'fluid_pp(2)%pi_inf' : 0.0E+00, |
| 201 | + 'fluid_pp(2)%gamma_v' : gamma_n, |
| 202 | + 'fluid_pp(2)%M_v' : M_n, |
| 203 | + 'fluid_pp(2)%mu_v' : mu_n, |
| 204 | + 'fluid_pp(2)%k_v' : k_n, |
| 205 | + # ========================================================== |
| 206 | + |
| 207 | + # Bubbles ================================================== |
| 208 | + 'bubbles' : 'T', |
| 209 | + 'bubble_model' : 2, |
| 210 | + 'polytropic' : 'T', |
| 211 | + 'polydisperse' : 'F', |
| 212 | + 'R0_type' : 1, |
| 213 | + 'poly_sigma' : 0.3, |
| 214 | + 'thermal' : 3, |
| 215 | + 'R0ref' : x0, |
| 216 | + 'nb' : 1, |
| 217 | + 'Ca' : Ca, |
| 218 | + 'Web' : We, |
| 219 | + 'Re_inv' : Re_inv, |
| 220 | + 'qbmm' : 'F', |
| 221 | + 'dist_type' : 1, |
| 222 | + 'sigR' : 0.1, |
| 223 | + 'sigV' : 0.3, |
| 224 | + 'rhoRV' : 0.0, |
| 225 | + # ========================================================== |
| 226 | + # ========================================================================== |
| 227 | +})) |
0 commit comments