Skip to content
Projects

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

NameDescription
DepositionThe fast ions born in the plasma and the beam that shines through.

Functions

NameDescription
depositReturn 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: float

birth_pitchattributeinstance attribute#

birth_pitch: object

v_par / v of each birth (positive along B).

birth_rateattributeinstance attribute#

birth_rate: np.ndarray

Ions born per second in each shell.

birth_rhoattributeinstance attribute#

birth_rho: object

rho of each birth.

birthsattributeinstance attribute#

births: ParticleArrays

Birth positions (N, 3), velocities and weights [ions/s].

injected_powerattributeinstance attribute#

injected_power: float

mass_numberattributeinstance attribute#

mass_number: int

powerattributeinstance attribute#

power: np.ndarray

Beam power deposited in each shell [W].

rho_edgesattributeinstance attribute#

rho_edges: np.ndarray

shine_through_powerattributeinstance attribute#

shine_through_power: float

wall_hitsattributeinstance attribute#

wall_hits: ParticleArrays | None

Where the shine-through meets the wall: positions, velocities, weights [atoms/s]; None without a wall.

shine_through_fractionproperty#

shine_through_fraction: float

Return the share of the injected power that is not absorbed.

power_densitymethod#

def power_density(surfaces: FluxSurfaces) -> np.ndarray

Return the deposited power per volume of each shell [W/m^3].

to_datasetmethod#

def to_dataset(surfaces: FluxSurfaces | None = None) -> xr.Dataset

Return 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) -> Deposition

Return the deposition of beam in the plasma.

Parameters

NameTypeDefaultDescription
beamNeutralBeamrequiredThis rank’s markers.
equilibriumEquilibriumrequiredFlux, boundary and (optional) wall.
plasmaPlasmarequiredProfiles.
stoppingStoppingModel | NoneNoneStopping model; :class:SuzukiStopping if None.
stepfloat0.01Step ds along the lines [m].
rho_edgesNoneShells of the profiles; 50 equal ones if None.
births_per_markerint1Births sampled per marker (0 for profiles only).
max_lengthfloat | NoneNoneLength of the lines [m]; long enough to cross the grid if None.
seedint | NoneNoneSeed of the birth sampling (per rank).
commMPI.Comm | NoneNoneCommunicator over which the markers are split; serial if None.
chunk_pointsint2000000Line points held at once (memory).