Skip to content
Development documentation — This site follows the main branch and may differ from an installed release. View the changelog.

BEACH Input Parameters Reference

Look up beach.toml keys, types, defaults, units, and required or mutually exclusive conditions here. Units are SI unless stated otherwise. Start a new configuration with Case design, then follow Configuration validation after editing it.

What to look upSection on this page
Time steps, batch count, field solver, and external fieldssim
Domain geometry and periodic axesdomain
Field and particle boundary conditionsfield_boundary / particle_boundary
Species, supply rates, and emissionparticles.species
Surface geometry, material, and placementmesh / Coordinate and placement helpers
Saved quantities and resumeoutput
External plasma and periodic-field detailsreservoir / surface_current_model / periodic2

You do not need to copy every entry into your configuration. Select the settings required by your sources, boundaries, and solver; omitted settings use the listed defaults. For entries marked required or unspecified, also check the applicability conditions below each table.


ItemSpecification
Explicit inputbeach path/to/beach.toml
Default inputWith no argument, beach.toml in the current directory
Developer runfpm run --target beach -- path/to/beach.toml behaves the same
FormatTOML. Multi-line arrays are supported
Unknown keysUnknown section names and key names are errors
schemaschemas/beach.schema.json
Python validationbeachx lint beach.toml / beachx config validate beach.toml check the packaged schema and semantic constraints
Fortran validationFor development and diagnostics, beach --check-config beach.toml checks loading, normalization, and minimum model prerequisites; the path is required. It does not replace lint before running
Basic valuesReals and array components must be finite; integer fields do not accept reals or booleans
Integer storage rangeSigned 32-bit -2147483648..2147483647; out-of-range values are rejected before conversion. Lint checks field-specific ranges
StringsValues exceeding their Fortran destination length are errors; no implicit truncation

To use an editor schema, put a comment directive with the GitHub Raw URL at the beginning of beach.toml. The Fortran parser does not accept regular keys before the first section, so do not use "$schema" = "...".

#:schema https://raw.githubusercontent.com/Nkzono99/BEACH/main/schemas/beach.schema.json

KindRepresentative keysUnit / direction
Timedt, batch_durationseconds
Lengthdomain.box_min, domain.box_max, pos_low, pos_highm
Chargeq_particle, element charge outputC
Massm_particlekg
Velocitydrift_velocity, ray_directionm/s. ray_direction is a direction vector
Electric fielde0, e0_absV/m
Magnetic fieldb0T
Densitynumber_density_cm3, number_density_m3cm^-3 or m^-3
Temperaturetemperature_k, temperature_evK or eV. They cannot both be specified
Anglee0_phi_xy_deg, e0_phi_z_degdegree

Numbers and array components must be finite. Disabled species still undergo checks on the types, finiteness, and string lengths of supplied values, including the same integer storage range. Schema / Python own detailed input diagnostics for enums, declared ranges, and settings supplied to inactive features. Fortran does not repeat all these diagnostics; it resolves derived values and references and checks minimum prerequisites for execution. Identical acceptance of invalid input is not guaranteed. Physical combination checks follow each setting’s applicability conditions. *_low / *_high are lower and upper bounds on each axis. inject_face is one of x_low, x_high, y_low, y_high, z_low, or z_high.


For the first run, use the Ten-Minute Tutorial and examples/tutorial_insulator.toml. beachx config init generates the same configuration. This beginner case tracks 200 macro-electrons per batch for 20 surface-charge updates and uses field_solver="direct" with field_boundary.mode="free".

Add boundary-reservoir inflow, plane_source, periodic boundaries, closed photoelectrons, and an infinite-periodic correction later from Design a Simulation Case, after the beginner case runs successfully.


[sim], [domain], [field_boundary], [particle_boundary], [reservoir], [surface_current_model], [particles], [mesh], [periodic2], and [output] form the public configuration.

beach.toml
├── [sim]
├── [domain]
├── [field_boundary]
├── [particle_boundary]
├── [reservoir]
├── [surface_current_model]
├── [particles]
│ └── [[particles.species]] # one or more array-of-table entries
│ ├── [particles.species.boundary_inflow]
│ └── [particles.species.boundary]
├── [mesh]
│ ├── [mesh.groups.<name>] # named child table
│ └── [[mesh.templates]] # zero or more array-of-table entries
├── [periodic2]
└── [output]

Paths such as sim.dt and domain.periodic_axes mean “table name.key” in the prose.

TOML tableParentCardinality / requirementContents
[sim]rootconditionalTime step, batch count, field solver, and external fields
[domain]rootwith a boxBox geometry and periodic axes
[field_boundary]rootoptionalfree / periodic2 field closure
[particle_boundary]rootoptionalGlobal particle actions on nonperiodic faces
[reservoir]rootoptionalExternal-reservoir inflow barrier and reference potential
[surface_current_model]rootoptionalExternal sheath closure resolving per-species fixed_current targets or a matching-plane response
[particles]rootrequiredContainer for [[particles.species]]; do not put ordinary keys directly under it
[[particles.species]][particles]one or moreSpecies, injection mode, velocity distribution, macro-particle weight
[particles.species.boundary]latest [[particles.species]]optionalNonperiodic-face overrides for that species
[particles.species.boundary_inflow]latest [[particles.species]]optionalNonperiodic faces receiving external-reservoir inflow
[mesh]rootoptionalSelection of OBJ or built-in template input
[mesh.groups.<name>][mesh]zero or morePlacement and scale shared by multiple templates
[[mesh.templates]][mesh]zero or moreBuilt-in shapes used with mode="template"
[periodic2]rootconditionalNonzero mode, zero mode, and lower-boundary model for split periodic2
[output]rootoptionalOutput directory, history, checkpoint resume

