Skip to content

Commit 851b8b8

Browse files
committed
better formatting for parameters
1 parent b1efd4e commit 851b8b8

18 files changed

Lines changed: 520 additions & 530 deletions

docs/source/_defaults.inc

Lines changed: 70 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,80 @@
1+
* section: [driver]
12

2-
**driver**
3+
+----------------------------------+----------------+----------------------------------------------------+
4+
| option | value | description |
5+
+==================================+================+====================================================+
6+
| tmax | ``1.0`` | maximum simulation time to evolve |
7+
+----------------------------------+----------------+----------------------------------------------------+
8+
| max_steps | ``10000`` | maximum number of steps to take |
9+
+----------------------------------+----------------+----------------------------------------------------+
10+
| fix_dt | ``-1.0`` | |
11+
+----------------------------------+----------------+----------------------------------------------------+
12+
| init_tstep_factor | ``0.01`` | first timestep = init_tstep_factor * CFL timestep |
13+
+----------------------------------+----------------+----------------------------------------------------+
14+
| max_dt_change | ``2.0`` | max amount the timestep can change between steps |
15+
+----------------------------------+----------------+----------------------------------------------------+
16+
| verbose | ``1.0`` | verbosity |
17+
+----------------------------------+----------------+----------------------------------------------------+
318

4-
+----------------------------------+------------+----------------------------------------------------+
5-
| option | value | description |
6-
+==================================+============+====================================================+
7-
| tmax | 1.0 | maximum simulation time to evolve |
8-
+----------------------------------+------------+----------------------------------------------------+
9-
| max_steps | 10000 | maximum number of steps to take |
10-
+----------------------------------+------------+----------------------------------------------------+
11-
| fix_dt | -1.0 | |
12-
+----------------------------------+------------+----------------------------------------------------+
13-
| init_tstep_factor | 0.01 | first timestep = init_tstep_factor * CFL timestep |
14-
+----------------------------------+------------+----------------------------------------------------+
15-
| max_dt_change | 2.0 | max amount the timestep can change between steps |
16-
+----------------------------------+------------+----------------------------------------------------+
17-
| verbose | 1.0 | verbosity |
18-
+----------------------------------+------------+----------------------------------------------------+
19+
* section: [io]
1920

20-
**io**
21+
+----------------------------------+----------------+----------------------------------------------------+
22+
| option | value | description |
23+
+==================================+================+====================================================+
24+
| basename | ``pyro_`` | basename for output files |
25+
+----------------------------------+----------------+----------------------------------------------------+
26+
| dt_out | ``0.1`` | simulation time between writing output files |
27+
+----------------------------------+----------------+----------------------------------------------------+
28+
| n_out | ``10000`` | number of timesteps between writing output files |
29+
+----------------------------------+----------------+----------------------------------------------------+
30+
| do_io | ``1`` | do we output at all? |
31+
+----------------------------------+----------------+----------------------------------------------------+
2132

22-
+----------------------------------+------------+----------------------------------------------------+
23-
| option | value | description |
24-
+==================================+============+====================================================+
25-
| basename | pyro_ | basename for output files |
26-
+----------------------------------+------------+----------------------------------------------------+
27-
| dt_out | 0.1 | simulation time between writing output files |
28-
+----------------------------------+------------+----------------------------------------------------+
29-
| n_out | 10000 | number of timesteps between writing output files |
30-
+----------------------------------+------------+----------------------------------------------------+
31-
| do_io | 1 | do we output at all? |
32-
+----------------------------------+------------+----------------------------------------------------+
33+
* section: [mesh]
3334

34-
**mesh**
35+
+----------------------------------+----------------+----------------------------------------------------+
36+
| option | value | description |
37+
+==================================+================+====================================================+
38+
| xmin | ``0.0`` | domain minumum x-coordinate |
39+
+----------------------------------+----------------+----------------------------------------------------+
40+
| xmax | ``1.0`` | domain maximum x-coordinate |
41+
+----------------------------------+----------------+----------------------------------------------------+
42+
| ymin | ``0.0`` | domain minimum y-coordinate |
43+
+----------------------------------+----------------+----------------------------------------------------+
44+
| ymax | ``1.0`` | domain maximum y-coordinate |
45+
+----------------------------------+----------------+----------------------------------------------------+
46+
| xlboundary | ``reflect`` | minimum x BC ('reflect', 'outflow', or 'periodic') |
47+
+----------------------------------+----------------+----------------------------------------------------+
48+
| xrboundary | ``reflect`` | maximum x BC ('reflect', 'outflow', or 'periodic') |
49+
+----------------------------------+----------------+----------------------------------------------------+
50+
| ylboundary | ``reflect`` | minimum y BC ('reflect', 'outflow', or 'periodic') |
51+
+----------------------------------+----------------+----------------------------------------------------+
52+
| yrboundary | ``reflect`` | maximum y BC ('reflect', 'outflow', or 'periodic') |
53+
+----------------------------------+----------------+----------------------------------------------------+
54+
| nx | ``25`` | number of zones in the x-direction |
55+
+----------------------------------+----------------+----------------------------------------------------+
56+
| ny | ``25`` | number of zones in the y-direction |
57+
+----------------------------------+----------------+----------------------------------------------------+
3558

