|
15 | 15 | The analytical solution is: u(y) = (G/(2*mu)) * y * (H - y) |
16 | 16 | where G = rho * g_x is the effective pressure gradient. |
17 | 17 | """ |
| 18 | + |
18 | 19 | import json |
19 | 20 | import math |
20 | 21 |
|
21 | | -# === Channel geometry (square domain) === |
22 | | -L = 1.0 # Channel length (streamwise, x) |
23 | | -H = 1.0 # Channel height (wall-normal, y) |
| 22 | +# -- Channel geometry (square domain) -- |
| 23 | +L = 1.0 # Channel length (streamwise, x) |
| 24 | +H = 1.0 # Channel height (wall-normal, y) |
24 | 25 |
|
25 | | -# === Grid resolution === |
26 | | -Nx = 24 # Cells in x (streamwise, minimal — periodic) |
27 | | -Ny = 81 # Cells in y (wall-normal) |
| 26 | +# -- Grid resolution -- |
| 27 | +Nx = 24 # Cells in x (streamwise, minimal — periodic) |
| 28 | +Ny = 81 # Cells in y (wall-normal) |
28 | 29 |
|
29 | | -# === Fluid properties === |
30 | | -rho = 1.0 # Density |
31 | | -p0 = 1e5 # Reference pressure (high for low Mach) |
32 | | -gamma = 1.4 # Ratio of specific heats |
| 30 | +# -- Fluid properties -- |
| 31 | +rho = 1.0 # Density |
| 32 | +p0 = 1e5 # Reference pressure (high for low Mach) |
| 33 | +gamma = 1.4 # Ratio of specific heats |
33 | 34 |
|
34 | 35 | # Sound speed and CFL |
35 | 36 | c = math.sqrt(gamma * p0 / rho) |
36 | 37 | dx = L / (Nx + 1) |
37 | 38 | cfl = 0.3 |
38 | 39 | dt = cfl * dx / c |
39 | 40 |
|
40 | | -# === Body force (pressure gradient substitute) === |
| 41 | +# -- Body force (pressure gradient substitute) -- |
41 | 42 | # G = rho * g_x acts as dp/dx driving force |
42 | 43 | g_x = 0.5 |
43 | 44 |
|
44 | | -# === HB non-Newtonian model parameters === |
45 | | -tau0 = 0.0 # Yield stress (set 0 for power-law) |
46 | | -K = 0.1 # Consistency index |
47 | | -nn = 2.0 # Flow behavior index (< 1 = shear-thinning) |
48 | | -hb_m = 1000.0 # Papanastasiou regularization parameter |
49 | | -mu_min = 1e-4 # Minimum viscosity bound |
50 | | -mu_max = 10.0 # Maximum viscosity bound |
51 | | -mu_bulk = 0.0 # Bulk viscosity |
| 45 | +# -- HB non-Newtonian model parameters -- |
| 46 | +tau0 = 0.0 # Yield stress (set 0 for power-law) |
| 47 | +K = 0.1 # Consistency index |
| 48 | +nn = 2.0 # Flow behavior index (< 1 = shear-thinning) |
| 49 | +hb_m = 1000.0 # Papanastasiou regularization parameter |
| 50 | +mu_min = 1e-4 # Minimum viscosity bound |
| 51 | +mu_max = 10.0 # Maximum viscosity bound |
| 52 | +mu_bulk = 0.0 # Bulk viscosity |
52 | 53 |
|
53 | 54 | # Reference Re based on consistency index (used as baseline) |
54 | | -Re_ref = 1.0 / K # = 100 |
| 55 | +Re_ref = 1.0 / K # = 100 |
55 | 56 |
|
56 | | -# === Time control === |
57 | | -t_end = 10.0 # End time (allow flow to reach steady state) |
58 | | -t_save = 5.0 # Save interval |
| 57 | +# -- Time control -- |
| 58 | +t_end = 10.0 # End time (allow flow to reach steady state) |
| 59 | +t_save = 5.0 # Save interval |
59 | 60 |
|
60 | 61 | eps = 1e-6 |
61 | 62 |
|
|
0 commit comments