[sim] and [domain] are required when using boundary_inflow, plane_source, reservoir_face, or photo_raycast. At least one [[particles.species]] entry is required.


KeyTypeDefaultDescription
dtfloat1.0e-9Time step [s]. Finite and >0
rng_seedint12345Random seed
batch_countint1Batch count, or cumulative target count when resuming. >=1
batch_durationfloat0.0Physical time per batch [s]. Finite; must be >0 for flux-driven sources
batch_duration_stepfloat0.0Resolves batch_duration=dt*batch_duration_step. >0; mutually exclusive with batch_duration
max_stepint400Maximum pushes per particle. >=1

Specifying both batch_duration and batch_duration_step is an error. For boundary_inflow / plane_source / reservoir_face / photo_raycast, the resolved batch_duration > 0 is required. See Case design to choose steps, tracking limits, and particle counts together.

These settings diagnose charge changes. The run ends at batch_count; changing these values does not enable early stopping.

KeyTypeDefaultDescription
tol_relfloat1.0e-8Monitored relative-change value. Finite and >=0; not a stop condition
q_floorfloat1.0e-30Denominator floor for rel_change. Finite and >0

Use these controls when adjusting boundary retries, particle discard, or photoelectron ray tracing.

KeyTypeDefaultDescription
multiple_box_events_policystring"abort"abort / soft_discard after the per-step boundary-event limit
multiple_box_events_retry_backendstring"none"Retry after multiple_box_events: none / upper_panel_fourier
multiple_box_events_soft_discard_count_graceint1000Count grace before enforcing the cumulative soft-discard fraction. Must be >= 0
multiple_box_events_soft_discard_fraction_limitfloat1.0e-6Stop limit for the cumulative soft-discard fraction. Must satisfy 0 < value <= 1
multiple_box_events_soft_discard_abs_charge_limitfloat1.0e-12Warning threshold for cumulative soft-discard absolute charge [C]. Finite and >0
raycast_max_bounceint16Maximum photo_raycast bounce count. >=1 when enabled

upper_panel_fourier is valid only for a cached_kneq0 periodic2 configuration. soft_discard stops only after the count grace when its cumulative fraction exceeds the fraction limit. Because cumulative absolute charge grows with run duration, crossing its threshold emits a warning instead. See Particle Events for the retry validity domain and diagnostics.

KeyTypeDefaultDescription
e0float[3][0,0,0]Uniform external electric field [V/m]
e0_absfloatunspecifiedUniform external electric-field magnitude [V/m]. >=0
e0_phi_xy_degfloat0.0Azimuth in the xy plane when e0_abs is specified [deg]. Explicit use requires e0_abs
e0_phi_z_degfloat0.0Elevation from the xy plane when e0_abs is specified [deg]. Explicit use requires e0_abs
b0float[3][0,0,0]Uniform magnetic field [T]

Direct e0 input is mutually exclusive with the e0_abs and angle form.

field_solver selects how Coulomb fields are evaluated from element charges.

field_solverUse caseSupported field boundary
directExact all-to-all evaluation for small element counts and split referencesfree, or a constrained periodic2 split reference
treecodeApproximate evaluation for medium and larger casesfield_boundary.mode="free"
fmmLarge-scale evaluation, periodic2, FMM core validationfield_boundary.mode="free" / "periodic2"
autoSelect direct / FMM based on element countfield_boundary.mode="free"

Use the canonical solver and field-boundary compatibility table to choose the combination. Element charge is always evaluated as a constant density on its triangle (a P0 panel); there is no configurable kernel.

Common keys:

KeyTypeDefaultDescription
field_solverstring"auto"direct / treecode / fmm / auto
field_normalizationstring"si"si / box / mesh / length
field_length_scalefloat1.0Length used by field_normalization="length" [m]. >0
field_periodic_image_layersint1Near-image shell for periodic2. >=0; >=1 with cached_kneq0
field_periodic_far_correctionstring"none"none / auto / cached_kneq0
field_periodic_ewald_alphafloat0.0Ewald split for cache generation. >=0; 0 selects automatically
field_periodic_ewald_layersint4Real/reciprocal shell depth. >=1 when far correction is enabled
field_periodic_cache_dirstring".beach_cache/periodic2"Operator-cache directory. Must be nonempty with cached_kneq0
field_periodic_generation_tolerancefloat1.0e-8Cache-identity tolerance. Finite and >0 with cached_kneq0
tree_thetafloatelement-count heuristic below when omittedTreecode/FMM MAC parameter. 0<theta<=1; larger is faster and coarser
tree_leaf_maxintelement-count heuristic below when omittedMaximum sources per treecode/FMM leaf. >=1
tree_min_nelemint256Element count where auto switches from direct to FMM. >=1

field_periodic_far_correction="auto" is accepted for compatibility and is currently treated the same as none.

field_normalization changes only internal coordinates; output fields and potentials remain SI.

field_normalizationLength scale
siUse input SI coordinates as-is
boxMaximum width of domain.box_max - domain.box_min. Requires [domain]
meshMaximum width of the mesh bounding box. Falls back to field_length_scale if the mesh is empty
lengthfield_length_scale

Mode-specific keys:

