-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNumGy_LV13E.qmd
146 lines (104 loc) · 4.56 KB
/
NumGy_LV13E.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
---
title: "Numerical Simulation Methods in Geophysics, Exercise 13: I open at the close"
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
# jupyter: python3
---
# Plane waves in the Earth
We consider an MT case with a horizontally polarized magnetic field up in the air.
Task: Compute electromagnetic fields in the Earth
For theory, see [Theory EM (Börner)](https://ruboerner.github.io/ThEM/mtfields.html)
## Helmholtz equations for $E$ and $H$
The magnetic field in the frequency domain is governed by the Helmholtz equations (no displacement currents, no sources)
$$ \curl \mu^{-1} \curl \vb E + \imath\omega\sigma\vb E = 0$$ {#eq-helmE}
$$ \curl \sigma^{-1} \curl \vb H + \imath\omega\mu\vb H = 0$$ {#eq-helmH}
2D E/H polarization: $\div\grad H_x + \imath\omega\sigma\mu H_x = 0$
## Equation to be solved
For the source field
$$ \mathbf H(z, \omega) = \begin{bmatrix} H_x^0\\ 0\\ 0 \end{bmatrix} e^{i \omega t}, \quad z < 0 $$
we end up in the equation for $H_x$
$$ \pdv[2]{H_x}{y} + \pdv[2]{H_x}{z} + k^2 H_x = 0 \qqtext{with} k^2 = - i \omega \mu \sigma $$
## Analytical solution
For homogeneous $\sigma=\sigma_0$, the solution is
$$ H_x(z) = H_x^0 e^{- i k z} = H_x^0 e^{-i \sqrt{-i \omega \mu \sigma_0} z} $$ {#eq-sol-h}
## Secondary field for EM
$$-\grad^2 (\vb H_0 + \vb H_a) +\imath\omega\mu(\sigma_0+\delta\sigma) (\vb H_0 + \vb H_a)=0$$
$$-\grad^2 \vb H_0 +\imath\omega\mu\sigma_0 \vb H_0=0$$
$$ -\grad^2 \vb H_a + \imath\omega\mu\sigma \vb H_a = -\imath\omega\mu\delta\sigma \vb H_0 $$
::: {.callout-note}
Source terms only arise at anomalous conductivities and increase with primary field
:::
## Secondary field for EM
$$ -\grad^2 \vb H_a + \imath\omega\mu\sigma \vb H_a = -\imath\omega\mu\delta\sigma \vb H_0 $$
leads to the discretized form ($\vb A$-stiffness, $\vb M$-mass)
$$ \vb A \vb H_a + \imath\omega\vb M_\sigma \vb H_a = -\imath\omega\vb M_{\delta\sigma} \vb H_0 $$
## Way 1 - complex calculus
```python
C = pg.core.CSparseMatrix(A.vecColPtr(), A.vecRowIdx(),
pg.core.toComplex(A.vecVals(), M.vecVals()*w))
c = pg.core.toComplex(b, b*0)
u = ps.linSolve(C, c)
```
## Way 2 - real calculus
### How to create the double real/imag matrix
:::: {.columns}
::: {.column width="50%"}
$$\mqty(A & -\omega M\\ \omega M & A) \mqty(u_r\\ u_i) = \mqty(b_r\\ b_i) $$
:::
::: {.column width="50%"}
```
ndof = mesh.nodeCount()
B = pg.BlockMatrix()
B.Aid = B.addMatrix(A)
B.Mid = B.addMatrix(M)
B.addMatrixEntry(B.Aid, 0, 0)
B.addMatrixEntry(B.Aid, ndof, ndof)
B.addMatrixEntry(B.Mid, 0, ndof, scale=-w)
B.addMatrixEntry(B.Mid, ndof, 0, scale=w)
```
:::
::::
## Report II - 2D plane-wave EM
1. Design a subsurface 2D model with a good conductor in a halfspace
1. Compute the primary magnetic field analytically and numerically by solving the Helmholtz equation for homogeneous conductivity, use a constant field on the upper boundary and zero on the others
1. Visualize and compare with the analytical solution
1. Compute the secondary field for the anomalous conductivity
1. Visualize the secondary and total fields
1. Replace the good conductor with a bad conductor and repeat
1. Rerun the computations with a higher and lower (x10) period
## Secondary field for H
$$-\div \rho_0 \grad \vb H_0 +\imath\omega\mu \vb H_0=0$$
$$-\div \rho \grad (\vb H_0 + \vb H_s) +\imath\omega\mu (\vb H_0 + \vb H_s)=0$$
$$ -\div \rho \grad \vb H_a + \imath\omega\mu \vb H_a = \div \delta\rho \grad \vb H_0 $$
$$\vb A_\rho + \imath\omega \vb M = -\vb A_{\delta\rho}\vb H_0$$
## The rot-rot term in the $H$ polarization
$$\curl(\curl\vb A) = \grad(\div\vb A) - \laplacian\vb A$$
$$\curl (a\vb A)=a\curl \vb A + \grad a \cross \vb A $$
$$\Rightarrow \curl (\rho\curl\vb H) = \rho\curl\curl\vb H + \grad \rho \cross \curl \vb H $$
$$\curl (\rho\curl\vb H) = \rho\grad(\div\vb H) - \rho\nabla^2\vb H + \grad \rho \cross \curl \vb H $$
The 1st term on the right-hand side vanishes ($\div\vb B=0$), the 2nd is the classical stiffness ($\rho$ is element-wise constant), but the 3rd?