|
1 | 1 | #!/usr/bin/env python3 |
2 | 2 |
|
3 | | -# test of a cell-centered, centered-difference approximate projection. |
4 | | -# |
5 | | -# initialize the velocity field to be divergence free and then add to |
6 | | -# it the gradient of a scalar (whose normal component vanishes on the |
7 | | -# boundaries). The projection should recover the original divergence- |
8 | | -# free velocity field. |
9 | | -# |
10 | | -# The test velocity field comes from Almgen, Bell, and Szymczak 1996. |
11 | | -# |
12 | | -# This makes use of the multigrid solver with periodic boundary conditions. |
13 | | -# |
14 | | -# One of the things that this test demonstrates is that the initial |
15 | | -# projection may not be able to completely remove the divergence free |
16 | | -# part, so subsequent projections may be necessary. In this example, |
17 | | -# we add a very strong gradient component. |
18 | | -# |
19 | | -# The total number of projections to perform is given by nproj. Each |
20 | | -# projection uses the divergence of the velocity field from the previous |
21 | | -# iteration as its source term. |
| 3 | +"""test of a cell-centered, centered-difference approximate projection. |
| 4 | +
|
| 5 | +initialize the velocity field to be divergence free and then add to it |
| 6 | +the gradient of a scalar (whose normal component vanishes on the |
| 7 | +boundaries). The projection should recover the original divergence- |
| 8 | +free velocity field. |
| 9 | +
|
| 10 | +The test velocity field comes from Almgen, Bell, and Szymczak 1996. |
| 11 | +
|
| 12 | +This makes use of the multigrid solver with periodic boundary conditions. |
| 13 | +
|
| 14 | +One of the things that this test demonstrates is that the initial |
| 15 | +projection may not be able to completely remove the divergence free |
| 16 | +part, so subsequent projections may be necessary. In this example, we |
| 17 | +add a very strong gradient component. |
| 18 | +
|
| 19 | +The total number of projections to perform is given by nproj. Each |
| 20 | +projection uses the divergence of the velocity field from the previous |
| 21 | +iteration as its source term. |
| 22 | +
|
| 23 | +Note: the output file created stores the original field, the poluted |
| 24 | +field, and the recovered field. |
| 25 | +""" |
22 | 26 |
|
23 | 27 | import numpy as np |
24 | 28 |
|
25 | 29 | import multigrid.MG as MG |
26 | 30 | import mesh.boundary as bnd |
27 | 31 | import mesh.patch as patch |
28 | 32 |
|
29 | | - |
30 | 33 | def doit(nx, ny): |
| 34 | + """manage the entire projection""" |
31 | 35 |
|
32 | 36 | nproj = 2 |
33 | 37 |
|
|
0 commit comments