field_solverEvaluationAdditional keys used
directO(MN) reference sum over every sourcenone
treecodeDistant monopoles plus nearby panel kernelstree_theta, tree_leaf_max
fmmApproximate large-scale Coulomb FMMtree_theta, tree_leaf_max, periodic2 keys when applicable
autoDirect below tree_min_nelem; FMM at and above ittree_min_nelem; tree_theta and tree_leaf_max when FMM is selected

See Use FMM for selection and verification and Coulomb FMM core details for implementation internals.

If tree_theta and tree_leaf_max are not specified explicitly, the following values are used based on the element count.

Element count nelemtree_thetatree_leaf_max
< 15000.4012
1500 <= nelem < 100000.5016
10000 <= nelem < 500000.5820
50000 <= nelem0.6524

[domain]: Box Geometry and Periodic Topology

Section titled “[domain]: Box Geometry and Periodic Topology”
[domain]
box_min = [0.0, 0.0, 0.0]
box_max = [1.0, 1.0, 4.0]
periodic_axes = ["x", "y"]
KeyTypeDefaultDescription
box_min, box_maxfloat[3]noneLower and upper box bounds [m]. Specify both, with box_max > box_min on every axis
box_origin, box_sizefloat[3]noneOrigin and positive size [m]. Specify both
periodic_axesstring[][]Unique entries from "x" / "y" / "z"

Do not combine the two geometry forms. When [domain] is present, one complete pair is required. domain.periodic_axes is the only public setting that selects periodicity. With field_boundary.mode="periodic2", periodic_axes=["x","y"] is required.

[field_boundary]
mode = "periodic2"
KeyTypeDefaultDescription
modestring"free"free / periodic2

For periodic2, [domain] is required. Add [periodic2] when selecting the nonzero- and zero-mode operators explicitly. Follow the solver and field-boundary compatibility table.

[particle_boundary]: Global Particle Boundaries

Section titled “[particle_boundary]: Global Particle Boundaries”
[particle_boundary]
z_low = "open"
z_high = "open"
ordinary_open_model = "escape"
KeyTypeDefaultDescription
x_low, x_highstringfollow domainopen / reflect / redistributed_reflect on nonperiodic x faces
y_low, y_highstringfollow domainopen / reflect / redistributed_reflect on nonperiodic y faces
z_low, z_highstringfollow domainopen / reflect / redistributed_reflect on nonperiodic z faces
ordinary_open_modelstring"escape"escape / potential_barrier on effective open faces

An omitted face inherits domain topology and is open when nonperiodic. Periodic faces cannot be overridden. See Particle Events for reflection, redistributed reflection, and potential-barrier definitions.

[reservoir]: External Reservoir Conditions

Section titled “[reservoir]: External Reservoir Conditions”
[reservoir]
inflow_model = "source_vdf"
phi_infty = 0.0
face_potential_grid_n = 3
KeyTypeDefaultDescription
inflow_modelstring"source_vdf"source_vdf / infinity_barrier
phi_inftyfloat0.0Infinity-reference potential used by barriers [V]
face_potential_grid_nint3N x N grid for injection-face average potential. >=1

infinity_barrier applies only to boundary_inflow. With a uniform field, set phi_infty to a consistent effective reservoir reference. See Inject Particles Through a Boundary for the correction and validity domain.

[surface_current_model]: External Sheath Closure

Section titled “[surface_current_model]: External Sheath Closure”

When omitted, species-level settings provide manual current targets. Select a model only when using an external sheath closure.

modelEffectDetails
noneDo not use an external-sheath closureConfigure species surface_charge_closure
zhao_stationaryResolve fixed currents and the z-high energy barrier from a Zhao stationary rootZhao Stationary Closure
matching_plane_quasistaticCouple the box top quasistatically to an outer-sheath responseUse Quasistatic Matching-Plane Coupling
KeyTypeDefaultDescription
modelstring"none"none / zhao_stationary / matching_plane_quasistatic
response_backendstring"table"Matching response source: table / zhao_online
zhao_branchstring"auto"auto / a / b / c; branch for stationary or online Zhao; no-PE stationary accepts only auto / c
zhao_root_selectionstring"require_unique"Online-Zhao root policy. require_unique rejects multiplicity; minimum_energy selects the lowest-potential-energy root; continuation tracks the accepted Type-A root. continuation requires zhao_branch="a" and implicit_zero_mode=true. Forbidden for stationary Zhao and tables. See the numerical and response-table reference
electron_speciesstringunspecifiedAmbient-electron species_key; required for Zhao / matching; 1–64 characters
ion_speciesstringunspecifiedCold-ion species_key; required for Zhao / matching; 1–64 characters
photoelectron_speciesstringrequired when PE is enabledPE species_key; 1–64 characters; omission disables PE in matching
solar_elevation_degfloatrequired with stationary PESolar elevation α\alpha used by the Zhao source; 0<α900<\alpha\le90 degrees
photoelectron_ref_density_m3floatrequired with stationary PEReference PE density npe,refn_{pe,ref} [m^-3]. >0
photoelectron_source_scalefloat1.0Stationary-Zhao sUVs_{UV}. >=0; 0 disables PE
reference_area_m2floatdomain x-y areaArea converting Zhao current densities to total currents [m^2]. >0; forbidden for matching
response_table_pathstringrequired for table matchingOuter-sheath response CSV v1. Resolved length 1–256 characters; forbidden online
implicit_zero_modeboolfalseApply backward Euler to the matching-plane mean DHD_H; requires e_bottom_zero. A table uses a finite DHD_H axis and singleton feedback; online Zhao searches the selected branch without a CSV
coupling_rtolfloat1.0e-4Relative matching fixed-point tolerance; finite 0<r10<r\le1
coupling_atolfloat[4][0.0, 0.0, 0.0, 0.0]Per-feedback-component absolute tolerances, ordered as outward PE flux [m^-2 s^-1], PE mean normal energy [eV], outward electron flux [m^-2 s^-1], and outward ion flux [m^-2 s^-1]; values must be finite and nonnegative, with zero on inactive components
coupling_max_iterationsint20Maximum matching fixed-point iterations; >=1
coupling_relaxationfloat0.5Matching update relaxation; finite 0<ω10<\omega\le1

