Skip to content

Commit a8fe009

Browse files
committed
Modified the docs with a new order for topology plots and fixed previous diagrams not showing.
1 parent 8371eaa commit a8fe009

3 files changed

Lines changed: 85 additions & 55 deletions

File tree

manual/sphinx/user_docs/input_grids.rst

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,43 @@ The directory ``tokamak_grids`` contains code to generate input grid
162162
files for tokamaks. These can be used by, for example, the ``2fluid`` and
163163
``highbeta_reduced`` modules.
164164

165+
166+
3D Variables
167+
------------
168+
169+
BOUT++ was originally designed for tokamak simulations where the input
170+
equilibrium varies only in X-Y, and Z is used as the axisymmetric toroidal
171+
angle direction. In those cases, it is often convenient to have input grids
172+
which are only 2D, and allow the Z dimension to be specified independently,
173+
such as in the options file. The problem then is how to store 3D variables in
174+
the grid file?
175+
176+
Two representations are now supported for 3D variables:
177+
178+
#. Real space, as values on grid points. If ``nz`` is set in the grid file,
179+
then 3D variables in the grid file must have size ``nx``\
180+
:math:`\times`\ ``ny``\ :math:`\times`\ ``nz``. These are then read in
181+
directly into `Field3D` variables as required.
182+
183+
#. A Fourier representation. If the size of the toroidal domain is not
184+
specified in the grid file (``nz`` is not defined), then 3D fields are
185+
stored as Fourier components. In the Z dimension the coefficients must be
186+
stored as
187+
188+
.. math::
189+
190+
[n = 0, n = 1 (\textrm{real}), n = 1 (\textrm{imag}), n = 2
191+
(\textrm{real}), n = 2 (\textrm{imag}), \ldots ]
192+
193+
where :math:`n` is the toroidal mode number. The size of the array must
194+
therefore be odd in the Z dimension, to contain a constant (:math:`n=0`)
195+
component followed by real/imaginary pairs for the non-axisymmetric
196+
components.
197+
198+
If you are using IDL to create a grid file, there is a routine in
199+
``tools/idllib/bout3dvar.pro`` for converting between BOUT++'s real and
200+
Fourier representation.
201+
165202
From EFIT files
166203
---------------
167204

manual/sphinx/user_docs/supported_topologies.rst

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ The regions that form the building blocks of this topology are:
4343
- 2 "leg" regions which have a boundary in the ``y`` direction;
4444
- 1 "core" region which does not have boundaries in ``y``.
4545

46-
.. figure:: ../figs/Topologies/SN/SN_regions.*
47-
:alt: The regions of a single null configuration.
48-
49-
Single null configuration regions defined by the branch cuts in :math:`y`.
50-
5146
.. figure:: ../figs/Topologies/SN/SN_processors.*
5247
:alt: The processor layout of a single null configuration.
5348

5449
Division of Single Null configuration into processor layout in index space to compare with the INGRID geometry diagram.
50+
51+
.. figure:: ../figs/Topologies/SN/SN_regions.*
52+
:alt: The regions of a single null configuration.
53+
54+
Single null configuration regions defined by the branch cuts in :math:`y`.
5555

5656

5757
Even though BOUT++ does not requiere each region to be divided into more processors, using an INGRID grid enables this division and makes it easier to understand the topology.
@@ -75,16 +75,16 @@ maintain experimentally for a long period of time.
7575

7676
Connected double null geometry on the RZ plane generated by INGRID.
7777

78-
.. figure:: ../figs/Topologies/CDN/CDN_regions.*
79-
:alt: The regions of a connected double null configuration.
80-
81-
Connected double null configuration regions defined by the branch cuts in :math:`y`.
82-
8378
.. figure:: ../figs/Topologies/CDN/CDN_processors.*
8479
:alt: The processor layout of a connected double null configuration.
8580

8681
Division of Connected Double Null configuration into processor layout in index space to compare with the INGRID geometry diagram.
8782

83+
.. figure:: ../figs/Topologies/CDN/CDN_regions.*
84+
:alt: The regions of a connected double null configuration.
85+
86+
Connected double null configuration regions defined by the branch cuts in :math:`y`.
87+
8888
.. figure:: ../figs/Topologies/CDN/CDN_topology.*
8989
:alt: The topology of a connected double null configuration.
9090

@@ -105,16 +105,17 @@ configurations.
105105

106106
Unconnected double null geometry on the RZ plane generated by INGRID.
107107

108-
.. figure:: ../figs/Topologies/UDN/UDN_regions.*
109-
:alt: The regions of an unconnected double null configuration.
110-
111-
Unconnected double null configuration regions defined by the branch cuts in :math:`y`.
112108

113109
.. figure:: ../figs/Topologies/UDN/UDN_processors.*
114110
:alt: The processor layout of an unconnected double null configuration.
115111

116112
Division of Unconnected Double Null configuration into processor layout in index space to compare with the INGRID geometry diagram.
117113

114+
.. figure:: ../figs/Topologies/UDN/UDN_regions.*
115+
:alt: The regions of an unconnected double null configuration.
116+
117+
Unconnected double null configuration regions defined by the branch cuts in :math:`y`.
118+
118119
.. figure:: ../figs/Topologies/UDN/UDN_topology.*
119120
:alt: The topology of an unconnected double null configuration.
120121

