Skip to content

Commit 4b33052

Browse files
chrissy-s96christinaschwarzmknaranja
authored
7 - added infos about parameters in constants.h (#28)
* added infos about parameters --------- Co-authored-by: Christina Schwarz <christina.schwarz@fau.de> Co-authored-by: Martin J. Kühn <62713180+mknaranja@users.noreply.github.com>
1 parent a9300f7 commit 4b33052

1 file changed

Lines changed: 49 additions & 21 deletions

File tree

include/constants.h

Lines changed: 49 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ enum icontrols
3939
{
4040
/*! \brief (WIP) Optimized code
4141
*
42-
* 0: old working version
43-
* 1: new version (WIP)
42+
* 0: old version (non-optimized version for validation in the beginning, not maintained for some time; do not use)
43+
* 1: new version (default)
4444
*/
4545
optimized,
4646
/*! \brief Verbose level
@@ -71,41 +71,63 @@ enum icontrols
7171
* Defines the number of nodes in each direction:
7272
* - nr = 2^(nr_exp-1)
7373
* - ntheta = 2^(ceil(log2(nr))-1)
74+
*
75+
* More detailed:
76+
*
77+
* First, the number of nodes in r-direction is computed as follows:
78+
* without any ansisotropy (fac_ani=0), we have nr=2^(nr_exp - 1) equally distributed nodes;
79+
* with anisotropy: we fisrt create nr=2^(nr_exp) - 1^(fac_ani) equally distributed nodes, and then, the grid is refined fac_ani-times;
80+
* Lastly, regardless of using any anisotropy or not, we refine again by splitting all intervals at the midpoint
81+
* (to obtain a uniform grid refinement between the two finest levels for a successful extrapolation).
82+
*
83+
* Second, the number of nodes in theta-direction is computed as follows:
84+
* ntheta= 2^(ceil(log_2(nr)))
85+
*
7486
*/
7587
nr_exp,
88+
/*! \brief The parameter ntheta_exp is not used in our simulations. We generally define the number of theta intervals similar to the number of intervals in r.
89+
*/
7690
ntheta_exp,
7791
/*! \brief Anisotropic discretization in 'edge' region for r
7892
*
79-
* Defines if we use anisotropic discretization
80-
* - r (fac_ani): in 'edge' region
81-
* - theta (theta_aniso)
93+
* Defines if we use anisotropic discretization in r-direction
8294
*
8395
* Possible values are:
8496
* - -1: input list of r and theta coordinates
8597
* - 0: no anisotropy
86-
* - >0: anisotropy (automatic)
98+
* - >0: anisotropy (automatic) (number of refinements)
99+
*
87100
*/
88101
fac_ani,
102+
/*! \brief Not used
103+
* (we never have an ansisotropy in theta-direction, so the value is always 0/false)
104+
*/
89105
theta_aniso,
90106
/*! \brief Smoothing steps
91107
*
92-
* Number of pre- and post-smoothing steps
108+
* Number of pre- (v1) and post- (v2) -smoothing steps
93109
*/
94110
v1,
95111
v2,
96112
/*! \brief Type of MG cycle
97113
*
98114
* Type of multigrid cycle:
99-
* - 1: V-cycle
115+
* - 1: V-cycle (default setting)
100116
* - 2: W-cycle
101117
*/
102118
cycle,
103-
/*! \brief Circular or stretched geometry
119+
/*! \brief Defines the form of the considered cross-section: Circular or stretched geometry. If `mod_pk=0`, we consider a circular geometry. If `mod_pk>1`, it always goes with a particular choice of `kappa_eps` and `delta_e` to describe realistic Tokamak cross sections.
120+
121+
For more details, we refer to:
122+
- Bouzat, N., Bressan, C., Grandgirard, V., Latu, G., Mehrenberger, M.: Targeting Realistic Geometry in Tokamak Code Gysela. (2018)
123+
- Zoni, E., Güçlü, Y.: Solving hyperbolic-elliptic problems on singular mapped disk-like
124+
domains with the method of characteristics and spline finite elements. (2019)
125+
- Bourne et al.: Solver comparison for Poisson-like equations on tokamak geometries. (2023)
104126
*
105127
* Defines the shape of the geometry:
106128
* - 0: kappa_eps = delta_e = 0 (circular geometry)
107-
* - 1: kappa_eps=0.3, delta_e=0.2 (stretched)
108-
* - 2: kappa_eps=0.3, delta_e=1.4 (stretched)
129+
* - 1: kappa_eps=0.3, delta_e=0.2 (stretched and deformed circle, also denoted Shafranov geometry)
130+
* - 2: kappa_eps=0.3, delta_e=1.4 (stretched and deformed circle, also denoted Czarny geometry)
109131
*/
110132
mod_pk,
111133
/*! \brief Compute rho
@@ -153,8 +175,8 @@ enum icontrols
153175
* - 0: PointRB (not implemented)
154176
* - 1: CircZGS (not implemented)
155177
* - 2: RadZGS (not implemented)
156-
* - 3: AltZGS
157-
* - 13: AltZGS corrected (C-R: BJ, W-B: GS)
178+
* - 3: AltZGS (coupled circle-radial version) (default setting)
179+
* - 13: Decoupled AltZGS (C-R: BJ, W-B: GS) (faster to execute but leads to more iterations)
158180
* - 4: optimizedAltZGS (not implemented)
159181
* - 5: MixZGS (not implemented)
160182
*/
@@ -174,8 +196,8 @@ enum icontrols
174196
/*! \brief Extrapolation
175197
*
176198
* 0: no extrapolation
177-
* 1: extrapolation + smoothing
178-
* 2: extrapolation only
199+
* 1: implicit extrapolation with adapted smoothing on finest grid (default setting)
200+
* 2: experimental version of implicit extrapolation with full grid smoothing (residual stopping criterion not functional, use with care)
179201
* 3: extrap_integer (FE only)
180202
* 4: no_extrap_integr (FE only)
181203
*/
@@ -194,6 +216,7 @@ enum icontrols
194216
/*! \brief Divide the intervals of the grid by 2^(divideBy2)
195217
*
196218
* Divides the intervals of the grid by 2^(divideBy2)
219+
* (defines how often to split the intervals of the grid at the midpoint)
197220
*/
198221
divideBy2,
199222
/*! \brief Problem to solve
@@ -244,7 +267,7 @@ enum dcontrols
244267
{
245268
/*! \brief Radius of the disk
246269
*
247-
* Interior and exterior radius of the disk-like shape
270+
* Interior (R0) and exterior (R) radius of the disk-like shape
248271
*/
249272
r0_DB,
250273
R0,
@@ -258,12 +281,17 @@ enum dcontrols
258281
/*! \brief Parameters of the grid
259282
*
260283
* Defines the shape of the geometry:
261-
* - mod_pk = kappa_eps = delta_e = 0: circular geometry [x=r.cos(theta), y=r.sin(theta)]
262-
* - else: stretched circular geometry
263-
* [x=(1-kappa_eps)r.cos(theta)-delta_e.r^2, y=(1+kappa_eps)r.sin(theta)] with
264-
* - kappa_eps: Elongation
284+
* - if mod_pk = 0: circular geometry
285+
* [x=r.cos(theta), y=r.sin(theta)]
286+
* - elif mod_pk=1: stretched circular geometry (Shafranov geometry)
287+
* [x=(1-kappa_eps)r*cos(theta)-delta_e*r^2, y=(1+kappa_eps)r*sin(theta)]
288+
* - elif mod_pk=2: stretched circular geometry (Czarny geometry)
289+
* [x=1/kappa_eps ( 1 - sqrt{1 + kappa_eps ( kappa_eps + 2r*cos(theta) )} ), y=y_0 + (delta_e \xi r sin(theta)) / (1 + kappa_eps x(r, theta))]
290+
* [For more details, we refer to Bourne et al. (2023).]
291+
* with
292+
* - kappa_eps: Elongation (For the Shafranov geometry, the parameter is denoted kappa, for the Czarny geometry, it is epsilon.
265293
* - delta_e: Shafranov shift (outward radial
266-
* displacement of the centre of flux)
294+
* displacement of the centre of flux) (For the Shafranov geometry, this parameter is denoted delta, for the Czarny geometry, it is e.)
267295
*/
268296
kappa_eps,
269297
delta_e,

0 commit comments

Comments
 (0)