36-
+----------------------------------+------------+----------------------------------------------------+
37-
| option | value | description |
38-
+==================================+============+====================================================+
39-
| xmin | 0.0 | domain minumum x-coordinate |
40-
+----------------------------------+------------+----------------------------------------------------+
41-
| xmax | 1.0 | domain maximum x-coordinate |
42-
+----------------------------------+------------+----------------------------------------------------+
43-
| ymin | 0.0 | domain minimum y-coordinate |
44-
+----------------------------------+------------+----------------------------------------------------+
45-
| ymax | 1.0 | domain maximum y-coordinate |
46-
+----------------------------------+------------+----------------------------------------------------+
47-
| xlboundary | reflect | minimum x BC ('reflect', 'outflow', or 'periodic') |
48-
+----------------------------------+------------+----------------------------------------------------+
49-
| xrboundary | reflect | maximum x BC ('reflect', 'outflow', or 'periodic') |
50-
+----------------------------------+------------+----------------------------------------------------+
51-
| ylboundary | reflect | minimum y BC ('reflect', 'outflow', or 'periodic') |
52-
+----------------------------------+------------+----------------------------------------------------+
53-
| yrboundary | reflect | maximum y BC ('reflect', 'outflow', or 'periodic') |
54-
+----------------------------------+------------+----------------------------------------------------+
55-
| nx | 25 | number of zones in the x-direction |
56-
+----------------------------------+------------+----------------------------------------------------+
57-
| ny | 25 | number of zones in the y-direction |
58-
+----------------------------------+------------+----------------------------------------------------+
59+
* section: [particles]
5960

60-
**particles**
61+
+----------------------------------+----------------+----------------------------------------------------+
62+
| option | value | description |
63+
+==================================+================+====================================================+
64+
| do_particles | ``0`` | include particles? (1=yes, 0=no) |
65+
+----------------------------------+----------------+----------------------------------------------------+
66+
| n_particles | ``100`` | number of particles |
67+
+----------------------------------+----------------+----------------------------------------------------+
68+
| particle_generator | ``random`` | how do we generate particles? (random, grid) |
69+
+----------------------------------+----------------+----------------------------------------------------+
6170

62-
+----------------------------------+------------+----------------------------------------------------+
63-
| option | value | description |
64-
+==================================+============+====================================================+
65-
| do_particles | 0 | include particles? (1=yes, 0=no) |
66-
+----------------------------------+------------+----------------------------------------------------+
67-
| n_particles | 100 | number of particles |
68-
+----------------------------------+------------+----------------------------------------------------+
69-
| particle_generator | random | how do we generate particles? (random, grid) |
70-
+----------------------------------+------------+----------------------------------------------------+
71+
* section: [vis]
7172

72-
**vis**
73+
+----------------------------------+----------------+----------------------------------------------------+
74+
| option | value | description |
75+
+==================================+================+====================================================+
76+
| dovis | ``1`` | runtime visualization? (1=yes, 0=no) |
77+
+----------------------------------+----------------+----------------------------------------------------+
78+
| store_images | ``0`` | store vis images to files (1=yes, 0=no) |
79+
+----------------------------------+----------------+----------------------------------------------------+
7380

74-
+----------------------------------+------------+----------------------------------------------------+
75-
| option | value | description |
76-
+==================================+============+====================================================+
77-
| dovis | 1 | runtime visualization? (1=yes, 0=no) |
78-
+----------------------------------+------------+----------------------------------------------------+
79-
| store_images | 0 | store vis images to files (1=yes, 0=no) |
80-
+----------------------------------+------------+----------------------------------------------------+

docs/source/advection_basics.rst

Lines changed: 71 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,46 +10,86 @@ provides a good basis for understanding the methods used for
1010
compressible hydrodynamics. Chapter 4 of the notes summarizes the
1111
numerical methods for advection that we implement in pyro.
1212

13-
pyro has several solvers for linear advection:
13+
pyro has several solvers for linear advection, which solve the equation
14+
with different spatial and temporal intergration schemes.
1415

15-
* :py:mod:`advection` implements the directionally unsplit corner transport upwind
16-
algorithm with piecewise linear reconstruction
16+
``advection`` solver
17+
--------------------
1718

