Radial grid and profiles
src/grids/radial.jl
Public
Runes2P.RadialGrid — Type
RadialGrid{T}Radial grid defined by its strictly increasing faces [m], the first at or above 0 (a first face above 0 leaves the core out), with the spatial Jacobian V'(r) [m] at cell centres and faces (DREAM VpVol). For a cylinder V'(r) = r, the derivative dV/dr of the volume per unit length V = π r², divided by 2π.
Runes2P.radial_cell_count — Method
radial_cell_count(grid)Number of radial cells of a RadialGrid, or of the radial grid of a KineticGrid or UnknownLayout, or the radius count of a PlasmaState.
Runes2P.uniform_r_faces — Method
uniform_r_faces(cell_count, minor_radius)Faces [m] of a uniform radial grid on [0, minor_radius] with cell_count cells, for the minor radius minor_radius [m].
src/grids/radial_profiles.jl
Public
Runes2P.IonSpecies — Method
IonSpecies(name, Z, Z0, profile, radial_grid)
IonSpecies(name, Z, profiles, radial_grid)Ion species with densities [m⁻³] in any form of radial_values, evaluated on the cell centres of radial_grid (a RadialGrid or a KineticGrid): all in the charge state Z0, or one profile per charge state 0:Z in profiles.
Runes2P.PiecewiseConstant — Type
PiecewiseConstant(values, switch_times)Function of time that holds values[k] from switch_times[k-1] up to switch_times[k] [s] (values[1] before the first switch time, the last value from the last switch time on). At a switch time it has the value of the interval that starts there. values are numbers or vectors. For example, a level of δB/B for the first millisecond and a hundredth of it afterwards is PiecewiseConstant([1e-3, 1e-5], [1e-3]).
An update that takes such a function requires its switch times to be time points of the run (forced_time_points), so that no interval holds a switch.
Runes2P.PlasmaState — Method
PlasmaState(radial_grid; cold_electron_temperature, ions, electric_field, magnetic_field,
cold_electron_density=nothing)The plasma state with profiles given in any form of radial_values, evaluated on the cell centres of radial_grid (a RadialGrid or a KineticGrid): the temperature [eV], the electric field [V/m], the magnetic field [T] and the cold-electron density [m⁻³]. Ion densities on points of their own take the forms IonSpecies(name, Z, Z0, profile, radial_grid) and IonSpecies(name, Z, profiles, radial_grid). The state holds the evaluated values, so its record holds them too.
Runes2P.forced_time_points — Method
forced_time_points(update)
forced_time_points(function_of_time)Times [s] at which the setup of an update changes abruptly. integrate requires those inside the run to be among its time points. Empty by default, the switch times of a PiecewiseConstant.
Runes2P.radial_values — Method
radial_values(profile, points)Values of a radial profile at points [m], the cell centres or the faces of a radial grid:
- a number is the same at every point,
- a vector holds one value per point and is returned as it is,
- anything else is called at every point,
profile(r): an analytic function or an interpolator of a package (Interpolations.jl:linear_interpolation(r_data, values)).
The evaluation happens once, when the run is built or at the start of an interval, never inside the Newton iteration. A profile that changes in time is a function of time that returns one of these forms.
Internal
Runes2P.level_over_step — Method
level_over_step(level, t)The level of a function of time over a step that ends at t, for a term that evaluates it in the residual of an implicit step: for a PiecewiseConstant the value of the interval that ends at t (its limit from the left, so the step that ends at a switch time keeps the value before the switch, as the interval updates of the kinetic transport do), for any other function its value at t.