Input constraints:

ItemRequired condition
Role speciesEnabled, mutually distinct, and surface_charge_closure="fixed_current"
Ambient electron / ionEnter inward from the z-high reservoir; no manual target_*_current_a
No PEphotoelectron_source_scale=0.0; omit PE-specific keys; use zhao_branch="auto" or "c"
With PENegative photo_raycast, inject_face="z_high", deposit_opposite_charge_on_emit=true, effective z-high boundary open
Species propertiesSingly charged; equal ambient-electron and PE masses; Te>0T_e>0, Tpe>0T_{pe}>0, Ti0.1TeT_i\le0.1T_e
External fieldsim.b0=[0,0,0]; reservoir.inflow_model="infinity_barrier" is forbidden

Without PE, Type C produces only electron/ion absorption targets satisfying Je+Ji=0J_e+J_i=0 and the z-high kinetic-barrier map; it produces no PE emission, return, or escape target. ion_species.number_density_* is the ion density at infinity. Electron density and PE emission-current density are sampling inputs; the closure determines current targets.

This is a stationary-current closure, not a transient outer-sheath solve. See Zhao Stationary Closure for current, barrier, PE-return, and output definitions.

The complete case is examples/periodic2_zhao_fixed_current.toml.

response_backend="table" uses an external response CSV; "zhao_online" uses the finite-HH Zhao response implemented in BEACH. Without PE, omit photoelectron_species; table PE-flux and PE-energy input axes must also be zero. The matching plane coordinate HH is the z component of domain.box_max, its area is the domain x-y area, and every mesh vertex must lie below HH.

All rows below are required:

ItemRequired condition
Box / fieldx/y periodic, z nonperiodic and open; field_boundary.mode="periodic2"; explicit [periodic2] split
Splitnonzero_mode_backend is cached_kneq0 or panel_spectral_reference; zero_mode_policy="exclude_k0"; lower boundary is e_bottom_zero or symmetric_vacuum
External field / open facesim.e0=sim.b0=[0,0,0]; ordinary_open_model="escape"; no generic reservoir-potential model
Event policyabort, or soft_discard with a fraction limit, count grace, and absolute-charge warning threshold
RolesOnly distinct, enabled electron / ion / optional PE roles; each uses surface_charge_closure="explicit"
Electron / ion sourceNegative / positive charge; source_mode="volume_seed"; npcls_per_step=0; only z-high boundary_inflow="reservoir"
PE sourceNegative photo_raycast; inject_face="z_high"; deposit_opposite_charge_on_emit=true
Particle boundariesperiodic x/y and open z-low/z-high for every role
Current targetsNo manual fixed_current target
BackendRequired, forbidden, and species constraints
tableRequires response_table_path; forbids zhao_branch and zhao_root_selection
zhao_onlineForbids response_table_path; accepts zhao_branch auto / a / b / c and zhao_root_selection require_unique / minimum_energy / continuation. continuation is restricted to explicit Type A with implicit_zero_mode=true. Implicit mode searches the selected branch without a response/query CSV
zhao_online speciesEvery role singly charged; Te>0T_e>0; 0Ti0.1Te0\le T_i\le0.1T_e; positive ion density; negative z component of electron / ion drift_velocity; with PE, equal electron/PE masses and Tpe>0T_{pe}>0
All matching backendsForbid stationary-only solar_elevation_deg, photoelectron_ref_density_m3, and photoelectron_source_scale

With model="none", do not specify another key. Removed [outer_plasma] and [coupling] tables remain invalid. See Quasistatic Matching-Plane Coupling for model selection, physical meaning, and applicability limits. The matching-plane numerical and response-table reference defines the CSV, implicit update, and fixed-point contracts.

[periodic2]: Nonzero Mode, Zero Mode, and Lower Boundary

Section titled “[periodic2]: Nonzero Mode, Zero Mode, and Lower Boundary”

[periodic2] is a top-level table. Set domain.periodic_axes=["x","y"] and field_boundary.mode="periodic2". Use field_solver="fmm" for production and reserve field_solver="direct" for the small split reference.

KeyTypeDefaultMeaning and constraints
nonzero_mode_backendstringrequiredpanel_spectral_reference / cached_kneq0
zero_mode_policystringrequiredexclude_k0
lower_boundary_modelstringrequiredsymmetric_vacuum / e_bottom_zero
max_nonzero_mode_potential_stepfloat0Accepted k0k\ne0 potential-change limit [V]. >=0; 0 disables; cached_kneq0 only
reference_mode_layersint4Fourier-mode cutoff. >=1
panel_quadrature_orderint12Panel-area quadrature order. >=2

The adaptive potential limit supports boundary_inflow, plane_source, reservoir_face, and photo_raycast. The first three require target_macro_particles_per_batch and forbid fixed w_particle; a positive volume_seed is also forbidden. sim.batch_count counts accepted batches; simulated_time_s sums accepted widths. See How to choose batch_duration for acceptance, rollback, and convergence checks.

