Skip to content

Commit b6e5a7e

Browse files
committed
Add area-wide ablation
1 parent cba7c00 commit b6e5a7e

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

notebooks/frontal-ablation.ipynb

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,19 @@
7070
"h = h_0.copy(deepcopy=True)"
7171
]
7272
},
73+
{
74+
"cell_type": "code",
75+
"execution_count": null,
76+
"id": "8587d44a-f4bd-4203-b233-c298f3171a8e",
77+
"metadata": {},
78+
"outputs": [],
79+
"source": [
80+
"a = Constant(0.0)\n",
81+
"m_0 = Constant(-1.0)\n",
82+
"δm_δx = Constant(4.0)\n",
83+
"m = max_value(0, δm_δx * x[0] + m_0)"
84+
]
85+
},
7386
{
7487
"cell_type": "code",
7588
"execution_count": null,
@@ -78,7 +91,7 @@
7891
"outputs": [],
7992
"source": [
8093
"ϕ = firedrake.TestFunction(Q)\n",
81-
"F_cells = (Dt(h) * ϕ - inner(h * u, grad(ϕ))) * dx\n",
94+
"F_cells = (Dt(h) * ϕ - inner(h * u, grad(ϕ)) - (a - m) * ϕ) * dx\n",
8295
"\n",
8396
"ν = firedrake.FacetNormal(mesh)\n",
8497
"f = max_value(0, h * inner(u, ν))\n",
@@ -101,13 +114,21 @@
101114
"t = Constant(0.0)\n",
102115
"dt = Constant(0.5 * δ / u_max)\n",
103116
"\n",
117+
"lower = firedrake.Function(Q)\n",
118+
"upper = firedrake.Function(Q)\n",
119+
"upper.assign(np.inf)\n",
120+
"bounds = (\"stage\", lower, upper)\n",
121+
"\n",
104122
"params = {\n",
105123
" \"solver_parameters\": {\n",
106-
" \"snes_type\": \"newtonls\",\n",
124+
" \"snes_type\": \"vinewtonrsls\",\n",
107125
" \"ksp_type\": \"gmres\",\n",
108126
" \"pc_type\": \"lu\",\n",
109127
" \"pc_factor_mat_solver_type\": \"mumps\",\n",
110128
" },\n",
129+
" \"stage_type\": \"value\",\n",
130+
" \"basis_type\": \"Bernstein\",\n",
131+
" \"bounds\": bounds,\n",
111132
"}\n",
112133
"\n",
113134
"solver = irksome.TimeStepper(F, method, t, dt, h, **params)"

0 commit comments

Comments
 (0)