Extension: Geometries
#include "dg/geometries/geometries.h"
Collaboration diagram for Wall and Sheath:

Functions

static TokamakMagneticField dg::geo::createModifiedField (dg::file::WrappedJsonValue gs, dg::file::WrappedJsonValue jsmod, CylindricalFunctor &wall, CylindricalFunctor &transition)
 Modify Magnetic Field and create wall above or below certain Psi values according to given parameters. More...
 
static CylindricalFunctor dg::geo::createWallRegion (dg::file::WrappedJsonValue gs, dg::file::WrappedJsonValue jsmod)
 A convenience function call for dg::geo::createModifiedField that ignores the transition parameter and returns the wall. More...
 
static void dg::geo::createSheathRegion (dg::file::WrappedJsonValue jsmod, TokamakMagneticField mag, CylindricalFunctor wall, dg::Grid2d &sheath_walls, CylindricalFunctor &sheath)
 Create the sheath region where fieldlines intersect the boundary. More...
 

Detailed Description

Function Documentation

◆ createModifiedField()

static TokamakMagneticField dg::geo::createModifiedField ( dg::file::WrappedJsonValue  gs,
dg::file::WrappedJsonValue  jsmod,
CylindricalFunctor wall,
CylindricalFunctor transition 
)
inlinestatic

Modify Magnetic Field and create wall above or below certain Psi values according to given parameters.

We modify psi above or below certain Psip values to a constant using the dg::IPolynomialHeaviside function (an approximation to the integrated Heaviside function with width alpha), i.e. we replace psi with IPolynomialHeaviside(psi). This subsequently modifies all derivatives of psi and the poloidal current in this region.

Furthermore, the same parameters define the wall region.

{
"type": "none"
}
{
"type": "heaviside",
"boundary": 1.1,
"alpha": 0.20
}
{
"type": "sol_pfr",
"boundary": [1.1,0.998],
// First value indicates SOL, second the PFR
"alpha": [0.10,0.10]
}
See also
dg::geo::modification for possible values of "type" parameter
Parameters
gsforwarded to dg::geo::createMagneticField
jsmodcontains the fields described above to steer the creation of the modification and wall region
wall(out) On output contains the region where the wall is applied, the functor returns 1 where the wall is, 0 where there it is not and 0<f<1 in the transition region
transition(out) On output contains the region where the transition of Psip to a constant value occurs, the functor returns 0<f<=1 for when there is a transition and 0 else
Returns
A magnetic field object
Attention
This function is only defined if json/json.h is included before dg/geometries/geometries.h

◆ createSheathRegion()

static void dg::geo::createSheathRegion ( dg::file::WrappedJsonValue  jsmod,
TokamakMagneticField  mag,
CylindricalFunctor  wall,
dg::Grid2d sheath_walls,
CylindricalFunctor sheath 
)
inlinestatic

Create the sheath region where fieldlines intersect the boundary.

The sheath functor that comes out of this does (i) on each of the four lines defined by the two vertical (R0, R1) and two horizontal (Z0, Z1) boundaries check if the "wall" functor is zero anywhere on the line: if not then move this boundary far away (ii) Measure the angular distance along the fieldline (both in positive and negative direction) to the remaining walls using dg::geo::WallFieldlineDistance (in "phi" mode) (iii) Modify the angular distances with a dg::PolynomialHeaviside functor with parameters given in jsmod:

{
"boundary" : 0.0625, // value where sheath region begins in units of 2Pi
"alpha" : 0.015625 // diameter of the transition region in units of 2Pi
}

(iv) The sheath region is the SetUnion of positive and negative functor, together with the SetIntersection with the SetNot(wall) region.

Parameters
jsmodmust contain fields as described above
mag(in) the (unmodified) magnetic field, used to integrate the field towards or away from the sheath
wall(in) the penalization region that represents the actual (perpendicular) wall without the divertor (if 0 on the boundary the boundary will be considered to be a sheath, else the boundary will be ignored)
sheath_walls(inout) on input contains the box boundaries, on output the non-sheath boundaries are moved far away
sheath(out) contains the region recognized as sheath (returning +1 within the sheath and 0 outside of it and something in-between in the transition region)

◆ createWallRegion()

static CylindricalFunctor dg::geo::createWallRegion ( dg::file::WrappedJsonValue  gs,
dg::file::WrappedJsonValue  jsmod 
)
inlinestatic

A convenience function call for dg::geo::createModifiedField that ignores the transition parameter and returns the wall.