-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Operator splitting, adaptive time stepping, and other fixes for mixin…
…g layer and bubbles (#285) Co-authored-by: Hyeoksu Lee <[email protected]> Co-authored-by: Hyeoksu Lee <[email protected]> Co-authored-by: Hyeoksu Lee <[email protected]> Co-authored-by: Hyeoksu Lee <[email protected]> Co-authored-by: Hyeoksu Lee <[email protected]> Co-authored-by: Hyeoksu Lee <[email protected]> Co-authored-by: Hyeoksu Lee <[email protected]> Co-authored-by: Anand Radhakrishnan <[email protected]> Co-authored-by: Anand Radhakrishnan <[email protected]> Co-authored-by: Anand Radhakrishnan <[email protected]> Co-authored-by: Anand <[email protected]>
- Loading branch information
1 parent
b3761e3
commit 437e2d1
Showing
52 changed files
with
3,383 additions
and
227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
#!/usr/bin/env python2 | ||
|
||
import math | ||
import json | ||
|
||
# FLUID PROPERTIES ============================================================ | ||
# Water | ||
n_tait = 7.1 | ||
B_tait = 306.E+06 | ||
rho0 = 1.E+03 | ||
mul0 = 1.002E-03 | ||
ss = 0.07275 | ||
pv = 2.3388E+03 | ||
|
||
# Vapor | ||
gamma_v = 1.33 | ||
M_v = 18.02 | ||
mu_v = 0.8816E-05 | ||
k_v = 0.019426 | ||
|
||
# Air | ||
gamma_n = 1.4 | ||
M_n = 28.97 | ||
mu_n = 1.8E-05 | ||
k_n = 0.02556 | ||
|
||
# REFERENCE VALUES ============================================================ | ||
R0ref = 50.E-06 | ||
x0 = R0ref | ||
p0 = 8236. # for Ca = 1 in mixing layer scale | ||
u0 = math.sqrt( p0/rho0 ) | ||
patm = 1. | ||
cact = math.sqrt(n_tait*(p0+B_tait)/rho0) | ||
|
||
# NONDIMENSIONAL NUMBERS ====================================================== | ||
Ca = (p0 - pv)/(rho0*(u0**2.)) # Cavitation number | ||
We = rho0*(u0**2.)*R0ref/ss # Weber number | ||
Re_inv = mul0/(rho0*u0*R0ref) # Inv. bubble Reynolds number | ||
|
||
# BUBBLES ===================================================================== | ||
vf0 = 1e-5 | ||
nb = 1 | ||
|
||
# DOMAIN ====================================================================== | ||
Nx = 30 | ||
Ldomain = 20.E-03 | ||
L = Ldomain/x0 | ||
dx = L/float(Nx+1) | ||
|
||
# TIME STEPS ================================================================== | ||
Tfinal = 0.05 | ||
Nt = int(5e2+1) | ||
t_save = 1 | ||
dt = Tfinal/(Nt-1) | ||
|
||
# Configuring case dictionary | ||
print(json.dumps({ | ||
# Logistics ================================================ | ||
'run_time_info' : 'T', | ||
# ========================================================== | ||
|
||
# Computational Domain Parameters ========================== | ||
'x_domain%beg' : -0.5*L, | ||
'x_domain%end' : 0.5*L, | ||
'stretch_x' : 'F', | ||
'cyl_coord' : 'F', | ||
'm' : Nx, | ||
'n' : 0, | ||
'p' : 0, | ||
'dt' : dt, | ||
't_step_start' : 0, | ||
't_step_stop' : Nt, | ||
't_step_save' : t_save, | ||
# ========================================================== | ||
|
||
# Simulation Algorithm Parameters ========================== | ||
'num_patches' : 1, | ||
'model_eqns' : 2, | ||
'alt_soundspeed' : 'F', | ||
'num_fluids' : 1, | ||
'adv_alphan' : 'T', | ||
'mpp_lim' : 'F', | ||
'mixture_err' : 'F', | ||
'time_stepper' : 3, | ||
'weno_order' : 5, | ||
'weno_eps' : 1.E-16, | ||
'mapped_weno' : 'T', | ||
'null_weights' : 'F', | ||
'mp_weno' : 'T', | ||
'riemann_solver' : 2, | ||
'wave_speeds' : 1, | ||
'avg_state' : 2, | ||
'bc_x%beg' : -1, | ||
'bc_x%end' : -1, | ||
# ========================================================== | ||
|
||
# Formatted Database Files Structure Parameters ============ | ||
'format' : 1, | ||
'precision' : 2, | ||
'prim_vars_wrt' :'T', | ||
'parallel_io' :'T', | ||
'fd_order' : 1, | ||
# ========================================================== | ||
|
||
# Patch 1 _ Background ===================================== | ||
'patch_icpp(1)%geometry' : 1, | ||
'patch_icpp(1)%x_centroid' : 0., | ||
'patch_icpp(1)%length_x' : L, | ||
'patch_icpp(1)%vel(1)' : 0., | ||
'patch_icpp(1)%pres' : 1000., | ||
'patch_icpp(1)%alpha_rho(1)' : (1.-vf0), | ||
'patch_icpp(1)%alpha(1)' : vf0, | ||
'patch_icpp(1)%r0' : 1., | ||
'patch_icpp(1)%v0' : 0., | ||
# ========================================================== | ||
|
||
# Non-polytropic gas compression model AND/OR Tait EOS ===== | ||
'pref' : p0, | ||
'rhoref' : rho0, | ||
# ========================================================== | ||
|
||
# Bubbles ================================================== | ||
'bubbles' : 'T', | ||
'bubble_model' : 2, | ||
|
||
# Nondimensional numbers | ||
'Ca' : Ca, | ||
'Web' : We, | ||
'Re_inv' : Re_inv, | ||
|
||
# adv_n | ||
'adv_n' : 'T', | ||
|
||
# adap_dt | ||
'adap_dt' : 'T', | ||
|
||
# Gas compression model | ||
'polytropic' : 'T', | ||
'thermal' : 1, | ||
|
||
# Polydispersity | ||
'polydisperse' : 'F', | ||
'nb' : nb, | ||
|
||
# QBMM | ||
'qbmm' : 'F', | ||
# ========================================================== | ||
|
||
# Fluids Physical Parameters =============================== | ||
# Surrounding liquid | ||
'fluid_pp(1)%gamma' : 1.E+00/(n_tait-1.E+00), | ||
'fluid_pp(1)%pi_inf' : n_tait*(B_tait/p0)/(n_tait-1.), | ||
'fluid_pp(1)%ss' : ss, | ||
'fluid_pp(1)%pv' : pv, | ||
|
||
# Last fluid_pp is always reserved for bubble gas state === | ||
# if applicable ========================================== | ||
'fluid_pp(2)%gamma' : 1./(gamma_n-1.), | ||
'fluid_pp(2)%pi_inf' : 0.0E+00, | ||
# ========================================================== | ||
|
||
})) | ||
|
||
# ============================================================================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import math | ||
import json | ||
|
||
# FLUID PROPERTIES (WATER, VAPOR & AIR) ======================================== | ||
# Water | ||
rho_w = 1.E+03 # [kg/m3] density of water | ||
gamma_w = 7.1 # [1] specific heat ratio | ||
pi_inf_w = 3.06E+08 # [N/m2] water stiffness | ||
# ============================================================================== | ||
|
||
# REFERENCE VALUES ============================================================= | ||
x_ref = 0.002475 # [m] initial vorticity thickness | ||
u_ref = 3.4343 # [m/s] upper stream velocity | ||
# ============================================================================== | ||
|
||
# NON-DIMENSIONAL NUMBERS ====================================================== | ||
Re = 50. # [1] Reynolds number based on the upper stream | ||
# velocity and the initial vorticity thickness | ||
# ============================================================================== | ||
|
||
# SPEED OF SOUND =============================================================== | ||
pres = 8236. # [N/m2] pressure of water | ||
c_w = math.sqrt(gamma_w*(pres+pi_inf_w)/rho_w) | ||
# ============================================================================== | ||
|
||
# MODIFIED PROPERTIES FOR ARTIFICIAL MACH NUMBER ============================== | ||
Ma_t = 0.1 # [1] target Mach number | ||
pi_fac = (rho_w*u_ref**2/(gamma_w*Ma_t**2)-pres)/pi_inf_w | ||
pi_inf_w = pi_inf_w*pi_fac | ||
c_w = math.sqrt(gamma_w*(pres+pi_inf_w)/rho_w) | ||
# ============================================================================= | ||
|
||
# SIMULATION SETUP ============================================================ | ||
# Domain size | ||
Lx = 59.0 | ||
Ly = 59.0 | ||
|
||
# Number of grid cells | ||
Nx = 191 | ||
Ny = 191 | ||
|
||
# Grid spacing | ||
dx = Lx/float(Nx+1) | ||
dy = Ly/float(Ny+1) | ||
|
||
# Time advancement | ||
cfl = 5e-1 | ||
T = 20. | ||
dt = cfl*dx/(1.+c_w/u_ref) | ||
Ntfinal = int(T/dt) | ||
Ntstart = 0 | ||
Nfiles = 20 | ||
t_save = int(math.ceil((Ntfinal-0)/float(Nfiles))) | ||
Nt = t_save*Nfiles | ||
t_step_start = Ntstart | ||
t_step_stop = int(Nt) | ||
|
||
# ============================================================================== | ||
|
||
|
||
# Configuring case dictionary | ||
print(json.dumps({ | ||
# Logistics ================================================================ | ||
'run_time_info' : 'T', | ||
# ========================================================================== | ||
|
||
# Computational Domain Parameters ========================================== | ||
'x_domain%beg' : 0., | ||
'x_domain%end' : Lx, | ||
'y_domain%beg' : -Ly/2., | ||
'y_domain%end' : Ly/2., | ||
'm' : Nx, | ||
'n' : Ny, | ||
'p' : 0, | ||
'dt' : dt, | ||
't_step_start' : t_step_start, | ||
't_step_stop' : t_step_stop, | ||
't_step_save' : t_save, | ||
# ========================================================================== | ||
|
||
# Simulation Algorithm Parameters ========================================== | ||
'num_patches' : 1, | ||
'model_eqns' : 2, | ||
'num_fluids' : 1, | ||
'time_stepper' : 3, | ||
'weno_order' : 5, | ||
'weno_eps' : 1.E-16, | ||
'weno_Re_flux' : 'T', | ||
'mapped_weno' : 'T', | ||
'riemann_solver' : 2, | ||
'wave_speeds' : 1, | ||
'avg_state' : 2, | ||
'bc_x%beg' : -1, | ||
'bc_x%end' : -1, | ||
'bc_y%beg' : -5, | ||
'bc_y%end' : -5, | ||
# ========================================================================== | ||
|
||
# Formatted Database Files Structure Parameters ============================ | ||
'format' : 1, | ||
'precision' : 2, | ||
'cons_vars_wrt' :'T', | ||
'prim_vars_wrt' :'T', | ||
'parallel_io' :'T', | ||
'fd_order' : 1, | ||
'omega_wrt(3)' :'T', | ||
# ========================================================================== | ||
|
||
# Patch 1 ================================================================== | ||
'patch_icpp(1)%geometry' : 3, | ||
'patch_icpp(1)%x_centroid' : Lx/2., | ||
'patch_icpp(1)%y_centroid' : 0., | ||
'patch_icpp(1)%length_x' : Lx, | ||
'patch_icpp(1)%length_y' : Ly, | ||
'patch_icpp(1)%alpha_rho(1)' : 1., | ||
'patch_icpp(1)%alpha(1)' : 1., | ||
'patch_icpp(1)%vel(1)' : 1., | ||
'patch_icpp(1)%vel(2)' : 0., | ||
'patch_icpp(1)%pres' : pres/(rho_w*u_ref**2), | ||
# ========================================================================== | ||
|
||
# Mixing layer === ========================================================= | ||
'vel_profile' : 'T', | ||
'instability_wave' : 'T', | ||
# ========================================================================== | ||
|
||
# Artificial Mach number =================================================== | ||
'pi_fac' : pi_fac, | ||
# ========================================================================== | ||
|
||
# Fluids Physical Parameters =============================================== | ||
'fluid_pp(1)%gamma' : 1.E+00/(gamma_w-1.E+00), | ||
'fluid_pp(1)%pi_inf' : gamma_w*(pi_inf_w/(rho_w*u_ref**2))/(gamma_w-1.E+00), | ||
'fluid_pp(1)%Re(1)' : Re, | ||
# ========================================================================= | ||
})) | ||
|
||
# ============================================================================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.