Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

examples: Fix ADER notebook numbering #2450

Merged
merged 2 commits into from
Sep 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions examples/seismic/tutorials/16_ader_fd.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"id": "31226b14-e907-4503-9918-a09163363217",
EdCaunt marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

@mloubout mloubout Sep 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an actual reason why? Or it "just works"


Reply via ReviewNB

EdCaunt marked this conversation as resolved.
Show resolved Hide resolved
EdCaunt marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

@mloubout mloubout Sep 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpicking:

Might be nicer to avoid those function and to add an option for the derivatives to "expand/simplify". so that you just need grad(div(p)) for graddiv for example.


Reply via ReviewNB

Copy link
Contributor

@mloubout mloubout Sep 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose one you derive in the math and leave the rest outII

Something needs to be said about ABCs. It is a bit non intuitive and potentially dangerous that it doesn't need any so there needs to be some explanation why


Reply via ReviewNB

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added an explanation. Essentially the discretisation introduces numerical diffusion where the solution is non-smooth, so when the wave hits the zero padding, it will diffuse outwards (although the zeroes never get updated).

"metadata": {},
"source": [
"# ADER-FD\n",
"# 15 - ADER-FD\n",
"\n",
"This notebook demonstrates the implementation of a finite-difference scheme for solving the first-order formulation of the acoustic wave equation using ADER (Arbitrary-order-accuracy via DERivatives) time integration. This enables a temporal discretisation up the order of the spatial discretisation, whilst preventing the grid-grid decoupling (often referred to as checkerboarding) associated with solving first-order systems of equations on a single finite-difference grid.\n",
"\n",
Expand Down Expand Up @@ -35,7 +35,7 @@
"\n",
"$\\frac{\\partial^2 \\mathbf{U}}{\\partial t^2} = \\begin{bmatrix}c^2 \\nabla^2 p \\\\ c^2\\boldsymbol{\\nabla}\\left(\\boldsymbol{\\nabla}\\cdot\\mathbf{v}\\right) \\end{bmatrix}$.\n",
"\n",
"This process is iterated to obtain the required temporal derivatives.\n",
"This process is iterated to obtain equations for the required higher-order temporal derivatives.\n",
"\n",
"High-order explicit timestepping is achieved by substituting these expressions into the Taylor expansion, truncated at the desired temporal discretisation order. As such, the order of the temporal discretisation can be increased to that of the spatial discretisation."
]
Expand All @@ -62,7 +62,7 @@
"id": "e3ed902a-fc78-4199-80df-766df1f21e55",
"metadata": {},
"source": [
"To begin, we set up the `Grid`. Note that no staggering is specified for the `Function`s as it is not needed in this case."
"To begin, we set up the `Grid`. Note that no staggering is specified for the `Function`s, being unnecessary in this case due to the coupling of solution variables present in the ADER-FD update equations."
]
},
{
Expand Down Expand Up @@ -199,14 +199,6 @@
"source": [
"dt = grid.stepping_dim.spacing\n",
"\n",
"# Update equations (2nd-order ADER timestepping)\n",
"# eq_p = dv.Eq(p.forward, p + dt*pdt + (dt**2/2)*pdt2)\n",
"# eq_v = dv.Eq(v.forward, v + dt*vdt + (dt**2/2)*vdt2)\n",
"\n",
"# Update equations (3rd-order ADER timestepping)\n",
"# eq_p = dv.Eq(p.forward, p + dt*pdt + (dt**2/2)*pdt2 + (dt**3/6)*pdt3)\n",
"# eq_v = dv.Eq(v.forward, v + dt*vdt + (dt**2/2)*vdt2 + (dt**3/6)*vdt3)\n",
"\n",
"# Update equations (4th-order ADER timestepping)\n",
"eq_p = dv.Eq(p.forward, p + dt*pdt + (dt**2/2)*pdt2 + (dt**3/6)*pdt3 + (dt**4/24)*pdt4)\n",
"eq_v = dv.Eq(v.forward, v + dt*vdt + (dt**2/2)*vdt2 + (dt**3/6)*vdt3 + (dt**4/24)*vdt4)"
Expand Down Expand Up @@ -540,7 +532,7 @@
"id": "2d4d119c-e723-4792-8449-df80e7ac6fc9",
"metadata": {},
"source": [
"Note the damping of the field at the boundaries when using the ADER scheme. This is in the absence of any damping boundary conditions, hence the presence of reflections in the staggered case."
"Note the damping of the field at the boundaries when using the ADER scheme. ADER-FD schemes exhibit numerical diffusion when encountering non-smooth solutions, as is the case at the zero padding surrounding the grid. This occurs in the absence of any damping boundary conditions, hence the presence of reflections in the staggered case."
]
},
{
Expand Down
Loading