-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNumGy_LV13.qmd
187 lines (127 loc) · 5.11 KB
/
NumGy_LV13.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
---
title: "Numerical Simulation Methods in Geophysics, Part 13: A few more details"
subtitle: "1. MGPY+MGIN"
author: "[email protected]"
title-slide-attributes:
data-background-image: pics/tubaf-logo.png
data-background-size: 20%
data-background-position: 10% 95%
format:
tubaf-revealjs:
html-math-method: mathjax
chalkboard: true
include-in-header:
- text: |
<script>
window.MathJax = {
loader: {
load: ['[tex]/physics']
},
tex: {
packages: {'[+]': ['physics']}
}
};
</script>
slide-number: c/t
transition: slide
transition-speed: fast
menu:
side: left
---
# Recap
1. The Finite Difference (FD) method
* Poisson equation in 1D, look into 2D/3D
* diffusion equation in 1D, time-stepping, (1D wave equation)
1. The Finite Element (FE) method
* Poisson and diffusion equation in 1D
* (complex) Helmholtz equation in 2D for EM problems
* solving EM problems and computational aspects
1. Finite Volume (FV) method for advection problems
## The methods
::: {.callout-tip title="The Finite Difference method"}
approximates the partial derivatives by difference quotients (beware $\Delta x$ and $\Delta a$)
:::
::: {.callout-tip title="The Finite Element method"}
approximates the solution through base functions in integrative sense
:::
::: {.callout-tip title="The Finite Volume method"}
approximates the solution by piecewise constant values and keeps conservation law by fluxes
:::
# Boundary conditions
## Mixed boundary conditions
So far...
* Dirichlet Boundary conditions $u=u_0$
* Neumann Boundary conditions $\pdv{u}{n}=g_B$<br>
for vectorial problems $\vb n\cdot \vb E=0$ or $\vb\curl \vb E=0$
In general mixed, also called Robin (or impedance convective) BC
$$ a u + b \pdv{u}{n} = c $$
## Example DC resistivity with point source
$$\div \sigma \grad u = \div \vb j = I \delta(\vb r - \vb r_s)$$
solution for homogeneous $\sigma$ on surface: $u=\frac{I}{2\pi\sigma} \frac{1}{|\vb r - \vb r_s|}$
E-field $\vb E=-\frac{I}{2\pi\sigma} \frac{\vb r - \vb r_s}{|\vb r - \vb r_s|^3}$
normal direction $\vb E \cdot \vb n=-\frac{u}{|\vb r - \vb r_s|}\cos \phi$ purely geometric
$$\pdv{u}{n} + \frac{\cos\phi}{|\vb r - \vb r_s|}=0$$
## Perfectly matched layers
::: {.columns}
::: {.column}

:::
::: {.column}
$$ \pdv{x} \rightarrow \frac{1}{1+i\sigma/\omega} \pdv{x} $$
$$ x \rightarrow x + \frac{i}{\omega}\int^x \sigma(x')\dd x' $$
:::
:::
## Absorbing boundary conditions
wave equation (e.g. in 2D)
$$ \pdv[2]{u}{t} - v^2 \laplacian u = 0 $$
Fourier transform in $t$ and $y$ (boundary direction) $\Rightarrow \omega, k$
$$ \omega^2 \hat{u} - v^2 \pdv[2]{\hat{u}}{x} + v^2 k^2 \hat{u} = 0 $$
ordinary DE with solution $\hat{u}=\sum a_i e^{\lambda x}$ with $\lambda^2 = k^2 - \omega^2/v^2$
# Modern methods
## Solution in wavenumber domain
Fourier transform of 3D problem into wavenumbers
$$\hat F(k_x, y, z)=\int\limits_{-\infty}^{\infty} F(x,y,z) e^{-\imath k_x x} \dd x$$
partial derivative $\pdv[2]{\hat F}{x}=k_x^2 \pdv[2]{F}{x}$
Poisson equation $\nabla_{3D}^2 u=0$ $\Rightarrow$ Helmholtz equation $\nabla_{3D}^2 \hat u - k_x^2\hat u=0$ $\Rightarrow$ solve many 2D problems & get solution by inverse Fourier transform
## Spectral element method
typically used for global wave phenomena
::: {.columns}
::: {.column}
$u=\sum u_i\phi_i(\pv r)$
$\phi$ Lagrangian polynoms $l_i^N=\prod\limits_k^N \frac{\xi-\xi_k}{\xi_i-\xi_k}$
or Chebychev polynoms
:::
::: {.column}

:::
:::
## Discontinuous Galerkin method
typical for hyperbolic problems
weak form of wave equation with fluxes (FV)
$$M\partial_t q(t) - A^T q(t) = -F(a, q(t))$$
$$\Rightarrow \partial_t q=\vb M^{-1}(A^T q(t) - F(a, q(t)))$$
locally for each element & communication through fluxes (like in FV)
## Infinite Elements

## Meshless modelling

## Meshless divergence operator (Wittke, 2017)

# Error estimation and mesh refinement
* get idea of accuracy of the solution
* refinement of cells with high error (e.g. large gradients)
* comparison between successive refinement solutions
## Error estimation (residual-based)
Poisson problem $-\nabla^2=f$ with bilinear form $a(u,v)=\int \grad u \grad v \dd\Omega$
finite-dimensional function space $V_h$: $a(u_h, v_h)=l(v_h)$
estimate error $e_h$ in bilinear form $a(e_h,v)=a(u, v)-a(u_h, v)$
residual $R=f+\nabla^2 u_h$ leads to $a(e_h,v)=\sum\limits_c\int\limits_{\Omega_c} R v \dd\Omega_c$
## Error estimation (recovery-based)
gradients across element boundaries tend to be discontinuous
compare original (unsmoothed) gradient of the solution with improved
$$(E_h)^2 = \int |M(u_h)-\grad u_h|^2\dd\Omega $$
$M$ obtained by smoothing over patch of elements around each element
## Goal-oriented mesh refinement
primal and dual (adjoint) problem (with receiver as hypothetical source)
inner product of solutions
$$\Phi_{lmn}=\int_{c_n} \vb F^l \vb F^m \dd\Omega_n$$