Periodic2 requires [domain], periodic_axes=["x","y"], and field_boundary.mode="periodic2". examples/periodic2_closed_photoelectron.toml is the reference combination of x/y periodicity, a boundary reservoir, and closed photoelectrons. The same periodicity applies to field evaluation, collision, and photo_raycast.

nonzero_mode_backendMeaning
panel_spectral_referencesmall-system split reference
cached_kneq0production nonzero mode using a reusable versioned operator

See periodic2 electrostatics for the nonzero/zero-mode split, the role of exclude_k0, and the mean field selected by the lower-boundary model.

At least one [[particles.species]] entry is required. The keys and constraints used depend on source_mode.

KeyTypeDefaultDescription
species_keystring"species_<1-based index>"Stable ID. 1–64 characters and unique across species
enabledbooltrueEnable the species
source_modestring"volume_seed"volume_seed / plane_source / photo_raycast / deprecated reservoir_face
q_particlefloat-1.602176634e-19Particle charge [C]. Nonzero for an enabled species
m_particlefloat9.10938356e-31Particle mass [kg]. >0
pos_lowfloat[3][-0.4,-0.4,0.2]Lower position bounds [m]
pos_highfloat[3][0.4,0.4,0.5]Upper position bounds [m]
drift_velocityfloat[3][0,0,-8e5]Drift velocity [m/s]
temperature_kfloat2.0e4Temperature [K]. >=0
temperature_evfloatunspecifiedTemperature [eV]. >=0; mutually exclusive with temperature_k
velocity_distributionstring"maxwellian"maxwellian / grid
inject_facestringunspecifiedIllumination-aperture face for photo_raycast. Also required by deprecated reservoir_face
source_normalfloat[3]unspecifiedOne-way plane_source normal. A nonzero axis-aligned vector
boundarytableunspecifiedPer-species six-face overrides in [particles.species.boundary]
boundary_inflowtableunspecifiedPer-species reservoir inflow faces in [particles.species.boundary_inflow]
surface_charge_closurestring"explicit"Surface-source charge closure. explicit / fixed_current / neutral_return
target_absorbed_current_afloatunspecifiedSigned absorbed target current [A] for fixed_current; zero or the same sign as q_particle
target_emission_current_afloatunspecifiedSigned emission-reaction target current [A] for fixed_current; zero or the sign opposite q_particle

Common keys for flux-driven sources (boundary_inflow, plane_source, and legacy reservoir_face):

KeyTypeDefaultDescription and constraints
number_density_cm3floatunspecifiedUpstream Maxwellian density [cm^-3]. >0; mutually exclusive with number_density_m3
number_density_m3floatunspecifiedUpstream Maxwellian density [m^-3]. >0; mutually exclusive with number_density_cm3
w_particlefloatexactly one of this and target_macro_particles_per_batch requiredMacro-particle weight. >0
target_macro_particles_per_batchintexactly one of this and w_particle requiredMacro-particle target. >0, or -1 on species 2+ to share species 1 weight
velocity_grid_pathstringunspecifiedNonempty CSV path for velocity_distribution="grid"; columns vx_m_s,vy_m_s,vz_m_s,f
velocity_grid_pdf_kindstring"phase_space"phase_space / flux_weighted
velocity_grid_samplingstring"auto"auto / rectilinear / discrete
particle_flux_m2_sfloatunspecifiedIncoming grid-distribution particle flux [m^-2 s^-1]. >0; mutually exclusive with current_density_a_m2
current_density_a_m2floatunspecifiedIncoming grid-distribution current density [A/m^2]. Nonzero and mutually exclusive with particle_flux_m2_s

Specify exactly one of w_particle and target_macro_particles_per_batch. For a Maxwell distribution, specify exactly one density form and a temperature. For a grid distribution, specify the CSV and exactly one flux form. See Inject Particles Through a Boundary for distribution and CSV-sampling semantics.

[particles.species.boundary]: Per-Species Overrides

Section titled “[particles.species.boundary]: Per-Species Overrides”

This table belongs to the preceding [[particles.species]] entry.

[particles.species.boundary]
z_high = "reflect"
KeyTypeDefaultDescription
x_low, x_highstring"inherit"inherit / open / reflect / redistributed_reflect
y_low, y_highstring"inherit"inherit / open / reflect / redistributed_reflect
z_low, z_highstring"inherit"inherit / open / reflect / redistributed_reflect

inherit uses the global action from [particle_boundary]. A periodic face cannot be overridden. inject_face selects generation for photo_raycast and legacy reservoir_face; the species boundary controls the trajectory after generation. boundary_inflow creates particles from outside and does not override outward actions.

surface_charge_closureEffectRequired conditions
explicitCommit tracked charge directlyDefault
neutral_returnCorrect the PE contribution to zero total surface-charge changeNegative photo_raycast; emission reaction enabled; injection face reflects; no escape / soft_discard; unresolved fraction 5%\le5\%
fixed_currentPreserve the sampled element distribution while scaling its total to a target currentPositive batch_duration; manual target_*_current_a or [surface_current_model]; a raw channel for every nonzero target

fixed_current and neutral_return are mutually exclusive for one species. See Surface-Charge Update Numerical Specification, Photoelectron Emission and Lifecycle, and Output Format Reference for scaling, PE-return double-counting constraints, and sample-count convergence checks.

KeyTypeDefaultDescription
npcls_per_stepint0Macro particles generated per batch. >=0
w_particlefloat1.0Macro-particle weight. >0

Constraints:

ConditionDetails
Particle countWithout boundary inflow, the sum of npcls_per_step over enabled species must be at least 1
Automatic weight resolutionA volume_seed without boundary_inflow cannot use target_macro_particles_per_batch

When the species has boundary_inflow, npcls_per_step=0 is allowed. For a Maxwell distribution, a positive value combines a volume seed with boundary inflow for the same species. Velocity-grid boundary inflow cannot use a positive value.

This table belongs to the preceding [[particles.species]] entry.

[particles.species.boundary_inflow]
z_high = "reservoir"
KeyTypeDefaultDescription
x_low, x_highstringomittedreservoir; omission disables inflow
y_low, y_highstringomittedreservoir; omission disables inflow
z_low, z_highstringomittedreservoir; omission disables inflow

reservoir injects across a complete selected nonperiodic box face, whose effective particle boundary must be open. It combines only with source_mode="volume_seed"; on multiple faces, target_macro_particles_per_batch is the total across all inflow faces. See Inject Particles Through a Boundary for flux and barrier details.

plane_source generates flux along source_normal from an axis-aligned rectangle inside the box.

ConditionDetails
Domain[domain] is required
Timesim.batch_duration > 0 is required
Rectanglepos_low / pos_high are equal on exactly one axis and have positive extent on the other two
PlacementThe normal coordinate lies strictly between box faces; tangential ranges stay inside and may reach box bounds
Directionsource_normal is nonzero along the zero-thickness axis. It is normalized internally; positive or negative unit input is recommended
External correction[reservoir] settings infinity_barrier, phi_infty, and face_potential_grid_n do not apply

Use the common flux-driven-source keys above for its flux and velocity distribution.

source_mode = "reservoir_face" (deprecated)

Section titled “source_mode = "reservoir_face" (deprecated)”

Use the common flux-driven-source keys above. Additional compatibility constraints:

ConditionDetails
Domain[domain] is required
Timesim.batch_duration > 0 is required
Injection faceinject_face is required
Injection rangepos_low / pos_high must lie on the specified face
Weightw_particle and target_macro_particles_per_batch cannot both be specified
Weight sharingtarget_macro_particles_per_batch=-1 is allowed only for species 2 and later. It shares species 1 w_particle

For new cases, use boundary_inflow for an external plasma and plane_source for an internal rectangle. BEACH does not silently convert the legacy mode. See Inject Particles Through a Boundary for CSV and weighting contracts.

KeyTypeDefaultDescription
emit_current_density_a_m2float0.0Emission current density referenced to the ray-normal plane [A/m^2]
rays_per_batchint0Number of launched rays per batch
deposit_opposite_charge_on_emitboolfalseDeposit opposite-sign charge on the emitting element
normal_drift_speedfloat0.0Drift speed along the emission normal [m/s]
ray_directionfloat[3]inward normal of injection faceRay direction

Constraints:

ConditionDetails
Domain[domain] is required
Timesim.batch_duration > 0 is required
Emission amountemit_current_density_a_m2 > 0, rays_per_batch > 0 are required
Injection faceinject_face is required
Particle propertiesq_particle is nonzero, and m_particle > 0
Ray directionMust be normalizable, and its dot product with the inward normal of the injection face must be positive
Unavailable keysnpcls_per_step, number_density_*, w_particle, target_macro_particles_per_batch

See Photoelectron Emission and Lifecycle for ray weighting, periodic images, reabsorption, and closed-PE configuration.


KeyTypeDefaultDescription
modestring"template"auto / obj / template
obj_pathstring"examples/simple_plate.obj"OBJ file path
surface_modelstring"insulator"Surface model for the whole OBJ
surface_sidestringrequired with mode="obj" or "auto"Vacuum side of OBJ panels: normal_plus / normal_minus / outward_closed
obj_scalefloat1.0Uniform scale after loading the OBJ
obj_rotationfloat[3][0,0,0]Rotation angle after loading the OBJ [deg]
obj_offsetfloat[3][0,0,0]Translation after loading the OBJ [m]

With mode="auto", an OBJ is used if obj_path exists; otherwise a template is used. surface_side is still required so either branch has a complete OBJ contract. The OBJ transformation order is scale -> rotate -> offset.

v_new = R(rotation) * (v_old * obj_scale) + obj_offset

For OBJ input, the whole file is read as mesh_id=1. Even if one OBJ contains separate conductor parts, they are treated as the same floating conductor. To treat them as independent conductors, split mesh_id values with template input or another method.

Supported OBJ input:

ItemSupported
NewlinesLF / CRLF
Face linesf v, f v/vt, f v/vt/vn, f v//vn
PolygonsQuadrilaterals and larger polygons are fan-triangulated

Common keys:

KeyTypeDefaultDescription
enabledbooltrueEnable the template
kindstring"plane"plane / plate_hole / plane_hole / disk / annulus / box / cylinder / sphere
surface_modelstring"insulator"insulator / conductor
surface_sidestringrequired when enabled=trueVacuum side of the panel: normal_plus / normal_minus / outward_closed
centerfloat[3][0,0,0]Shape center [m]

When [[mesh.templates]] entries are written, the number of templates actually used is determined by the number of definitions. Disabled templates are not added to the mesh and do not consume a mesh_id.

Overview of kind:

kindGenerated shapeReference plane / axis
planeRectangular planeXY plane, z=center[3]
plate_hole, plane_holeRectangular plane with a circular center holeXY plane, hole center is center
diskDiskXY plane, center is center
annulusConcentric ringXY plane, center is center
boxClosed rectangular-box surfaceSix faces parallel to the axes
cylinderCylinder side surface and optional top/bottom capsz-axis direction
sphereSphere surfaceCenter is center