18-
* :py:mod:`advection_fv4` uses a fourth-order accurate finite-volume
19-
method with RK4 time integration
19+
:py:mod:`advection` implements the directionally unsplit corner
20+
transport upwind algorithm :cite:`colella:1990` with piecewise linear reconstruction.
21+
This is an overall second-order accurate method, with timesteps restricted
22+
by
2023

21-
* :py:mod:`advection_nonuniform` models advection with a non-uniform velocity field.
22-
This is used to implement
23-
`Zalesak (1979) <https://doi.org/10.1016/0021-9991(79)90051-2>`_'s slotted disk problem.
24+
.. math::
25+
26+
\Delta t < \min \left \{ \frac{\Delta x}{|u|}, \frac{\Delta y}{|v|} \right \}
27+
28+
The parameters for this solver are:
29+
30+
.. include:: advection_defaults.inc
31+
32+
33+
``advection_fv4`` solver
34+
------------------------
35+
36+
:py:mod:`advection_fv4` uses a fourth-order accurate finite-volume
37+
method with RK4 time integration, following the ideas in
38+
:cite:`mccorquodalecolella`. It can be thought of as a
39+
method-of-lines integration, and as such has a slightly more restrictive
40+
timestep:
41+
42+
.. math::
43+
44+
\Delta t \lesssim \left [ \frac{|u|}{\Delta x} + \frac{|v|}{\Delta y} \right ]^{-1}
45+
46+
The main complexity comes from needing to average the flux over the
47+
faces of the zones to achieve 4th order accuracy spatially.
48+
49+
The parameters for this solver are:
50+
51+
.. include:: advection_fv4_defaults.inc
2452

25-
* :py:mod:`advection_rk` uses a method of lines time-integration
26-
approach with piecewise linear spatial reconstruction for linear
27-
advection
53+
``advection_nonuniform`` solver
54+
-------------------------------
2855

29-
* :py:mod:`advection_weno` uses a WENO reconstruction and method of
30-
lines time-integration
56+
:py:mod:`advection_nonuniform` models advection with a non-uniform
57+
velocity field. This is used to implement the slotted disk problem
58+
from :cite:`ZALESAK1979335`. The basic method is similar to the
59+
algorithm used by the main ``advection`` solver.
60+
61+
The paramters for this solver are:
62+
63+
.. include:: advection_nonuniform_defaults.inc
64+
65+
``advection_rk`` solver
66+
-----------------------
67+
68+
:py:mod:`advection_rk` uses a method of lines time-integration
69+
approach with piecewise linear spatial reconstruction for linear
70+
advection. This is overall second-order accurate, so it represents a
71+
simpler algorithm than the ``advection_fv4`` method (in particular, we
72+
can treat cell-centers and cell-averages as the same, to second
73+
order).
74+
75+
The parameter for this solver are:
76+
77+
.. include:: advection_rk_defaults.inc
78+
79+
``advection_weno`` solver
80+
-------------------------
81+
82+
:py:mod:`advection_weno` uses a WENO reconstruction and method of
83+
lines time-integration
3184

3285

3386
The main parameters that affect this solver are:
3487

35-
+-------------------------------------------------------------------------------------------------------------------------------+
36-
| ``[driver]`` |
37-
+=====================+=========================================================================================================+
38-
|``cfl`` | the advective CFL number (what fraction of a zone can we cross in a single timestep) |
39-
+---------------------+---------------------------------------------------------------------------------------------------------+
40-
41-
+-------------------------------------------------------------------------------------------------------------------------------+
42-
| ``[advection]`` |
43-
+=====================+=========================================================================================================+
44-
|``u`` | the advective velocity in the x direction |
45-
+---------------------+---------------------------------------------------------------------------------------------------------+
46-
|``v`` | the advective velocity in the y direction |
47-
+---------------------+---------------------------------------------------------------------------------------------------------+
48-
|``limiter`` | what type of limiting to use in reconstructing the slopes. 0 means use an unlimited second-order |
49-
| | centered difference. 1 is the MC limiter, and 2 is the 4th-order MC limiter |
50-
+---------------------+---------------------------------------------------------------------------------------------------------+
51-
|``temporal_method`` | the MOL integration method to use (RK2, TVD2, TVD3, RK4) (advection_rk only) |
52-
+---------------------+---------------------------------------------------------------------------------------------------------+
88+
.. include:: advection_weno_defaults.inc
89+
90+
91+
General ideas
92+
-------------
5393

5494
The main use for the advection solver is to understand how Godunov
5595
techniques work for hyperbolic problems. These same ideas will be used

0 commit comments

Comments
 (0)