|
| 1 | +import json |
| 2 | +import math |
| 3 | + |
| 4 | +# This case file is based on verification cases run in |
| 5 | +# "Analytical solution for the problem of frictional-elastic collisions |
| 6 | +# of spherical particles using the linear model" |
| 7 | +# by Francesco Paolo Di Maio and Alberto Di Renzo |
| 8 | + |
| 9 | +# This can be used to check collision rebound angles to recreate |
| 10 | +# figure 4 of that paper |
| 11 | + |
| 12 | +Mu = 1.84e-05 |
| 13 | +gam_a = 1.4 |
| 14 | + |
| 15 | +# lead-up-properties |
| 16 | +velocity = 3.9 |
| 17 | +dt = 5.0e-6 |
| 18 | +collision_time = 20.0 * dt |
| 19 | + |
| 20 | +# parerticle properties |
| 21 | +radius = 5.0 |
| 22 | +collision_angle_degrees = 30.0 |
| 23 | +collision_angle_radians = collision_angle_degrees * math.pi / 180.0 |
| 24 | +domain_size = 4.0 * radius |
| 25 | +lead_distance = 0.2 * radius |
| 26 | + |
| 27 | +# simulation runs long enough to collide and travel about lead distance away again |
| 28 | +simulation_time = 2.0 * (lead_distance / velocity) + collision_time |
| 29 | +num_time_steps = int(simulation_time / dt) |
| 30 | +num_saves = 10 |
| 31 | +t_step_save = int(num_time_steps / num_saves) |
| 32 | + |
| 33 | +# Configuring case dictionary |
| 34 | +print( |
| 35 | + json.dumps( |
| 36 | + { |
| 37 | + # Logistics |
| 38 | + "run_time_info": "T", |
| 39 | + # Computational Domain Parameters |
| 40 | + "x_domain%beg": -0.5 * domain_size, |
| 41 | + "x_domain%end": 0.5 * domain_size, |
| 42 | + "y_domain%beg": 0.0, |
| 43 | + "y_domain%end": domain_size, |
| 44 | + "z_domain%beg": -0.5 * domain_size, |
| 45 | + "z_domain%end": 0.5 * domain_size, |
| 46 | + "cyl_coord": "F", |
| 47 | + "m": 60, |
| 48 | + "n": 60, |
| 49 | + "p": 60, |
| 50 | + "dt": dt, |
| 51 | + "t_step_start": 0, |
| 52 | + "t_step_stop": num_time_steps, |
| 53 | + "t_step_save": t_step_save, |
| 54 | + # Simulation Algorithm Parameters |
| 55 | + "num_patches": 1, |
| 56 | + # Use the 5 equation model |
| 57 | + "model_eqns": 2, |
| 58 | + "alt_soundspeed": "F", |
| 59 | + # One fluids: air |
| 60 | + "num_fluids": 1, |
| 61 | + "mpp_lim": "F", |
| 62 | + # Correct errors when computing speed of sound |
| 63 | + "mixture_err": "T", |
| 64 | + # Use TVD RK3 for time marching |
| 65 | + "time_stepper": 3, |
| 66 | + # Use WENO5 |
| 67 | + "weno_order": 5, |
| 68 | + "weno_eps": 1.0e-16, |
| 69 | + "weno_avg": "T", |
| 70 | + "avg_state": 2, |
| 71 | + "mapped_weno": "T", |
| 72 | + "null_weights": "F", |
| 73 | + "mp_weno": "T", |
| 74 | + "riemann_solver": 2, |
| 75 | + "wave_speeds": 1, |
| 76 | + # We use ghost-cell |
| 77 | + "bc_x%beg": -3, |
| 78 | + "bc_x%end": -3, |
| 79 | + "bc_y%beg": -15, |
| 80 | + "bc_y%end": -15, |
| 81 | + "bc_z%beg": -3, |
| 82 | + "bc_z%end": -3, |
| 83 | + # Set IB to True and add 1 patch |
| 84 | + "ib": "T", |
| 85 | + "num_ibs": 1, |
| 86 | + # Formatted Database Files Structure Parameters |
| 87 | + "format": 1, |
| 88 | + "precision": 2, |
| 89 | + "prim_vars_wrt": "T", |
| 90 | + "E_wrt": "T", |
| 91 | + "parallel_io": "T", |
| 92 | + # Patch: Constant Tube filled with air |
| 93 | + # Specify the cylindrical air tube grid geometry |
| 94 | + "patch_icpp(1)%geometry": 9, |
| 95 | + "patch_icpp(1)%x_centroid": 0.0, |
| 96 | + "patch_icpp(1)%y_centroid": 0.5 * domain_size, |
| 97 | + "patch_icpp(1)%z_centroid": 0.0, |
| 98 | + "patch_icpp(1)%length_x": domain_size, |
| 99 | + "patch_icpp(1)%length_y": domain_size, |
| 100 | + "patch_icpp(1)%length_z": domain_size, |
| 101 | + # Specify the patch primitive variables |
| 102 | + "patch_icpp(1)%vel(1)": 0.0e00, |
| 103 | + "patch_icpp(1)%vel(2)": 0.0e00, |
| 104 | + "patch_icpp(1)%vel(3)": 0.0e00, |
| 105 | + "patch_icpp(1)%pres": 1.0e00, |
| 106 | + "patch_icpp(1)%alpha_rho(1)": 1.0e00, |
| 107 | + "patch_icpp(1)%alpha(1)": 1.0e00, |
| 108 | + # Patch: Sphere Immersed Boundary |
| 109 | + "patch_ib(1)%geometry": 8, |
| 110 | + "patch_ib(1)%x_centroid": -1.0 * lead_distance * math.sin(collision_angle_radians), # get a lead up distance to the collision |
| 111 | + "patch_ib(1)%y_centroid": radius + lead_distance * math.sin(collision_angle_radians), |
| 112 | + "patch_ib(1)%z_centroid": 0.0, |
| 113 | + "patch_ib(1)%radius": radius, |
| 114 | + "patch_ib(1)%slip": "F", |
| 115 | + "patch_ib(1)%mass": 1.0e6, # arbitrarily high mass to ignore fluid |
| 116 | + "patch_ib(1)%vel(1)": velocity * math.sin(collision_angle_radians), |
| 117 | + "patch_ib(1)%vel(2)": -velocity * math.cos(collision_angle_radians), |
| 118 | + "patch_ib(1)%moving_ibm": 2, |
| 119 | + # Collisions |
| 120 | + "collision_model": 1, # soft-sphere collision model |
| 121 | + "ib_coefficient_of_friction": 0.092, |
| 122 | + "collision_time": collision_time, |
| 123 | + "coefficient_of_restitution": 0.98, # almost perfectly elastic |
| 124 | + # Fluids Physical Parameters |
| 125 | + "fluid_pp(1)%gamma": 1.0e00 / (gam_a - 1.0e00), # 2.50(Not 1.40) |
| 126 | + "fluid_pp(1)%pi_inf": 0, |
| 127 | + } |
| 128 | + ) |
| 129 | +) |
0 commit comments