rizer.transport.cpp_interop#

Marshalling helpers for the C++ _plasma1d collision-model boundary.

Functions#

unpack_momentum_transfer_models(→ tuple[list, list, ...)

Unpack a per-species momentum-transfer model list into the flat arrays.

Module Contents#

rizer.transport.cpp_interop.unpack_momentum_transfer_models(mtcf: list[rizer.transport.collision_frequency.MomentumTransferCollisionFrequencyModel], n_species: int) → tuple[list, list, numpy.ndarray, numpy.ndarray]#

Unpack a per-species momentum-transfer model list into the flat arrays.

The C++ CollisionModel pybind11 binding expects these flat arrays.

Parameters:
Returns:

(xsec_energy_J, xsec_sigma_m2, radius_m, ion_Z): the first two are per-species lists of 1D arrays (or None where not applicable), the last two are (n_species,) arrays (radius NaN / Z 0 where not applicable).

Return type:

tuple of list, list, numpy.ndarray, numpy.ndarray

Notes

Shared by rizer.models.nrp.isomass_2T_volume_reactor_cpp.build_reactor0d() and rizer.models.nrp.plasma_channel_2T1D.PlasmaChannel so both native solvers build the identical C++ collision model from the same mtcf.