@@ -186,16 +187,16 @@ the same. The regions that form the building blocks of these topologies are:
186187
- 5 "leg" regions which have a boundary in the ``y`` direction;
187188
- 1 "core" region which does not have boundaries in ``y``.
188189

189-
.. figure:: ../figs/Topologies/SF/SF_regions.*
190-
:alt: The regions of a snowflake configuration.
191-
192-
Snowflake configuration regions defined by the branch cuts in :math:`y`.
193-
194190
.. figure:: ../figs/Topologies/SF/SF_processors.*
195191
:alt: The processor layout of a snowflake configuration.
196192

197193
Division of Snowflake configuration into processor layout in index space to compare with the INGRID geometry diagram.
198194

195+
.. figure:: ../figs/Topologies/SF/SF_regions.*
196+
:alt: The regions of a snowflake configuration.
197+
198+
Snowflake configuration regions defined by the branch cuts in :math:`y`.
199+
199200
.. figure:: ../figs/Topologies/SF/SF_topology.*
200201
:alt: The topology of a snowflake configuration.
201202

manual/sphinx/user_docs/topology.rst

Lines changed: 28 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,17 @@ PFRs (private flux regions), and the core of the tokamak. If
9595
``jyseps1_2 == jyseps2_1`` then the grid is a **single null** configuration,
9696
otherwise it can be any of the more advanced configurations.
9797

98+
.. _fig-topology-cross-section:
99+
.. figure:: ../figs/topology_cross_section.*
100+
:alt: Cross-section of the tokamak topology used in BOUT++
101+
102+
Deconstruction of a poloidal tokamak cross-section into logical
103+
domains using the parameters ``ixseps1``, ``ixseps2``,
104+
``jyseps1_1``, ``jyseps1_2``, ``jyseps2_1``, and ``jyseps2_2``. This
105+
configuration is a "disconnected double null" and shows all the
106+
possible regions used in the BOUT++ topology.
107+
108+
98109
Advanced
99110
--------
100111

@@ -119,6 +130,12 @@ across the domain boundaries is then handled internally.
119130
To ensure that communications work, branch cuts must align with processor
120131
boundaries.
121132

133+
.. _fig-topology-schematic:
134+
.. figure:: ../figs/topology_schematic.*
135+
136+
Schematic illustration of domain decomposition and communication in
137+
BOUT++ with ``ixseps1 = ixseps2``
138+
122139
These branch cuts are used by the ``getMeshTopology()`` function to determine
123140
which topology is being used. See :ref:`sec-supported-topologies` for a
124141
detailed explanation of the available topologies.
@@ -178,6 +195,17 @@ controlled by the variables
178195
int DDATA_INDEST, DDATA_OUTDEST, DDATA_XSPLIT;
179196
int IDATA_DEST, ODATA_DEST;
180197
198+
These control the behavior of the communications as shown in
199+
:numref:`fig-boutmesh-comms`.
200+
201+
.. _fig-boutmesh-comms:
202+
.. figure:: ../figs/boutmesh-comms.*
203+
:alt: Communication of guard cells in BOUT++
204+
205+
Communication of guard cells in BOUT++. Boundaries in X have only
206+
one neighbour each, but boundaries in Y can be split into two,
207+
allowing branch cuts.
208+
181209
In the Y direction, each boundary region (**U**\ p and **D**\ own in Y) can be
182210
split into two, with ``0 <= x < UDATA_XSPLIT`` going to processor index
183211
``UDATA_INDEST``, and ``UDATA_INDEST <= x < LocalNx`` going to
@@ -194,39 +222,3 @@ To change the topology, the function ``BoutMesh::set_connection`` checks that
194222
the requested branch cut is on a processor boundary, and changes the
195223
communications consistently so that communications are two-way and there are no
196224
"dangling" communications.
197-
198-
3D Variables
199-
------------
200-
201-
BOUT++ was originally designed for tokamak simulations where the input
202-
equilibrium varies only in X-Y, and Z is used as the axisymmetric toroidal
203-
angle direction. In those cases, it is often convenient to have input grids
204-
which are only 2D, and allow the Z dimension to be specified independently,
205-
such as in the options file. The problem then is how to store 3D variables in
206-
the grid file?
207-
208-
Two representations are now supported for 3D variables:
209-
210-
#. A Fourier representation. If the size of the toroidal domain is not
211-
specified in the grid file (``nz`` is not defined), then 3D fields are
212-
stored as Fourier components. In the Z dimension the coefficients must be
213-
stored as
214-
215-
.. math::
216-
217-
[n = 0, n = 1 (\textrm{real}), n = 1 (\textrm{imag}), n = 2
218-
(\textrm{real}), n = 2 (\textrm{imag}), \ldots ]
219-
220-
where :math:`n` is the toroidal mode number. The size of the array must
221-
therefore be odd in the Z dimension, to contain a constant (:math:`n=0`)
222-
component followed by real/imaginary pairs for the non-axisymmetric
223-
components.
224-
225-
If you are using IDL to create a grid file, there is a routine in
226-
``tools/idllib/bout3dvar.pro`` for converting between BOUT++'s real and
227-
Fourier representation.
228-
229-
#. Real space, as values on grid points. If ``nz`` is set in the grid file,
230-
then 3D variables in the grid file must have size ``nx``\
231-
:math:`\times`\ ``ny``\ :math:`\times`\ ``nz``. These are then read in
232-
directly into `Field3D` variables as required.

0 commit comments

Comments
 (0)