Module with subroutines for generating the initial spatial distribution of the different partciles' species in the simulation.
Subrotuine for generating a uniform torus/torus shell as the initial spatial condition of a given species of particles in the simulation.
This distribution is generated using the Inverse Transform Sampling method. This distribution follows the same radial distribution of a uniform disk/ring distribution, see the documentation of the disk subroutine.
Core KORC simulation parameters.
An instance of the derived type SPECIES containing all the parameters and simulation variables of the different species in the simulation.
Radial position of the particles .
Uniform deviates in the range representing the uniform poloidal angle distribution of the particles.
Uniform deviates in the range representing the uniform toroidal angle distribution of the particles.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=rp), | private, | parameter | :: | minmax_buffer_size | = | 10.0_rp |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=rp), | intent(in) | :: | r | |||
real(kind=rp), | intent(in) | :: | a | |||
real(kind=rp), | intent(in) | :: | ko | |||
real(kind=rp), | intent(in) | :: | P |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=rp), | intent(in) | :: | R | R-coordinate of MH sampled location |
||
real(kind=rp), | intent(in) | :: | R0 | R-coordinate of center of 2D Gaussian |
||
real(kind=rp), | intent(in) | :: | sigR | Variance of first dimension of 2D Gaussian |
||
real(kind=rp), | intent(in) | :: | Z | Z-coordinate of MH sampled location |
||
real(kind=rp), | intent(in) | :: | Z0 | Z-coordinate of center of 2D Gaussian |
||
real(kind=rp), | intent(in) | :: | sigZ | Variance of second dimension of 2D Gaussian |
||
real(kind=rp), | intent(in) | :: | theta | Angle of counter-clockwise rotation (in radians), of 2D Gaussian distribution relative to R,Z |
Argument of exponential comprising 2D Gaussian distribution
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=rp), | intent(in) | :: | psi | |||
real(kind=rp), | intent(in) | :: | psi_max |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=rp), | intent(in) | :: | mean | |||
real(kind=rp), | intent(in) | :: | sigma |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=rp), | intent(in) | :: | R0 | |||
real(kind=rp), | intent(in) | :: | b | |||
real(kind=rp), | intent(in) | :: | w | |||
real(kind=rp), | intent(in) | :: | dlam | |||
real(kind=rp), | intent(in) | :: | R | |||
real(kind=rp), | intent(in) | :: | Z | |||
real(kind=rp), | intent(in) | :: | T |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer | :: | Nr_a | ||||
real(kind=rp), | intent(in), | dimension(Nr_a) | :: | r_a | ||
real(kind=rp), | intent(in), | dimension(Nr_a) | :: | nRE | ||
real(kind=rp), | intent(in) | :: | rm |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(SPECIES), | intent(inout) | :: | spp | An instance of the derived type SPECIES containing all the parameters and simulation variables of the different species in the simulation. |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(KORC_PARAMS), | intent(in) | :: | params | Core KORC simulation parameters. |
||
type(SPECIES), | intent(inout) | :: | spp | An instance of the derived type SPECIES containing all the parameters and simulation variables of the different species in the simulation. |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(KORC_PARAMS), | intent(in) | :: | params | |||
type(SPECIES), | intent(inout) | :: | spp |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(KORC_PARAMS), | intent(in) | :: | params | Core KORC simulation parameters. |
||
type(SPECIES), | intent(inout) | :: | spp | An instance of the derived type SPECIES containing all the parameters and simulation variables of the different species in the simulation. |
@brief Subroutine that generates a exponentially decaying radial distribution of particles in a circular cross-section torus of major and minor radi and , respectively. @details We generate this exponentially decaying radial distribution following the same approach as in \ref korc_spatial_distribution.disk, but this time, the radial distribution is given by:
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(KORC_PARAMS), | intent(in) | :: | params | |||
type(SPECIES), | intent(inout) | :: | spp |
@brief Subroutine that generates an exponentially decaying radial distribution in an elliptic torus as the initial spatial condition of a given particle species in the simulation. @details As a first step, we generate an exponentially decaying radial distribution in a circular cross-section torus as in \ref korc_spatial_distribution.exponential_torus. Then we transform this spatial distribution to a one in an torus with an elliptic cross section, this following the same approach as in \ref korc_spatial_distribution.elliptic_torus.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(KORC_PARAMS), | intent(in) | :: | params | |||
type(SPECIES), | intent(inout) | :: | spp |
@brief Subroutine that generates a Gaussian radial distribution in an elliptic torus as the initial spatial condition of a given particle species in the simulation. @details As a first step, we generate an Gaussian radial distribution in a circular cross-section torus as in \ref korc_spatial_distribution.gaussian_torus. Then we transform this spatial distribution to a one in an torus with an elliptic cross section, this following the same approach as in \ref korc_spatial_distribution.elliptic_torus.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(KORC_PARAMS), | intent(in) | :: | params | |||
type(SPECIES), | intent(inout) | :: | spp |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(KORC_PARAMS), | intent(in) | :: | params | Core KORC simulation parameters. |
||
type(SPECIES), | intent(inout) | :: | spp | An instance of the derived type SPECIES containing all the parameters and simulation variables of the different species in the simulation. |
@brief Subroutine that generates a Gaussian radial distribution of particles in a circular cross-section torus of major and minor radi and , respectively. @details We generate this exponentially decaying radial distribution following the same approach as in \ref korc_spatial_distribution.disk, but this time, the radial distribution is given by:
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(KORC_PARAMS), | intent(in) | :: | params | |||
type(SPECIES), | intent(inout) | :: | spp |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(KORC_PARAMS), | intent(in) | :: | params | Core KORC simulation parameters. |
||
type(SPECIES), | intent(inout) | :: | spp | An instance of the derived type SPECIES containing all the parameters and simulation variables of the different species in the simulation. |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(KORC_PARAMS), | intent(inout) | :: | params | Core KORC simulation parameters. |
||
type(SPECIES), | intent(inout) | :: | spp | An instance of the derived type SPECIES containing all the parameters and simulation variables of the different species in the simulation. |
||
type(FIELDS), | intent(in) | :: | F | An instance of the KORC derived type FIELDS. |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(KORC_PARAMS), | intent(inout) | :: | params | Core KORC simulation parameters. |
||
type(SPECIES), | intent(inout) | :: | spp | An instance of the derived type SPECIES containing all the parameters and simulation variables of the different species in the simulation. |
||
type(FIELDS), | intent(in) | :: | F | An instance of the KORC derived type FIELDS. |
||
type(PROFILES), | intent(in) | :: | P |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(KORC_PARAMS), | intent(in) | :: | params | |||
integer, | intent(out) | :: | Nr_a | |||
real(kind=rp), | intent(out), | ALLOCATABLE, DIMENSION(:) | :: | r_a | ||
real(kind=rp), | intent(out), | ALLOCATABLE, DIMENSION(:) | :: | nRE |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(KORC_PARAMS), | intent(inout) | :: | params | Core KORC simulation parameters. |
||
type(SPECIES), | intent(inout) | :: | spp | An instance of the derived type SPECIES containing all the parameters and simulation variables of the different species in the simulation. |
||
type(FIELDS), | intent(in) | :: | F | An instance of the KORC derived type FIELDS. |
||
type(PROFILES), | intent(in) | :: | P |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(KORC_PARAMS), | intent(inout) | :: | params | Core KORC simulation parameters. |
||
type(SPECIES), | intent(inout), | DIMENSION(:), ALLOCATABLE | :: | spp | An instance of the derived type SPECIES containing all the parameters and simulation variables of the different species in the simulation. |
|
type(PROFILES), | intent(in) | :: | P | An instance of the KORC derived type PROFILES. |
||
type(FIELDS), | intent(in) | :: | F | An instance of the KORC derived type FIELDS. |