18 G =
Geo(ND, off); h = G.h; k = Bi
21 for tag, d
in ((
"RF", G.dwall), (
"RFc", np.maximum(G.sdf, 0.05 * h))):
22 wc = np.where(cells, G.Aw / (h * h * (np.maximum(d, 1e-3 * h) + 1 / k)), 0)
23 K, _ = assemble_fv(G, G.ax, G.ay, cells, wall_coef=wc)
24 out[tag] = smallest_eig(K, G.kap[cells], k=1)[0]
27 X, Y = np.meshgrid(G.xc, G.yc, indexing=
"ij")
28 rr = np.hypot(X, Y); nx, ny = X / rr, Y / rr
29 wallc = np.zeros((n, n))
30 for i, j
in zip(*np.nonzero(sc)):
32 for (di, dj, na)
in ((1, 0, nx), (-1, 0, nx), (0, 1, ny), (0, -1, ny)):
33 if not sc[i + di, j + dj]:
34 th = max(dn / (dn - G.sdf[i + di, j + dj]), 1e-3)
35 wallc[i, j] += (k * dn / th / h) / (h * (1 + k * dn))
36 axb = np.zeros_like(G.ax); ayb = np.zeros_like(G.ay)
37 axb[1:-1, :] = (sc[1:, :] & sc[:-1, :]); ayb[:, 1:-1] = (sc[:, 1:] & sc[:, :-1])
38 K, _ = assemble_fv(G, axb, ayb, sc, wall_coef=wallc)
39 out[
"RG"] = smallest_eig(K, np.ones(sc.sum()), k=1)[0]