|
| 1 | +#!/usr/bin/env python3 |
| 2 | +""" |
| 3 | +2D Bingham (Herschel-Bulkley with flow index n = 1, yield stress tau0 > 0) |
| 4 | +Poiseuille channel. |
| 5 | +
|
| 6 | +Validation case for the YIELD-STRESS term of the non-Newtonian (Herschel-Bulkley) |
| 7 | +viscosity. The companion examples/2D_poiseuille_nn validates the power-law term |
| 8 | +(tau0 = 0); this case isolates the yield term by fixing n = 1 (so K = mu is a plain |
| 9 | +Newtonian consistency) and turning on tau0 > 0. The signature of a correct yield |
| 10 | +term is a rigid PLUG of uniform velocity near the centerline, where the shear |
| 11 | +stress |tau| = rho*g*(H - y) drops below tau0 and the fluid stops yielding. |
| 12 | +
|
| 13 | +A constant body acceleration g_x drives a fully-developed channel flow between two |
| 14 | +stationary no-slip walls (y = 0, L_y; half-height H = L_y/2, centerline y = H). |
| 15 | +The steady Bingham profile (n = 1, K = mu, tau_w = rho*g*H): |
| 16 | +
|
| 17 | + plug half-width from centerline : y0 = tau0/(rho*g) |
| 18 | + sheared region (0 <= y <= H - y0) : u(y) = (1/(2*mu*rho*g)) * |
| 19 | + [ (tau_w - tau0)^2 - (rho*g*(H-y) - tau0)^2 ] |
| 20 | + plug (H - y0 <= y <= H) : u_plug = (1/(2*mu*rho*g)) * (tau_w - tau0)^2 |
| 21 | + upper half mirrors about y = H. |
| 22 | +
|
| 23 | +Requires tau_w = rho*g*H > tau0 for any flow. |
| 24 | +
|
| 25 | +Parameters (nondimensional MFC units): |
| 26 | + rho = 1.0, H = 0.1 (L_y = 0.2) |
| 27 | + g_x = 0.1 -> tau_w = rho*g*H = 1.0e-2 |
| 28 | + tau0 = 4.0e-3 -> y0 = tau0/(rho*g) = 4.0e-2 = 0.4 H (clear plug + shear) |
| 29 | + K = mu = 5.0e-2 (n = 1 Bingham consistency; short diffusive time t_d = H^2 rho/mu = 0.2) |
| 30 | + hb_m = 1.0e4 (sharp Papanastasiou yield; uncapped plug mu = tau0*hb_m = 40) |
| 31 | + mu_min = 1e-6, mu_max = 1.0 (plug viscosity = 20*K, effectively rigid plug; |
| 32 | + kept modest because the explicit viscous timestep scales as 1/mu_max) |
| 33 | + pres = 10 -> sound speed ~3.74; u_plug ~ 3.6e-3 => Mach ~1e-3 (low Mach) |
| 34 | + grid: m = 24 (x, periodic; >= 24 for a 2-rank y-split WENO5 decomposition), |
| 35 | + n = 63 (y resolution of the plug; the viscous CFL dt ~ dy^2 rho/mu_max |
| 36 | + makes a finer grid prohibitively slow for an explicit solver), L_x = L_y = 0.2 |
| 37 | + cfl_adap_dt, cfl_target = 0.3, t_stop = 1.5 (~7.5 diffusive times t_d = 0.2) |
| 38 | +
|
| 39 | +Compare with compare_analytic.py. |
| 40 | +""" |
| 41 | + |
| 42 | +import json |
| 43 | + |
| 44 | +# Channel / fluid parameters |
| 45 | +L_x = 0.2 |
| 46 | +L_y = 0.2 |
| 47 | +rho = 1.0 |
| 48 | +pres = 10.0 |
| 49 | +K = 5.0e-2 # n = 1 -> K is the plain dynamic viscosity mu |
| 50 | +nn = 1.0 |
| 51 | +tau0 = 4.0e-3 |
| 52 | +g_x = 0.1 |
| 53 | + |
| 54 | +# Configuring case dictionary |
| 55 | +print( |
| 56 | + json.dumps( |
| 57 | + { |
| 58 | + # Logistics |
| 59 | + "run_time_info": "T", |
| 60 | + # Computational Domain Parameters |
| 61 | + "x_domain%beg": 0.0, |
| 62 | + "x_domain%end": L_x, |
| 63 | + "y_domain%beg": 0.0, |
| 64 | + "y_domain%end": L_y, |
| 65 | + "m": 24, |
| 66 | + "n": 63, |
| 67 | + "p": 0, |
| 68 | + "cfl_adap_dt": "T", |
| 69 | + "cfl_target": 0.3, |
| 70 | + "n_start": 0, |
| 71 | + "t_save": 0.15, |
| 72 | + "t_stop": 1.5, |
| 73 | + # Simulation Algorithm Parameters |
| 74 | + "num_patches": 1, |
| 75 | + "model_eqns": 2, |
| 76 | + "alt_soundspeed": "F", |
| 77 | + "num_fluids": 1, |
| 78 | + "mpp_lim": "F", |
| 79 | + "mixture_err": "T", |
| 80 | + "time_stepper": 3, |
| 81 | + "weno_order": 5, |
| 82 | + "weno_eps": 1e-16, |
| 83 | + "mapped_weno": "T", |
| 84 | + "weno_Re_flux": "T", |
| 85 | + "mp_weno": "T", |
| 86 | + "weno_avg": "T", |
| 87 | + "riemann_solver": 2, |
| 88 | + "wave_speeds": 1, |
| 89 | + "avg_state": 2, |
| 90 | + # x: periodic channel; y: stationary no-slip walls |
| 91 | + "bc_x%beg": -1, |
| 92 | + "bc_x%end": -1, |
| 93 | + "bc_y%beg": -16, |
| 94 | + "bc_y%end": -16, |
| 95 | + "viscous": "T", |
| 96 | + # Constant body acceleration in +x: accel = g_x + k_x*sin(w_x*t - p_x) |
| 97 | + "bf_x": "T", |
| 98 | + "g_x": g_x, |
| 99 | + "k_x": 0.0, |
| 100 | + "w_x": 0.0, |
| 101 | + "p_x": 0.0, |
| 102 | + # Formatted Database Files Structure Parameters |
| 103 | + "format": 1, |
| 104 | + "precision": 2, |
| 105 | + "prim_vars_wrt": "T", |
| 106 | + "fd_order": 4, |
| 107 | + "parallel_io": "T", |
| 108 | + # Patch 1: full domain, quiescent |
| 109 | + "patch_icpp(1)%geometry": 3, |
| 110 | + "patch_icpp(1)%x_centroid": 0.5 * L_x, |
| 111 | + "patch_icpp(1)%y_centroid": 0.5 * L_y, |
| 112 | + "patch_icpp(1)%length_x": L_x, |
| 113 | + "patch_icpp(1)%length_y": L_y, |
| 114 | + "patch_icpp(1)%vel(1)": 0.0, |
| 115 | + "patch_icpp(1)%vel(2)": 0.0, |
| 116 | + "patch_icpp(1)%pres": pres, |
| 117 | + "patch_icpp(1)%alpha_rho(1)": rho, |
| 118 | + "patch_icpp(1)%alpha(1)": 1.0, |
| 119 | + # Fluids Physical Parameters: single Bingham (HB with n = 1, tau0 > 0) fluid |
| 120 | + "fluid_pp(1)%gamma": 1.0 / (1.4 - 1.0), |
| 121 | + "fluid_pp(1)%pi_inf": 0.0, |
| 122 | + "fluid_pp(1)%Re(1)": 1.0 / K, |
| 123 | + "fluid_pp(1)%non_newtonian": "T", |
| 124 | + "fluid_pp(1)%K": K, |
| 125 | + "fluid_pp(1)%nn": nn, |
| 126 | + "fluid_pp(1)%tau0": tau0, |
| 127 | + "fluid_pp(1)%hb_m": 1.0e4, |
| 128 | + "fluid_pp(1)%mu_min": 1e-6, |
| 129 | + "fluid_pp(1)%mu_max": 1.0, |
| 130 | + } |
| 131 | + ) |
| 132 | +) |
0 commit comments