Skip to content

Commit

Permalink
Clean up boundary conditions and predictor corrector for staggered grid
Browse files Browse the repository at this point in the history
  • Loading branch information
SusanEAllen committed May 1, 2024
1 parent 08feaf6 commit 4560267
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions notebooks/lab7/01-lab7.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -634,20 +634,25 @@
"$$\\frac {h_{i}(t+dt)-h_{i}(t-dt)}{2 dt} + H \\frac {u_{i}(t) - u_{i - 1}(t)}{dx} = 0$$\n",
"</div>\n",
"\n",
"The initial conditions are: At $t = 0$ and $t = dt$, all points have\n",
"The initial conditions are: At $t = 0$, all points have\n",
"zero elevation except at $h_{3}$, where \n",
"$$h_{3}(0) = h_{0}$$\n",
"At $t = dt$, \n",
"$$h_{2}(dt) = h_{0} Hg \\frac{dt^2}{2 dx^2}$$ \n",
"$$h_{3}(dt) = h_{3}(0) - h_{0} Hg \\frac{dt^2}{dx^2}$$ \n",
"$$h_{4}(dt) = h_{0} Hg \\frac{dt^2}{2 dx^2}$$ \n",
"\n",
"At $t = 0$ and\n",
"$t = dt$, all points have zero velocity except at $u_{2}$ and $u_{3}$,\n",
"where \n",
"$$u_{2}(dt) = - h_{0} g \\frac{dt}{dx}$$\n",
"$$u_{3}(dt) = - u_{2}(dt)$$ \n",
"This time we assume there is a wall at\n",
"$u_{1}$ and $u_{4}$, so we will ignore the value of $h_{1}$. The\n",
"boundary conditions are: \n",
"$u_{1}$ and $u_{4}$. The\n",
"boundary conditions in $u$ are: \n",
"$$u_{1}(t) = 0$$ \n",
"$$u_{4}(t) = 0$$\n",
"We can use $\\partial h/\\partial x=0$ at the wall to put boundary conditions on $h$. An exercise for the reader is to decide which two $h$ points straddle the walls.\n",
"\n",
"### Problem One\n",
"[lab7:prob:staggered]:(#Problem-One)\n",
Expand Down

0 comments on commit 4560267

Please sign in to comment.