Splits a rectangle on the XY plane into nx * ny rectangular cells, then splits each cell into two triangles.

KeyTypeDefaultDescription
centerfloat[3][0,0,0]Plane center [x, y, z] [m]
size_xfloat1.0Size in the x direction [m]. > 0
size_yfloat1.0Size in the y direction [m]. > 0
nxint1Number of divisions in the x direction. >= 1
nyint1Number of divisions in the y direction. >= 1

The number of elements is 2 * nx * ny.

A rectangular plate on the XY plane with a circular center hole removed. plane_hole is an alias for plate_hole. The hole boundary is approximated by a polygon with n_theta divisions, and the region from the hole edge to the outer boundary is divided into n_r layers.

KeyTypeDefaultDescription
centerfloat[3][0,0,0]Plate center and hole center [x, y, z] [m]
size_xfloat1.0Size in the x direction [m]. > 0
size_yfloat1.0Size in the y direction [m]. > 0
radiusfloat0.5Hole radius [m]. At runtime, 0 < radius < min(size_x, size_y) / 2
n_thetaint24Circumferential divisions of the hole boundary. >= 3
n_rint4Radial divisions from the hole edge to the outer boundary. >= 1

The outer boundary matches the rectangular boundary. It is an error if the circular hole radius is at least the half-width or half-height. The common default radius=0.5 hits this constraint with the default size_x=size_y=1.0, so specify radius explicitly for plate_hole.

A disk on the XY plane. The interior is divided in polar coordinates and triangulated from the center toward the outer boundary.

KeyTypeDefaultDescription
centerfloat[3][0,0,0]Disk center [x, y, z] [m]
radiusfloat0.5Disk radius [m]. > 0
n_thetaint24Circumferential divisions. >= 3
n_rint4Radial divisions. >= 1

Internally this uses the same generation path as annulus with inner_radius=0.

A concentric ring on the XY plane. The region from inner radius to outer radius is divided into n_r layers.

KeyTypeDefaultDescription
centerfloat[3][0,0,0]Ring center [x, y, z] [m]
radiusfloat0.5Outer radius [m]. > 0
inner_radiusfloat0.25Inner radius [m]. 0 <= inner_radius < radius
n_thetaint24Circumferential divisions. >= 3
n_rint4Radial divisions. >= 1

inner_radius=0 is accepted, but kind="disk" is clearer when creating a disk.

A closed rectangular-box surface. All six faces are triangulated, and vertex ordering is set so normals point outward.

KeyTypeDefaultDescription
centerfloat[3][0,0,0]Box center [x, y, z] [m]
sizefloat[3][1,1,1]Size in the x, y, and z directions [m]. Each component > 0
nxint1Number of divisions in the x direction. >= 1
nyint1Number of divisions in the y direction. >= 1
nzint1Number of divisions in the z direction. >= 1

The number of elements is 4 * (nx * ny + ny * nz + nx * nz). This counts two opposite faces for each axis pair after splitting each rectangular face cell into two triangles.

A cylinder along the z axis. The side surface is split into n_theta * n_z rectangular cells, and top/bottom caps are added as needed.

KeyTypeDefaultDescription
centerfloat[3][0,0,0]Cylinder center [x, y, z] [m]
radiusfloat0.5Cylinder radius [m]. > 0
heightfloat1.0Height in the z direction [m]. > 0
n_thetaint24Circumferential divisions. >= 3
n_zint1Axial divisions. >= 1
capbooltrueEnable both top and bottom caps together
cap_topboolvalue of capTop cap. Overrides cap when specified
cap_bottomboolvalue of capBottom cap. Overrides cap when specified

The cylinder extends from z = center[3] - height/2 to z = center[3] + height/2. The side surface has 2 * n_theta * n_z elements. Each enabled cap adds n_theta triangles.

A sphere surface based on longitude and latitude divisions.

KeyTypeDefaultDescription
centerfloat[3][0,0,0]Sphere center [x, y, z] [m]
radiusfloat0.5Sphere radius [m]. > 0
n_lonint24Longitude divisions. >= 3
n_latint12Latitude divisions. >= 2

The number of elements is 2 * n_lon * (n_lat - 1). Near the poles, each cell uses one triangle; other latitude bands use two triangles.

Surface model:

surface_modelBehavior
insulatorAccumulate the charge of colliding particles on elements
conductorRedistribute element charge for each mesh_id floating conductor so it becomes equipotential while conserving total charge

dielectric and epsilon_r were removed from input because they only acted as metadata aliases without solving polarization. Dielectric polarization, permittivity interface conditions, and internal fields remain unimplemented.

conductor constraints:

  • Redistribute charge with direct Coulomb coefficients under field_boundary.mode="free".
  • Do not combine it with field_boundary.mode="periodic2".
  • Large conductor element counts increase per-batch dense-solve cost.

Element sources use an implicit P0 triangle panel. The former [field] table and sim.softening key have been removed; leaving either in an input fails as an unknown table or key.

ItemRule
SourceTreat each q_elem as a constant surface-charge density over its triangle
Solverdirect / treecode / fmm / auto; auto selects direct / FMM with tree_min_nelem
Surface modelsCommon source discretization for insulator and conductor
Treecodeexact panel near + monopole far
FMMexact panel near + exact triangle P2M
Surface side[mesh].surface_side for OBJ; surface_side on every enabled template

Use outward_closed only for consistently oriented, closed two-manifold components.


