Skip to content

Commit 889ec58

Browse files
committed
Oh wow it worked lol
1 parent b6e5a7e commit 889ec58

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

notebooks/frontal-ablation.ipynb

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,24 @@
8080
"a = Constant(0.0)\n",
8181
"m_0 = Constant(-1.0)\n",
8282
"δm_δx = Constant(4.0)\n",
83-
"m = max_value(0, δm_δx * x[0] + m_0)"
83+
"#m = max_value(0, δm_δx * x[0] + m_0)\n",
84+
"m = Constant(0.0)"
85+
]
86+
},
87+
{
88+
"cell_type": "code",
89+
"execution_count": null,
90+
"id": "05984ccc-9cf0-487c-aad4-e94a29b58b60",
91+
"metadata": {},
92+
"outputs": [],
93+
"source": [
94+
"u_γ = Constant(-1.0)\n",
95+
"x_γ = Constant(0.5)\n",
96+
"h_γ = Constant(0.5)\n",
97+
"\n",
98+
"f_γ = h_γ * firedrake.as_vector(\n",
99+
" (firedrake.conditional(x[0] >= x_γ, u_γ, 0), 0)\n",
100+
")"
84101
]
85102
},
86103
{
@@ -91,14 +108,14 @@
91108
"outputs": [],
92109
"source": [
93110
"ϕ = firedrake.TestFunction(Q)\n",
94-
"F_cells = (Dt(h) * ϕ - inner(h * u, grad(ϕ)) - (a - m) * ϕ) * dx\n",
111+
"F_cells = (Dt(h) * ϕ - inner(h * u - f_γ, grad(ϕ)) - (a - m) * ϕ) * dx\n",
95112
"\n",
96113
"ν = firedrake.FacetNormal(mesh)\n",
97-
"f = max_value(0, h * inner(u, ν))\n",
114+
"f = max_value(0, inner(h * u - f_γ, ν))\n",
98115
"F_facets = jump(f) * jump(ϕ) * dS\n",
99116
"\n",
100-
"F_inflow = h_in * ϕ * min_value(0, inner(u, ν)) * ds\n",
101-
"F_outflow = h * ϕ * max_value(0, inner(u, ν)) * ds\n",
117+
"F_inflow = h_in * min_value(0, inner(u, ν)) * ϕ * ds\n",
118+
"F_outflow = max_value(0, inner(h * u - f_γ, ν)) * ϕ * ds\n",
102119
"\n",
103120
"F = F_cells + F_facets + F_inflow + F_outflow"
104121
]

0 commit comments

Comments
 (0)