I02_par_init_and_load
模块职责
I02_par_init_and_load 面向需要离线生成初始粒子文件的算例。Python 脚本先根据解析密度模型在三维 T 形区域中生成电子和离子的 x,y,z,vx,vy,vz 记录;Fortran 载入例程再在 MPI
运行时读取这些二进制记录,并按本地子域范围筛选粒子。
文件 |
说明 |
|---|---|
离线生成 |
|
Fortran 模块包装器,暴露二进制粒子载入例程。 |
|
MPI 并行载入二进制粒子文件并分配到当前 rank。 |
数据流
在准备阶段运行
init_particles_bin.py,生成全局粒子二进制文件。MPI 程序启动后,每个 rank 调用载入例程并顺序扫描全局文件。
载入例程只保留满足
il(d)-1 <= r(d) < iu(d)的粒子。所有 rank 用
MPI_Allreduce得到跨物种的本地最大粒子数,并按f_npmax扩展分配par。
应用文献
该离线初始粒子生成和载入流程用于 Hall 推力器三维 PIC 模拟中的近壁输运研究。相关论文包括:
- Z. Liu, Z. Zhao, and Y. Zhao, Near-Wall Pathways of Anomalous Electron Transport in Hall Thrusters Revealed by 3D PIC Simulations, arXiv:2603.14849 [physics.plasm-ph] (2026). DOI: 10.48550/arXiv.2603.14849.
Module Role
I02_par_init_and_load supports cases that prepare initial particles through
offline binary files. The Python script generates electron and ion
x,y,z,vx,vy,vz records in a three-dimensional T-shaped region from
analytical density and velocity models; the Fortran loader then reads those
records during MPI startup and keeps the particles owned by the local subdomain.
File |
Description |
|---|---|
Offline generator for |
|
Fortran module wrapper exposing the binary particle loader. |
|
MPI loader that reads binary particle files and assigns particles to the current rank. |
Data Flow
Run
init_particles_bin.pyduring case preparation to generate global binary particle files.During MPI startup, each rank calls the loader and scans the global files.
The loader keeps only particles satisfying
il(d)-1 <= r(d) < iu(d).The ranks use
MPI_Allreduceto find the local maximum particle count and allocateparwith thef_npmaxexpansion factor.
Applications and References
This offline initial-particle generation and loading workflow is used in a near-wall transport study for Hall-thruster 3D PIC simulations. Related papers include:
- Z. Liu, Z. Zhao, and Y. Zhao, Near-Wall Pathways of Anomalous Electron Transport in Hall Thrusters Revealed by 3D PIC Simulations, arXiv:2603.14849 [physics.plasm-ph] (2026). DOI: 10.48550/arXiv.2603.14849.