KeyTypeDefaultDescription
write_filesbooltrueEnable/disable file output
write_mesh_potentialboolfalseOutput mesh_potential.csv
write_potential_historyboolfalseOutput potential_history.csv; with [domain], also output same-batch top_reference_history.csv
dirstring"outputs/latest"Output directory
history_strideint1History CSV interval [batch]. >=0; 0 disables
checkpoint_strideint0Restart-checkpoint interval [accepted batches]. >=0; 0 disables periodic output; positive values require write_files=true
resumeboolfalseResume from an existing checkpoint
restart_fromstringnoneCheckpoint source when resume=true; requires write_files=true

See Output Format Reference for file-generation conditions, columns, potential conventions, matching-plane state, and ledger interpretation.

Requirements for resume=true:

ConditionDetails
Outputwrite_files=true is required
SourceIf restart_from is unspecified, use output.dir; otherwise use restart_from
Required filessummary.txt, charges.csv, and either serial rng_state.txt or every MPI rng_state_rankNNNNN.txt; schema v8+ also requires checkpoint_complete.txt
Conditional filescharge_ledger.csv when ledger metadata is present
Conditional stateSchema v8+ requires macro_residuals.csv when declared by checkpoint_complete.txt; legacy schemas restore it when present
BehaviorIf a required checkpoint is missing, stop instead of falling back to a new run

restart_from changes only the checkpoint read source. New output is always written to output.dir.

See Files Used for Resume for periodic-slot selection, MPI-required files, mesh identity, and schema compatibility.


Coordinate and Placement Helper Parameters

Section titled “Coordinate and Placement Helper Parameters”

These keys convert box-relative values to physical coordinates and dimensions.

KeyTypeDefaultEffect and constraints
domain.box_originfloat[3]unspecifiedSets box_min; pair with box_size; mutually exclusive with box_min / box_max
domain.box_sizefloat[3]unspecifiedSets box_max=box_origin+box_size; every component >0
inject_region_modestring"absolute"absolute / face_fraction; face_fraction only for reservoir_face / photo_raycast
uv_low, uv_highfloat[2]unspecifiedBoth required for face_fraction; components in [0,1]; mutually exclusive with pos_low / pos_high
Template placement_modestring"absolute"absolute / box_anchor
Template anchorstringunspecifiedBox center or one of six face centers for box_anchor
Template offsetfloat[3]unspecifiedOffset from anchor [m]; mutually exclusive with offset_frac
Template offset_fracfloat[3]unspecifiedBox-size-relative offset; mutually exclusive with offset
Template size_modestring"absolute"absolute / box_fraction
Template size_fracfloat / float[2] / float[3]unspecifiedRequired for box_fraction; every component >0; replaces dimensions by kind as listed below
Template groupstringunspecifiedName in [mesh.groups.<name>]; nonempty
Template center_localfloat[3]unspecifiedRequired with group; center=group_origin+group_scale*center_local
Group placement_modestring"absolute"absolute / box_anchor
Group anchorstringunspecifiedBox center or one of six face centers for box_anchor
Group offsetfloat[3]unspecifiedOffset added to group origin [m]; mutually exclusive with offset_frac
Group offset_fracfloat[3]unspecifiedBox-size-relative offset; mutually exclusive with offset
Group scalefloat1.0Multiplies group coordinates and explicit dimensions. >0; mutually exclusive with scale_from / scale_factor
Group scale_fromstringunspecifiedBox-size reference; specify together with scale_factor
Group scale_factorfloatunspecifiedPositive multiplier for scale_from. >0

With group, a template cannot also use center, direct-placement keys, size_mode, or size_frac.

The dimensions replaced by size_mode="box_fraction" depend on kind.

kindsize_fracReplaced keys
plane, plane_hole, plate_holefloat[2]size_x, size_y
boxfloat[3]size
spherefloatradius, referenced to the minimum of the three box dimensions
cylinderfloat[2]radius, height; radius uses the minimum x/y box size and height uses z size

Helper-parameter choices:

  • Group scaling applies only to explicitly specified size_x, size_y, size, radius, inner_radius, and height.
  • anchor accepts box_center or each axis’s *_low_face_center / *_high_face_center.
  • scale_from accepts box_x, box_y, box_z, box_min_xy, box_max_xy, box_min_xyz, or box_max_xyz.
  • placement_mode="absolute", size_mode="absolute", and inject_region_mode="absolute" preserve direct values.

Run beachx lint from Create and Validate beach.toml before execution.


ItemRule
Unknown keysAll are errors
[particles]Used only as the container for [[particles.species]]. Do not write key = value directly under it
Old keysOld names are treated as unknown keys
TypeValidated by both the schema and the Fortran parser
Enums, ranges, and settings for inactive featuresbeachx lint provides detailed diagnostics; Fortran checks minimum prerequisites for execution

The following old sim keys are rejected as unknown keys by the schema, Python, and Fortran. They are not migrated implicitly.

Rejected old keysCurrent location
sim.box_min / sim.box_max / sim.box_origin / sim.box_sizeSame-named keys under domain
sim.bc_x_low / sim.bc_x_high / sim.bc_y_low / sim.bc_y_high / sim.bc_z_low / sim.bc_z_highPeriodicity in domain.periodic_axes; particle face actions in particle_boundary
sim.use_boxPublic flag removed; specify the domain under domain
sim.field_bc_modefield_boundary.mode
sim.phi_inftyreservoir.phi_infty
sim.injection_face_phi_grid_nreservoir.face_potential_grid_n

Before running, this is recommended.

Terminal window
beachx lint beach.toml