@@ -16,10 +16,15 @@ The TORAX JAX 1D FVM library is significantly influenced by
1616library API. This section summarizes 1D FVM numerics in general.
1717
1818The 1D spatial domain, :math: `0 \leq \hat {\rho } \leq 1 `, is divided into a
19- uniform grid of :math: `N` cells, each with a width of
20- :math: `d \hat {\rho } = 1 /N`. The cell centers are denoted by
21- :math: `\hat {\rho }_i`, where :math: `0 = 1 , 2 ,..., N-1 `, and the :math: `N+1 ` cell
22- faces are located at :math: `\hat {\rho }_{i\pm1 /2 }`. Both :math: `\hat {\rho }=0 ` and
19+ grid of :math: `N` cells. TORAX supports both uniform grids (configured via
20+ ``n_rho ``) and non-uniform grids (configured via ``face_centers ``). For uniform
21+ grids, each cell has width :math: `d \hat {\rho } = 1 /N`. For non-uniform grids,
22+ cell widths :math: `d \hat {\rho }_i` vary across the domain, enabling finer
23+ resolution in regions of interest such as near the plasma edge.
24+
25+ The cell centers are denoted by :math: `\hat {\rho }_i`, where
26+ :math: `i = 0 , 1 , 2 ,..., N-1 `, and the :math: `N+1 ` cell faces are located at
27+ :math: `\hat {\rho }_{i\pm1 /2 }`. Both :math: `\hat {\rho }=0 ` and
2328:math: `\hat {\rho }=1 ` are on the face grid.
2429
2530For a generic conservation law of the form:
@@ -37,12 +42,14 @@ of finite differences:
3742
3843.. math ::
3944
40- \frac {\partial }{\partial t}(x_i) + \frac {1 }{d \hat {\rho }}({\Gamma }_{i+1 /2 }
45+ \frac {\partial }{\partial t}(x_i) + \frac {1 }{d \hat {\rho }_i }({\Gamma }_{i+1 /2 }
4146 - {\Gamma }_{i-1 /2 }) = S_i
4247
4348 where: :math: `x_i` is the cell-averaged value of :math: `x` in cell :math: `i`,
44- :math: `\Gamma _{i+1 /2 }` is the flux at face :math: `i+1 /2 `, and :math: `S_i` is the
45- cell-averaged source term in cell :math: `i`.
49+ :math: `\Gamma _{i+1 /2 }` is the flux at face :math: `i+1 /2 `, :math: `S_i` is the
50+ cell-averaged source term in cell :math: `i`, and :math: `d \hat {\rho }_i` is the
51+ width of cell :math: `i` (which may vary for non-uniform grids).
52+
4653
4754In general, the fluxes in TORAX are decomposed as
4855
@@ -55,9 +62,9 @@ convection coefficient, leading to:
5562.. math ::
5663
5764 \begin {aligned}
58- \Gamma _{i+1 /2 } &= -D_{i+1 /2 }\frac {x_{i+1 } - x_{i}}{d \hat {\rho }} +
65+ \Gamma _{i+1 /2 } &= -D_{i+1 /2 }\frac {x_{i+1 } - x_{i}}{\hat {\rho }_{i+ 1 } - \hat { \rho }_{i }} +
5966 V_{i+1 /2 }x_{i+1 /2 } \\
60- \Gamma _{i-1 /2 } &= -D_{i-1 /2 }\frac {x_{i} - x_{i-1 }}{d \hat {\rho }} +
67+ \Gamma _{i-1 /2 } &= -D_{i-1 /2 }\frac {x_{i} - x_{i-1 }}{\hat {\rho }_{i} - \hat { \rho }_{i- 1 }} +
6168 V_{i-1 /2 }x_{i-1 /2 }
6269 \end {aligned}
6370
@@ -78,9 +85,11 @@ defined as:
7885
7986.. math ::
8087
81- Pe = \frac {V d \hat {\rho }}{D}
88+ Pe = \frac {V d \hat {\rho }_i }{D}
8289
83- where :math: `V` is convection and :math: `D` is diffusion. The power-law scheme
90+ where :math: `V` is convection, :math: `D` is diffusion, and
91+ :math: `d \hat {\rho }_i` is the local cell width (which varies for non-uniform
92+ grids). The power-law scheme
8493is as follows:
8594
8695.. math ::
@@ -327,9 +336,10 @@ as follows.
327336
328337 .. math ::
329338
330- \Delta t_{ \mathrm {base}}=\frac {(d\hat {\rho })^2 }{2 \chi _{\max }}
339+ \Delta t_{ \mathrm {base}}=\frac {(d\hat {\rho }_{ \min } )^2 }{2 \chi _{\max }}
331340
332- where
341+ where :math: `d \hat {\rho }_{\min }` is the minimum cell width (for non-uniform
342+ grids, this is the smallest cell; for uniform grids, all cells are equal), and
333343 :math: `\Delta t = c_{ \mathrm {mult}}^{dt} \Delta t_{ \mathrm {base}}`.
334344
335345 :math: `c_{ \mathrm {mult}}^{dt}` is a user-configurable prefactor.
0 commit comments