| 
 | 1 | +#!/usr/bin/env python3  | 
 | 2 | + | 
 | 3 | +# This simulation shows the early stages of a cubic droplet recovering a spherical shape due to capillary  | 
 | 4 | +# forces. While the relaxation is not complete, it demonstrates the expecteed symmetric behavior.  | 
 | 5 | + | 
 | 6 | +import math  | 
 | 7 | +import json  | 
 | 8 | + | 
 | 9 | +l = 0.375  | 
 | 10 | + | 
 | 11 | +# Numerical setup  | 
 | 12 | +r0 = 0.15  | 
 | 13 | +x0 = 0  | 
 | 14 | +x1 = l  | 
 | 15 | +y0 = 0  | 
 | 16 | +y1 = l  | 
 | 17 | +z0 = 0  | 
 | 18 | +z1 = l  | 
 | 19 | + | 
 | 20 | + | 
 | 21 | +Nx = 199  | 
 | 22 | +Ny = 199  | 
 | 23 | +Nz = 199  | 
 | 24 | + | 
 | 25 | +eps = 1e-9  | 
 | 26 | + | 
 | 27 | +mydt = 1e-6  | 
 | 28 | + | 
 | 29 | +#Configuration case dictionary  | 
 | 30 | +data = {  | 
 | 31 | +    # Logistics =============================  | 
 | 32 | +        #'case_dir'          : '\'.\'',  | 
 | 33 | +        'run_time_info'     : 'T',  | 
 | 34 | +    # =======================================  | 
 | 35 | + | 
 | 36 | +    # Computational Domain ==================  | 
 | 37 | +        'x_domain%beg'      : x0,  | 
 | 38 | +        'x_domain%end'      : x1,  | 
 | 39 | +        'y_domain%beg'      : y0,  | 
 | 40 | +        'y_domain%end'      : y1,  | 
 | 41 | +        'z_domain%beg'      : z0,  | 
 | 42 | +        'z_domain%end'      : z1,  | 
 | 43 | +        'm'                 : Nx,  | 
 | 44 | +        'n'                 : Ny,  | 
 | 45 | +        'p'                 : Nz,  | 
 | 46 | +        'cyl_coord'        : 'F',  | 
 | 47 | +        'dt'                : mydt,  | 
 | 48 | +        't_step_start'      : 400000,  | 
 | 49 | +        't_step_stop'       : 1000000,  | 
 | 50 | +        't_step_save'       : 2000,  | 
 | 51 | +        #'t_step_stop'       : 100,  | 
 | 52 | +        #'t_step_save'       : 100,  | 
 | 53 | +    # =======================================  | 
 | 54 | + | 
 | 55 | +    # Simulation Algorithm ==================  | 
 | 56 | +        'model_eqns'        : 3,  | 
 | 57 | +        'alt_soundspeed'    : 'F',  | 
 | 58 | +        'adv_alphan'        : 'T',  | 
 | 59 | +        'mixture_err'       : 'T',  | 
 | 60 | +        'mpp_lim'           : 'F',  | 
 | 61 | +        'time_stepper'      : 3,  | 
 | 62 | +        'weno_order'        : 3,  | 
 | 63 | +        'avg_state'         : 2,  | 
 | 64 | +        'weno_eps'          : 1e-16,  | 
 | 65 | +        'mapped_weno'       : 'T',  | 
 | 66 | +        'null_weights'      : 'F',  | 
 | 67 | +        'mp_weno'           : 'F',  | 
 | 68 | +        'weno_Re_flux'      : 'F',  | 
 | 69 | +        'riemann_solver'    : 2,  | 
 | 70 | +        'wave_speeds'       : 1,  | 
 | 71 | +        'bc_x%beg'          : -2,  | 
 | 72 | +        'bc_x%end'          : -3,  | 
 | 73 | +        'bc_y%beg'          : -2,  | 
 | 74 | +        'bc_y%end'          : -3,  | 
 | 75 | +        'bc_z%beg'          : -2,  | 
 | 76 | +        'bc_z%end'          : -3,  | 
 | 77 | +        'num_patches'       : 2,  | 
 | 78 | +        'num_fluids'        : 2,  | 
 | 79 | +        'weno_avg'          : 'T',  | 
 | 80 | +    # =======================================  | 
 | 81 | + | 
 | 82 | +    # Database Structure Parameters =========  | 
 | 83 | +        'format'            : 1,  | 
 | 84 | +        'precision'         : 2,  | 
 | 85 | +        'alpha_wrt(1)'      : 'T',  | 
 | 86 | +        # 'prim_vars_wrt'     : 'T',  | 
 | 87 | +        'cf_wrt'            : 'T',  | 
 | 88 | +        'parallel_io'       : 'T',  | 
 | 89 | +    # =======================================  | 
 | 90 | + | 
 | 91 | +        'sigma'             : 8.0,  | 
 | 92 | + | 
 | 93 | +    # Fluid Parameters (Water) ==============  | 
 | 94 | +        'fluid_pp(1)%gamma'            : 1.E+00/(2.1E+00-1.E+00),  | 
 | 95 | +        'fluid_pp(1)%pi_inf'           : 2.1E+00*1.E+06/(2.1E+00-1.E+00),  | 
 | 96 | +        #'fluid_pp(1)%Re(1)'             : 1.e3,  | 
 | 97 | +    # =======================================  | 
 | 98 | + | 
 | 99 | +    # Fluid Parameters (Gas) ================  | 
 | 100 | +        'fluid_pp(2)%gamma'            : 1.E+00/(1.4E+00-1.E+00),  | 
 | 101 | +        'fluid_pp(2)%pi_inf'           : 0.E+00,  | 
 | 102 | +        #'fluid_pp(2)%Re(1)'             : 1.81e5,  | 
 | 103 | +    # =======================================  | 
 | 104 | + | 
 | 105 | +    # Air Patch ==========================  | 
 | 106 | +        'patch_icpp(1)%geometry'    : 9,  | 
 | 107 | +        'patch_icpp(1)%x_centroid'  : 0,  | 
 | 108 | +        'patch_icpp(1)%y_centroid'  : 0,  | 
 | 109 | +        'patch_icpp(1)%z_centroid'  : 0,  | 
 | 110 | +        'patch_icpp(1)%length_x'    : 2,  | 
 | 111 | +        'patch_icpp(1)%length_y'    : 2,  | 
 | 112 | +        'patch_icpp(1)%length_z'    : 2,  | 
 | 113 | +        'patch_icpp(1)%vel(1)'      : 0.0,  | 
 | 114 | +        'patch_icpp(1)%vel(2)'      : 0.0,  | 
 | 115 | +        'patch_icpp(1)%vel(3)'      : 0.0,  | 
 | 116 | +        'patch_icpp(1)%pres'        : 100000,  | 
 | 117 | +        'patch_icpp(1)%alpha_rho(1)': eps*1000,  | 
 | 118 | +        'patch_icpp(1)%alpha_rho(2)': (1-eps)*1,  | 
 | 119 | +        'patch_icpp(1)%alpha(1)'    : eps,  | 
 | 120 | +        'patch_icpp(1)%alpha(2)'    : 1-eps,  | 
 | 121 | +        'patch_icpp(1)%cf_val'      : 0,  | 
 | 122 | +    # ======================================  | 
 | 123 | + | 
 | 124 | +    # Water Patch ========================  | 
 | 125 | +        'patch_icpp(2)%alter_patch(1)' : 'T',  | 
 | 126 | +        'patch_icpp(2)%geometry'    : 9,  | 
 | 127 | +        'patch_icpp(2)%x_centroid'  : 0,  | 
 | 128 | +        'patch_icpp(2)%y_centroid'  : 0,  | 
 | 129 | +        'patch_icpp(2)%z_centroid'  : 0,  | 
 | 130 | +        'patch_icpp(2)%length_x'    : r0,  | 
 | 131 | +        'patch_icpp(2)%length_y'    : r0,  | 
 | 132 | +        'patch_icpp(2)%length_z'    : r0,  | 
 | 133 | +        'patch_icpp(2)%vel(1)'      : 0.,  | 
 | 134 | +        'patch_icpp(2)%vel(2)'      : 0.,  | 
 | 135 | +        'patch_icpp(2)%vel(3)'      : 0.,  | 
 | 136 | +        'patch_icpp(2)%pres'        : 100000,  | 
 | 137 | +        'patch_icpp(2)%alpha_rho(1)': (1-eps)*1000,  | 
 | 138 | +        'patch_icpp(2)%alpha_rho(2)': eps*1,  | 
 | 139 | +        'patch_icpp(2)%alpha(1)'    : (1-eps),  | 
 | 140 | +        'patch_icpp(2)%alpha(2)'    : eps,  | 
 | 141 | +        'patch_icpp(2)%cf_val'      : 1,  | 
 | 142 | +    # ======================================  | 
 | 143 | + | 
 | 144 | +}  | 
 | 145 | + | 
 | 146 | +print(json.dumps(data))  | 
0 commit comments