You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bring the 3-D linear Euler model up to parity with LinearEuler2D:
- Carry the sound speed as solution variable 6 (nvar 5 -> 6), static in
time (zero flux/source), so heterogeneous media are supported. The
scalar attribute `c` remains as the reference value used by initial
conditions (SphericalSoundWave fills variable 6 with it).
- Replace the local Lax-Friedrichs Riemann solver with the
impedance-matched (characteristic/Godunov) flux used by the 2-D model:
interface states resolved with the one-sided impedances Z = rho0*c, so
material interfaces in a heterogeneous c field get the physically
correct transmission/reflection.
- GPU backend: fluxmethod reads the per-node c (variable 6) and the
boundaryflux kernel implements the impedance-matched flux; both drop
the scalar `c` argument (signatures now mirror the 2-D kernels). The
radiation BC kernel now takes the interior boundary state and copies c
through to extBoundary so face Riemann solves see a consistent sound
speed, with the acoustic perturbation still zeroed.
- Register a CPU radiation BC in AdditionalInit_LinearEuler3D_t
(previously the radiation BC existed only in the GPU backend); the GPU
AdditionalInit calls the parent and overwrites it with the kernel
wrapper, mirroring the 2-D module structure.
- Fix the entropy function: s(3)*(3) typo -> s(3)*s(3), include the w
contribution correctly, and use the per-node sound speed.
- Update the model documentation accordingly.
Motivation: 3-D ultrasound computed tomography forward modeling
(SELF-UCT AcousticTomography3D) needs spatially varying sound speed with
impedance-matched interface handling, exactly as the 2-D class has.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/Models/linear-euler-3d-model.md
+21-28Lines changed: 21 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,11 +20,12 @@ $$
20
20
u \\
21
21
v \\
22
22
w \\
23
-
p
23
+
p \\
24
+
c
24
25
\end{pmatrix}
25
26
$$
26
27
27
-
where $\rho$ is a density anomaly, referenced to the density $\rho_0$, $u$, $v$, and $w$ are the $x$, $y$, and $z$ components of the fluid velocity (respectively), and $p$ is the pressure. When we assume an ideal gas, and a motionless background state, the conservative fluxes are
28
+
where $\rho$ is a density anomaly, referenced to the density $\rho_0$, $u$, $v$, and $w$ are the $x$, $y$, and $z$ components of the fluid velocity (respectively), and $p$ is the pressure. The sound speed $c$ is carried as a solution variable so that heterogeneous (spatially varying) media are supported; it has zero flux and zero source, so it is static in time and is set by the initial condition (mirroring the 2-D model). When we assume an ideal gas, and a motionless background state, the conservative fluxes are
28
29
29
30
$$
30
31
\overleftrightarrow{f} =
@@ -33,11 +34,12 @@ $$
33
34
p \hat{x} \\
34
35
p \hat{y} \\
35
36
p \hat{z} \\
36
-
\rho_0c^2(u \hat{x} + v \hat{y} + w \hat{z})
37
+
\rho_0c^2(u \hat{x} + v \hat{y} + w \hat{z}) \\
38
+
0
37
39
\end{pmatrix}
38
40
$$
39
41
40
-
where $c$ is the (constant) speed of sound. The source term is set to zero.
42
+
The source term is set to zero.
41
43
42
44
$$
43
45
\vec{q} = \vec{0}
@@ -46,44 +48,35 @@ $$
46
48
To track stability of the Euler equation, the total entropy function is
47
49
48
50
$$
49
-
e = \frac{1}{2} \int_V u^2 + v^2 + \frac{p}{\rho_0 c^2} \hspace{1mm} dV
51
+
e = \frac{1}{2} \int_V \rho_0 (u^2 + v^2 + w^2) + \frac{p^2}{\rho_0 c^2} \hspace{1mm} dV
50
52
$$
51
53
52
54
## Implementation
53
-
The Linear Euler 3D model is implemented as a type extension of the [`DGModel3D` class](../ford/type/dgmodel3d_t.html). The [`LinearEuler3D_t` class](../ford/type/lineareuler3d_t.html) adds parameters for the reference density and the speed speed of sound and overrides the `SetMetadata`, `entropy_func`, `flux3d`, and `riemannflux3d` type-bound procedures.
55
+
The Linear Euler 3D model is implemented as a type extension of the [`DGModel3D` class](../ford/type/dgmodel3d_t.html). The [`LinearEuler3D_t` class](../ford/type/lineareuler3d_t.html) adds parameters for the reference density and the reference speed of sound and overrides the `SetMetadata`, `entropy_func`, `flux3d`, and `riemannflux3d` type-bound procedures.
54
56
55
57
### Riemann Solver
56
-
The `LinearEuler3D` class is defined using the conservative form of the conservation law. The Riemman solver for the hyperbolic part of Euler equation is the local Lax Friedrichs upwind riemann solver
58
+
The `LinearEuler3D` class is defined using the conservative form of the conservation law. The Riemann solver for the hyperbolic part of the Euler equation is the impedance-matched (characteristic/Godunov) upwind flux, identical in form to the 2-D model's. With the acoustic impedances $Z_L = \rho_0 c_L$ and $Z_R = \rho_0 c_R$ evaluated from the per-node sound speed on either side of the face, the interface normal velocity and pressure are
The details for this implementation can be found in [`self_lineareuler3d_t.f90`](../ford/sourcefile/self_lineareuler3d_t.f90.html)
79
+
Because the interface states are resolved with the one-sided impedances, material interfaces in a heterogeneous sound-speed field produce the physically correct transmission and reflection. The details for this implementation can be found in [`self_lineareuler3d_t.f90`](../ford/sourcefile/self_lineareuler3d_t.f90.html)
87
80
88
81
### Boundary conditions
89
82
When initializing the mesh for your Euler 3D equation solver, you can change the boundary conditions to
0 commit comments