File: guide_to_examples_by_physics.md.txt

package info (click to toggle)
petsc 3.23.1%2Bdfsg1-1exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 515,576 kB
  • sloc: ansic: 751,607; cpp: 51,542; python: 38,598; f90: 17,352; javascript: 3,493; makefile: 3,157; sh: 1,502; xml: 619; objc: 445; java: 13; csh: 1
file content (127 lines) | stat: -rw-r--r-- 3,560 bytes parent folder | download
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
# Tutorials, by Physics

```{highlight} none
```

Below we list examples which simulate particular physics problems so that users interested in a particular set of governing equations can easily locate a relevant example. Often PETSc will have several examples looking at the same physics using different numerical tools, such as different discretizations, meshing strategy, closure model, or parameter regime.

## Poisson

The Poisson equation

$$
-\Delta u = f
$$

is used to model electrostatics, steady-state diffusion, and other physical processes. Many PETSc examples solve this equation.

> Finite Difference
> : ```{eval-rst}
>
>   :2D: `SNES example 5 <PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex5.c.html>`_
>   :3D: `KSP example 45 <PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex45.c.html>`_
>   ```
>
> Finite Element
> : ```{eval-rst}
>
>   :2D: `SNES example 12 <PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex12.c.html>`_
>   :3D: `SNES example 12 <PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex12.c.html>`_
>   ```

## Elastostatics

The equation for elastostatics balances body forces against stresses in the body

$$
-\nabla\cdot \bm \sigma = \bm f
$$

where $\bm\sigma$ is the stress tensor. Linear, isotropic elasticity governing infinitesimal strains has the particular stress-strain relation

$$
-\nabla\cdot \left( \lambda I \operatorname{trace}(\bm\varepsilon) + 2\mu \bm\varepsilon \right) = \bm f
$$

where the strain tensor $\bm \varepsilon$ is given by

$$
\bm \varepsilon = \frac{1}{2} \left(\nabla \bm u + (\nabla \bm u)^T \right)
$$

where $\bm u$ is the infinitesimal displacement of the body. The resulting discretizations use PETSc's nonlinear solvers

Finite Element
: ```{eval-rst}

  :2D: `SNES example 17 <PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex17.c.html>`_
  :3D: `SNES example 17 <PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex17.c.html>`_
  :3D: `SNES example 56 <PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex56.c.html>`_
  ```

If we allow finite strains in the body, we can express the stress-strain relation in terms of the Jacobian of the deformation gradient

$$
J = \mathrm{det}(F) = \mathrm{det}\left(\nabla u\right)
$$

and the right Cauchy-Green deformation tensor

$$
C = F^T F
$$

so that

$$
\frac{\mu}{2} \left( \mathrm{Tr}(C) - 3 \right) + J p + \frac{\kappa}{2} (J - 1) = 0
$$

In the example everything is expressed in terms of determinants and cofactors of $F$.

> Finite Element
> :

## Stokes

{doc}`physics/guide_to_stokes`

## Euler

Not yet developed

## Heat equation

The time-dependent heat equation

$$
\frac{\partial u}{\partial t} - \Delta u = f
$$

is used to model heat flow, time-dependent diffusion, and other physical processes.

> Finite Element
> : ```{eval-rst}
>
>   :2D: `TS example 45 <PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex45.c.html>`_
>   :3D: `TS example 45 <PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex45.c.html>`_
>   ```

## Navier-Stokes

The time-dependent incompressible Navier-Stokes equations

$$
\begin{aligned}
\frac{\partial u}{\partial t} + u\cdot\nabla u - \nabla \cdot \left(\mu \left(\nabla u + \nabla u^T\right)\right) + \nabla p + f &= 0 \\
\nabla\cdot u &= 0 \end{aligned}
$$

are appropriate for flow of an incompressible fluid at low to moderate Reynolds number.

> Finite Element
> : ```{eval-rst}
>
>   :2D: `TS example 46 <PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex46.c.html>`_
>   :3D: `TS example 46 <PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex46.c.html>`_
>   ```