|
1 | 1 | #!/usr/bin/env python3 |
2 | 2 | import json |
3 | 3 | import math |
| 4 | +import os |
4 | 5 |
|
5 | 6 | # Bubble screen |
6 | 7 | # Description: A planar acoustic wave interacts with a bubble cloud |
|
54 | 55 | Nx = 240 # number of elements into x direction |
55 | 56 | Ny = 50 # number of elements into y direction |
56 | 57 |
|
| 58 | +# Lagrangian bubble initial conditions |
| 59 | +# Columns: x, y, z, u, v, w, R, pad (all nondimensional; lengths in units of x0) |
| 60 | +lag_bubbles = [ |
| 61 | + (-10.0, -2.0, 0.0, 0.0, 0.0, 0.0, 0.1000, 0.0), |
| 62 | + (-10.0, -1.0, 0.0, 0.0, 0.0, 0.0, 0.1500, 0.0), |
| 63 | + (-10.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1500, 0.0), |
| 64 | + (-10.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.1500, 0.0), |
| 65 | + (-10.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.1009, 0.0), |
| 66 | +] |
| 67 | + |
| 68 | + |
| 69 | +def write_lag_bubbles_file(): |
| 70 | + input_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "input") |
| 71 | + os.makedirs(input_dir, exist_ok=True) |
| 72 | + with open(os.path.join(input_dir, "lag_bubbles.dat"), "w") as f: |
| 73 | + for row in lag_bubbles: |
| 74 | + f.write("".join(f"{v:15.6E}" for v in row) + "\n") |
| 75 | + |
| 76 | + |
| 77 | +write_lag_bubbles_file() |
| 78 | + |
57 | 79 | # Configuring case dictionary |
58 | 80 | print( |
59 | 81 | json.dumps( |
|
117 | 139 | "thermal": 3, |
118 | 140 | "polytropic": "F", |
119 | 141 | "fd_order": 2, |
120 | | - "lag_params%nBubs_glb": 5, |
| 142 | + "lag_params%nBubs_glb": len(lag_bubbles), |
121 | 143 | "lag_params%vel_model": 2, |
122 | 144 | "lag_params%drag_model": 3, |
123 | 145 | "lag_params%solver_approach": 1, |
|
0 commit comments