I02_par_init_and_load

模块职责

I02_par_init_and_load 面向需要离线生成初始粒子文件的算例。Python 脚本先根据解析密度模型在三维 T 形区域中生成电子和离子的 x,y,z,vx,vy,vz 记录;Fortran 载入例程再在 MPI 运行时读取这些二进制记录,并按本地子域范围筛选粒子。

文件

文件

说明

init_particles_bin.py

离线生成 output_init_particles_bin/par_ele_init.bin 和 par_ion_init.bin,并输出诊断图。

mod_I02_load_init_particles_bin.f90

Fortran 模块包装器,暴露二进制粒子载入例程。

sub_I02_load_init_particles_bin.f90

MPI 并行载入二进制粒子文件并分配到当前 rank。

数据流

  1. 在准备阶段运行 init_particles_bin.py,生成全局粒子二进制文件。

  2. MPI 程序启动后,每个 rank 调用载入例程并顺序扫描全局文件。

  3. 载入例程只保留满足 il(d)-1 <= r(d) < iu(d) 的粒子。

  4. 所有 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.

Files

File

Description

init_particles_bin.py

Offline generator for output_init_particles_bin/par_ele_init.bin and par_ion_init.bin, plus diagnostic plots.

mod_I02_load_init_particles_bin.f90

Fortran module wrapper exposing the binary particle loader.

sub_I02_load_init_particles_bin.f90

MPI loader that reads binary particle files and assigns particles to the current rank.

Data Flow

  1. Run init_particles_bin.py during case preparation to generate global binary particle files.

  2. During MPI startup, each rank calls the loader and scans the global files.

  3. The loader keeps only particles satisfying il(d)-1 <= r(d) < iu(d).

  4. The ranks use MPI_Allreduce to find the local maximum particle count and allocate par with the f_npmax expansion 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.