Skip to content

Simulation

Simulation is the primary high-level builder in rfx. It owns the domain, boundary conditions, geometry, sources, probes, ports, and the time-domain run.

from rfx import Simulation
sim = Simulation(
freq_max=4e9,
domain=(0.08, 0.06, 0.025),
boundary="cpml",
cpml_layers=8,
dx=1e-3,
mode="3d",
)

Key constructor arguments:

ArgumentMeaningNotes
freq_maxhighest frequency of interestdrives mesh and timestep selection
domain(x, y, z) domain size in metresrequired unless derived by automation
boundaryboundary typethe public docs currently center on cpml
cpml_layersabsorber thicknessdefault is 8
pec_facesface-based PEC truncationuse for boundaries, not for a finite antenna ground plane
dxbase lateral cell sizemay be inferred by automation
dz_profile / dx_profile / dy_profilenon-uniform cell profilesworkflow helper for thin-substrate or graded meshes
solversolver familythe public reference lane is currently Yee

Ground-plane rule: if the structure needs a finite ground plane, model it as geometry. Do not use pec_faces={"z_lo"} as a substitute for antenna ground-plane metal.

MethodPurposePublic note
add(shape, material=...)fill geometry with a named materialgeometry should stay explicit in public examples
add_material(...)register a named materialuse this for custom dielectric / conductive / dispersive media
add_source(...)inject a soft point sourcepreferred for ringdown and Harminv work
add_port(...)add a lumped or wire portuse for impedance-normalized S-parameters within the lumped/wire evidence envelope
add_probe(...)record a point observablefeeds Result.find_resonances()
add_ntff_box(...)accumulate far-field datause only when the radiation workflow is benchmarked
preflight(strict=False)validate setup before a long runuse this when you want deterministic warnings/errors on unsupported combinations
run(...)advance the simulationreturns a Result object
result = sim.run(n_steps=8000, compute_s_params=True)

run() returns a tuple-like Result object with fields such as time_series, s_params, freqs, ntff_data, and grid. For S-parameter claims, use the port-family evidence levels in the support matrix rather than the presence of s_params alone.

Simulation also exposes a convenience constructor:

sim = Simulation.auto(freq_range=(1.5e9, 3.5e9), accuracy="standard")

Use Simulation.auto() when you want a quick starting point. Use the lower-level constructor when you need to inspect or override the derived setup.

This page covers the supported builder surface only. Lower-level solver internals, generated symbol inventories, and research-grade extensions belong in /rfx/api/generated/ until they are promoted here.