-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #166 from mabarnes/geometry-upgrade
Geometry upgrade
- Loading branch information
Showing
45 changed files
with
2,225 additions
and
376 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
Magnetic Geometry | ||
=============================================== | ||
|
||
We take the magnetic field $\mathbf{B}$ to have the form | ||
```math | ||
\begin{equation} | ||
\mathbf{B} = B_z \hat{\mathbf{z}} + B_\zeta \hat{\mathbf{\zeta}}, | ||
\end{equation} | ||
``` | ||
with $B_\zeta = B(r,z) b_\zeta$, $B_z = B(r,z) b_z$ and $b_z$ and $b_\zeta$ the direction cosines of the magnetic field vector. | ||
Here the basis vectors are those of cylindrical geometry $(r,z,\zeta)$, i.e., | ||
$\hat{\mathbf{r}} = \nabla r $, $\hat{\mathbf{z}} = \nabla z$, | ||
and $\hat{\mathbf{\zeta}} = r \nabla \zeta$. The unit vectors $\hat{\mathbf{r}}$, $\hat{\mathbf{z}}$, and $\hat{\mathbf{\zeta}}$ | ||
form a right-handed orthonormal basis. | ||
|
||
Supported options | ||
=============================================== | ||
|
||
To choose the type of geometry, set the value of "option" in the geometry namelist. The namelist will have the following appearance in the TOML file. | ||
``` | ||
[geometry] | ||
option="constant-helical" # ( or "1D-mirror" ) | ||
pitch = 1.0 | ||
rhostar = 1.0 | ||
DeltaB = 0.0 | ||
``` | ||
If `rhostar` is not set then it is computed from reference parameters. | ||
|
||
[geometry] option = "constant-helical" | ||
=============================================== | ||
Here $b_\zeta = \sqrt{1 - b_z^2}$ is a constant, $b_z$ is a constant input parameter ("pitch") and $B$ is taken to be 1 with respect to the reference value $B_{\rm ref}$. | ||
|
||
[geometry] option = "1D-mirror" | ||
=============================================== | ||
Here $b_\zeta = \sqrt{1 - b_z^2}$ is a constant, $b_z$ is a constant input parameter ("pitch") and $B = B(z)$ is taken to be | ||
the function | ||
```math | ||
\begin{equation} | ||
\frac{B(z)}{B_{\rm ref}} = | ||
1 + \Delta B \left( 2\left(\frac{2z}{L_z}\right)^2 - \left(\frac{2z}{L_z}\right)^4\right) | ||
\end{equation} | ||
``` | ||
where $\Delta B $ is an input parameter ("DeltaB") that must satisfy $\Delta B > -1$. | ||
Recalling that the coordinate $z$ runs from | ||
$z = -L_z/2$ to $L_z/2$, | ||
if $\Delta B > 0$ than the field represents a magnetic mirror which traps particles, | ||
whereas if $\Delta B < 0$ then the magnetic field accelerates particles | ||
by the mirror force as they approach the wall. | ||
Note that this field does not satisfy $\nabla \cdot \mathbf{B} = 0$, and is | ||
only used to test the implementation of the magnetic mirror terms. 2D simulations with a radial domain and$\mathbf{E}\times\mathbf{B}$ drifts are supported in the "1D-mirror" | ||
geometry option. | ||
|
||
Geometric coefficients | ||
=============================================== | ||
Here, we write the geometric coefficients appearing in the characteristic equations | ||
explicitly. | ||
|
||
The $z$ component of the $\mathbf{E}\times\mathbf{B}$ drift is given by | ||
```math | ||
\begin{equation} \frac{\mathbf{E}\times\mathbf{B}}{B^2} \cdot \nabla z = \frac{E_r B_\zeta}{B^2} \nabla r \times \hat{\mathbf{\zeta}} \cdot \nabla z | ||
= - J \frac{E_r B_\zeta}{B^2}, | ||
\end{equation} | ||
``` | ||
where we have defined $J = r \nabla r \times \nabla z \cdot \nabla \zeta$. | ||
Note that $J$ is dimensionless. | ||
The $r$ component of the $\mathbf{E}\times\mathbf{B}$ drift is given by | ||
```math | ||
\begin{equation} \frac{\mathbf{E}\times\mathbf{B}}{B^2} \cdot \nabla r = \frac{E_z B_\zeta}{B^2} \nabla z \times \hat{\mathbf{\zeta}} \cdot \nabla r | ||
= J \frac{E_z B_\zeta}{B^2}. | ||
\end{equation} | ||
``` | ||
Due to the axisymmetry of the system, the differential operator | ||
$\mathbf{b} \cdot \nabla (\cdot) = b_z \partial {(\cdot)}{\partial z}$, | ||
and the convective derivative | ||
```math | ||
\begin{equation} | ||
\frac{d B}{d t} = \frac{d z}{d t} \frac{\partial B}{ \partial z} + \frac{dr}{dt}\frac{\partial B}{\partial r}. | ||
\end{equation} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
`geo` | ||
===== | ||
|
||
```@autodocs | ||
Modules = [moment_kinetics.geo] | ||
``` |
62 changes: 62 additions & 0 deletions
62
examples/fokker-planck/fokker-planck-relaxation-report-resolutions.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# cheap input file for a 0D2V relaxation to a collisional Maxwellian distribution with self-ion collisions. | ||
n_ion_species = 1 | ||
n_neutral_species = 0 | ||
electron_physics = "boltzmann_electron_response" | ||
evolve_moments_density = false | ||
evolve_moments_parallel_flow = false | ||
evolve_moments_parallel_pressure = false | ||
evolve_moments_conservation = false | ||
T_e = 1.0 | ||
T_wall = 1.0 | ||
initial_density1 = 0.5 | ||
initial_temperature1 = 1.0 | ||
initial_density2 = 0.5 | ||
initial_temperature2 = 1.0 | ||
z_IC_option1 = "sinusoid" | ||
z_IC_density_amplitude1 = 0.001 | ||
z_IC_density_phase1 = 0.0 | ||
z_IC_upar_amplitude1 = 0.0 | ||
z_IC_upar_phase1 = 0.0 | ||
z_IC_temperature_amplitude1 = 0.0 | ||
z_IC_temperature_phase1 = 0.0 | ||
z_IC_option2 = "sinusoid" | ||
z_IC_density_amplitude2 = 0.001 | ||
z_IC_density_phase2 = 0.0 | ||
z_IC_upar_amplitude2 = 0.0 | ||
z_IC_upar_phase2 = 0.0 | ||
z_IC_temperature_amplitude2 = 0.0 | ||
z_IC_temperature_phase2 = 0.0 | ||
charge_exchange_frequency = 0.0 | ||
ionization_frequency = 0.0 | ||
constant_ionization_rate = false | ||
# nuii sets the normalised input C[F,F] Fokker-Planck collision frequency | ||
nuii = 1.0 | ||
nstep = 200000 | ||
dt = 1.0e-3 | ||
nwrite = 50 | ||
nwrite_dfns = 50 | ||
use_semi_lagrange = false | ||
n_rk_stages = 4 | ||
split_operators = false | ||
z_ngrid = 1 | ||
z_nelement = 1 | ||
z_nelement_local = 1 | ||
z_bc = "wall" | ||
z_discretization = "chebyshev_pseudospectral" | ||
r_ngrid = 1 | ||
r_nelement = 1 | ||
r_nelement_local = 1 | ||
r_bc = "periodic" | ||
r_discretization = "chebyshev_pseudospectral" | ||
vpa_ngrid = 5 | ||
vpa_nelement = 8 | ||
vpa_L = 6.0 | ||
vpa_bc = "zero" | ||
vpa_discretization = "gausslegendre_pseudospectral" | ||
vperp_ngrid = 5 | ||
vperp_nelement = 4 | ||
vperp_L = 3.0 | ||
vperp_discretization = "gausslegendre_pseudospectral" | ||
# Fokker-Planck operator requires the "gausslegendre_pseudospectral | ||
# options for the vpa and vperp grids | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
n_ion_species = 1 | ||
n_neutral_species = 0 | ||
boltzmann_electron_response = true | ||
evolve_moments_density = false | ||
evolve_moments_parallel_flow = false | ||
evolve_moments_parallel_pressure = false | ||
evolve_moments_conservation = false | ||
T_e = 1.0 | ||
T_wall = 1.0 | ||
initial_density1 = 1.0 | ||
initial_temperature1 = 1.0 | ||
z_IC_option1 = "gaussian" | ||
z_IC_density_amplitude1 = 0.001 | ||
z_IC_density_phase1 = 0.0 | ||
z_IC_upar_amplitude1 = 1.0 | ||
z_IC_upar_phase1 = 0.0 | ||
z_IC_temperature_amplitude1 = 0.0 | ||
z_IC_temperature_phase1 = 0.0 | ||
vpa_IC_option1 = "gaussian" | ||
vpa_IC_density_amplitude1 = 1.0 | ||
vpa_IC_density_phase1 = 0.0 | ||
vpa_IC_upar_amplitude1 = 0.0 | ||
vpa_IC_upar_phase1 = 0.0 | ||
vpa_IC_temperature_amplitude1 = 0.0 | ||
vpa_IC_temperature_phase1 = 0.0 | ||
initial_density2 = 1.0 | ||
initial_temperature2 = 1.0 | ||
z_IC_option2 = "gaussian" | ||
z_IC_density_amplitude2 = 0.001 | ||
z_IC_density_phase2 = 0.0 | ||
z_IC_upar_amplitude2 = -1.0 | ||
z_IC_upar_phase2 = 0.0 | ||
z_IC_temperature_amplitude2 = 0.0 | ||
z_IC_temperature_phase2 = 0.0 | ||
vpa_IC_option2 = "gaussian" | ||
vpa_IC_density_amplitude2 = 1.0 | ||
vpa_IC_density_phase2 = 0.0 | ||
vpa_IC_upar_amplitude2 = 0.0 | ||
vpa_IC_upar_phase2 = 0.0 | ||
vpa_IC_temperature_amplitude2 = 0.0 | ||
vpa_IC_temperature_phase2 = 0.0 | ||
charge_exchange_frequency = 0.5 | ||
ionization_frequency = 0.05 | ||
constant_ionization_rate = true | ||
nstep = 10000 | ||
dt = 1.0e-3 | ||
nwrite = 50 | ||
nwrite_dfns = 50 | ||
use_semi_lagrange = false | ||
n_rk_stages = 4 | ||
split_operators = false | ||
r_ngrid = 1 | ||
r_nelement = 1 | ||
z_ngrid = 5 | ||
z_nelement = 16 | ||
z_bc = "wall" | ||
z_discretization = "chebyshev_pseudospectral" | ||
vpa_ngrid = 5 | ||
vpa_nelement = 16 | ||
vpa_L = 6.0 | ||
vpa_bc = "zero" | ||
vpa_discretization = "chebyshev_pseudospectral" | ||
vperp_ngrid = 5 | ||
vperp_nelement = 8 | ||
vperp_L = 3.0 | ||
vperp_bc = "zero" | ||
vperp_discretization = "chebyshev_pseudospectral" | ||
vz_ngrid = 9 | ||
vz_nelement = 64 | ||
vz_L = 18.0 | ||
vz_bc = "both_zero" | ||
vz_discretization = "chebyshev_pseudospectral" | ||
|
||
[numerical_dissipation] | ||
vpa_dissipation_coefficient = 1.0e-3 #1.0e-2 #1.0e-1 | ||
vperp_dissipation_coefficient = 1.0e-3 #1.0e-2 #1.0e-1 | ||
force_minimum_pdf_value = 0.0 | ||
|
||
[geometry] | ||
option="1D-mirror" | ||
DeltaB=0.5 | ||
#option="constant-helical" | ||
pitch=1.0 | ||
rhostar= 1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.