freeofcharge.deposition
Deposition of a neutral beam in the plasma: births and shine-through.
Every marker flies on a straight line from its position. Along it the line is
cut into steps of length ds; at each step’s midpoint inside the last closed
flux surface the optical depth grows by n_e sigma_s ds, so the stream left
after step k is w exp(-tau_k) and step k ionises
w (exp(-tau_{k-1}) - exp(-tau_k)) atoms per second. Those are tallied on
shells of rho (the birth profile, without sampling noise). Births are then
sampled: for each of births_per_marker draws, the depth tau* where the
cumulative ionised share reaches a uniform random fraction, the birth point by
linear interpolation of tau within its step, and the weight w (1 - exp(-tau_total)) / births_per_marker. A fast ion starts with the atom’s
velocity.
With a first wall, a line enters the vessel at the first step inside the wall
and ends at the first step after that outside it: the shine-through hits the
wall there (to within ds). Without a wall the line runs to its end.
Charge exchange is part of sigma_s: an ion that becomes a fast neutral
again counts as stopped, not followed.
Classes
| Name | Description |
|---|---|
Deposition | The fast ions born in the plasma and the beam that shines through. |
Functions
| Name | Description |
|---|---|
deposit | Return the deposition of beam in the plasma. |
Depositionclassdataclass#
class Deposition(births: ParticleArrays, birth_rho: object, birth_pitch: object, mass_number: int, rho_edges: np.ndarray, birth_rate: np.ndarray, power: np.ndarray, injected_power: float, absorbed_power: float, shine_through_power: float, wall_hits: ParticleArrays | None)The fast ions born in the plasma and the beam that shines through.
The profiles and powers are sums over all ranks; the births and wall hits are this rank’s.
absorbed_powerattributeinstance attribute#
absorbed_power: floatbirth_pitchattributeinstance attribute#
birth_pitch: objectv_par / v of each birth (positive along B).
birth_rateattributeinstance attribute#
birth_rate: np.ndarrayIons born per second in each shell.
birth_rhoattributeinstance attribute#
birth_rho: objectrho of each birth.
birthsattributeinstance attribute#
births: ParticleArraysBirth positions (N, 3), velocities and weights [ions/s].
injected_powerattributeinstance attribute#
injected_power: floatmass_numberattributeinstance attribute#
mass_number: intpowerattributeinstance attribute#
power: np.ndarrayBeam power deposited in each shell [W].
rho_edgesattributeinstance attribute#
rho_edges: np.ndarrayshine_through_powerattributeinstance attribute#
shine_through_power: floatwall_hitsattributeinstance attribute#
wall_hits: ParticleArrays | NoneWhere the shine-through meets the wall: positions, velocities, weights [atoms/s]; None without a wall.
shine_through_fractionproperty#
shine_through_fraction: floatReturn the share of the injected power that is not absorbed.
power_densitymethod#
def power_density(surfaces: FluxSurfaces) -> np.ndarrayReturn the deposited power per volume of each shell [W/m^3].
to_datasetmethod#
def to_dataset(surfaces: FluxSurfaces | None = None) -> xr.DatasetReturn the profiles on the shell centres, with densities if surfaces.
depositfunction#
def deposit(beam: NeutralBeam, equilibrium: Equilibrium, plasma: Plasma, stopping: StoppingModel | None = None, *, step: float = 0.01, rho_edges=None, births_per_marker: int = 1, max_length: float | None = None, seed: int | None = None, comm: MPI.Comm | None = None, chunk_points: int = 2000000) -> DepositionReturn the deposition of beam in the plasma.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
beam | NeutralBeam | required | This rank’s markers. |
equilibrium | Equilibrium | required | Flux, boundary and (optional) wall. |
plasma | Plasma | required | Profiles. |
stopping | StoppingModel | None | None | Stopping model; :class:SuzukiStopping if None. |
step | float | 0.01 | Step ds along the lines [m]. |
rho_edges | None | Shells of the profiles; 50 equal ones if None. | |
births_per_marker | int | 1 | Births sampled per marker (0 for profiles only). |
max_length | float | None | None | Length of the lines [m]; long enough to cross the grid if None. |
seed | int | None | None | Seed of the birth sampling (per rank). |
comm | MPI.Comm | None | None | Communicator over which the markers are split; serial if None. |
chunk_points | int | 2000000 | Line points held at once (memory). |