Surface-charge update numerics
This numerical and implementation reference documents conserved surface state, batch-end ordering, the floating-conductor linear system, and parallel reduction. See how surfaces charge if you only need to choose a model.
Stored quantity and sign
Section titled “Stored quantity and sign”q_elem(i) is total charge [C] on element . Only field evaluation divides by element area to obtain P0 surface
charge density:
When macro particle is absorbed on element , the pending change is
Electrons deposit negative charge and positive ions deposit positive charge; the absorbed particle is removed. Ordered triangles for collision and one-sided field-trace signs come from the same mesh geometry. A surface model does not rewrite triangle winding.
Ordering at batch end
Section titled “Ordering at batch end”- Build the field held fixed during particle tracking from batch-start
q_elem. - Accumulate charge from each particle’s first mesh hit in thread-local storage.
- Add reaction charge from surface emission sources.
- Apply global
neutral_returnreweighting when enabled. - Sum threads and reduce the global charge change across MPI ranks.
- Add the change to
q_elemexactly once. - If conductor objects exist, conserve their charge and equalize potential.
- Calculate the net pre/post difference, statistics, and histories.
Particles in one batch share the field from stage 1. If an incomplete collision or photo-ray query invalidates a batch, BEACH does not apply partial particle arrays or emission changes.
Floating-conductor linear system
Section titled “Floating-conductor linear system”Elements with surface_model="conductor" form groups by mesh_id. For element in group , unknown element
charges and group potentials satisfy
For source triangle carrying unit total charge, the P0 potential coefficient is
Here is the target-element centroid and is source-element area. The analytic panel potential includes
the self term under the principal-value side convention. is potential from nonconductor charge and
the uniform external field divided by k_coulomb.
Every group also conserves total charge:
The dense square system is solved by Gaussian elimination with partial pivoting, and only conductor elements are replaced.
Charge does not move between objects and nonconductor elements are unchanged. The current model uses centroid collocation
and P0-triangle influence and accepts only field_boundary.mode="free".
OpenMP, MPI, and restart
Section titled “OpenMP, MPI, and restart”The particle loop gathers absorbed charge in thread-local arrays and sums them after the loop. Photoelectron-closure emission
and return quantities and local charge changes are reduced across MPI, so every rank holds the same global q_elem.
Conductor relaxation is then applied deterministically to that same state on every rank.
Check run and resume and input parameters for checkpoint compatibility and
required files for restoring committed q_elem and related state.
Definition of tol_rel
Section titled “Definition of tol_rel”Including conductor relaxation, define the pre/post update difference as
The monitor is
tol_rel is an output metric, not an early-stop condition in the current implementation.
Implementation and tests
Section titled “Implementation and tests”- Particle absorption and batch commit:
bem_simulator_loop.f90 - Surface-model facade:
bem_surface_models.f90 - Floating-conductor solver:
bem_surface_models_conductor.f90 - Batch statistics:
bem_simulator_stats.f90 - Model regression:
test_surface_models.f90