BoltzmannSolvers
Documentation for BoltzmannSolvers.
BoltzmannSolvers.BOLSIGExplicitRunBoltzmannSolvers.BOLSIGFixedRunBoltzmannSolvers.BOLSIGInputBoltzmannSolvers.BOLSIGRun2DBoltzmannSolvers.BOLSIGRunResultBoltzmannSolvers.BOLSIGSaveResultsBoltzmannSolvers.BOLSIGSeriesRunBoltzmannSolvers.BOLSIGSeriesSegmentBoltzmannSolvers.LoKIInputBoltzmannSolvers.LoKISmartGridBoltzmannSolvers.MultiBoltDefinedSweepBoltzmannSolvers.MultiBoltInputBoltzmannSolvers.MultiBoltLinearSweepBoltzmannSolvers.MultiBoltLogSweepBoltzmannSolvers.MultiBoltRegularSweepBoltzmannSolvers.MultiBoltRunResultBoltzmannSolvers.MultiBoltSpeciesBoltzmannSolvers.MultiBoltSweepBoltzmannSolvers.MultiBoltXsecScaleBoltzmannSolvers.NamedInterpolationDerivativeBoltzmannSolvers._bolsig_normalize_processBoltzmannSolvers._load_loki_hdf5BoltzmannSolvers._multibolt_argsBoltzmannSolvers._parse_loki_hdf5_reactionsBoltzmannSolvers.create_interpolationBoltzmannSolvers.derivative_ofBoltzmannSolvers.load_raw_dataframeBoltzmannSolvers.load_raw_dataframeBoltzmannSolvers.normalize_reaction_namesBoltzmannSolvers.parse_reaction_namesBoltzmannSolvers.parse_reaction_namesBoltzmannSolvers.parse_reaction_namesBoltzmannSolvers.read_bolsig_inputBoltzmannSolvers.read_loki_inputBoltzmannSolvers.run_solverBoltzmannSolvers.run_solverBoltzmannSolvers.write_bolsig_input
BoltzmannSolvers.BOLSIGExplicitRun — TypeBOLSIGExplicitRun(values)RUN followed by explicit data rows — BOLSIG+'s manual/arbitrary-list scan. values is n_runs × n_var_fields; column order matches the order VAR appears in BOLSIGConditions (see _BOLSIG_CONDITIONS_SCALAR_FIELDS, then gas_fractions). Multiple BOLSIGExplicitRuns may appear in one BOLSIGInput's runs (BOLSIG+ allows repeated RUN blocks that all enqueue rows in sequence).
BoltzmannSolvers.BOLSIGFixedRun — TypeBOLSIGFixedRun()A bare RUN: a single run at the current BOLSIGConditions (no VAR fields need to be resolved).
BoltzmannSolvers.BOLSIGInput — TypeBOLSIGInput(; noscreen=true, nologfile=true, collisions, conditions, runs, save=nothing)Configuration for one standalone BOLSIG+ run script. save is nothing only when every entry in runs is a BOLSIGRun2D (which writes its own output file and doesn't need a SAVERESULTS block).
See read_bolsig_input/write_bolsig_input to parse/emit the actual .dat script format.
BoltzmannSolvers.BOLSIGRun2D — TypeBOLSIGRun2D(variable1, min1, max1, num1, type1, min2, max2, num2, type2, output_file)A RUN2D block: a 2D parametric scan. The first variable is identified by code (like BOLSIGSeriesSegment); the second is whichever BOLSIGConditions field is marked VAR (there's no numeric code for arbitrary second dimensions, e.g. a gas-mixture fraction). Writes its own output_file directly, bypassing BOLSIGSaveResults.
Note: BOLSIG() (src/solvers/bolsig.jl) does not read RUN2D's 2D output format — this type only supports generating the input, not reading the result back.
BoltzmannSolvers.BOLSIGRunResult — TypeBOLSIGRunResultResult of run_solver(::BOLSIGInput; ...).
workdir— the temporary directory the run happened in (input.dat, symlinked/copied collision files,bolsiglog.txt, and any output files all live here).output_files— absolute paths to every file BOLSIG+ was configured to write (input.save.fileif present, plus anyBOLSIGRun2D.output_file).success— whether every entry inoutput_filesexists after running. Not derived fromexit_code(see module notes — exit code 2 is BOLSIG+'s normal termination, not a failure indicator).exit_code,log— the process's exit code and combined stdout/stderr, for diagnostics whensuccessisfalse.
BoltzmannSolvers.BOLSIGSaveResults — TypeBOLSIGSaveResults(; file, format, kwargs...)format is BOLSIG+'s output-layout code (1-6). The three layouts load_dataframe(BOLSIG(), ...) actually reads: 1 (Run by run) → the single-run report format, 2 (Combined) → the condensed R#/A#/C# table format, 3 (E/N) → the verbose block-per-quantity format. 4 (Energy), 5 (SIGLO), and 6 (PLASIMO) are not read by BOLSIG().
BoltzmannSolvers.BOLSIGSeriesRun — TypeBOLSIGSeriesRun(segments)One or more chained RUNSERIES blocks — BOLSIG+ concatenates consecutive RUNSERIES blocks targeting the same or different ranges into one combined scan (e.g. the reference example1.dat's 40 points come from two segments, 31 exponentially-spaced + 9 linearly-spaced).
BoltzmannSolvers.BOLSIGSeriesSegment — TypeBOLSIGSeriesSegment(variable, min, max, count, type)One RUNSERIES block: a formula-based range scan over variable (identified by code, not by a VAR marker in BOLSIGConditions).
BoltzmannSolvers.LoKIInput — TypeLoKIInput(; kwargs...)Configuration of a LoKI-B electron-kinetics run, as described by the workingConditions and electronKinetics sections of a .in setup file (see read_loki_input). Species, states, and model choices are plain strings in LoKI's own notation; raw holds the full parsed setup tree (chemistry, output, GUI, ... configuration).
Conditions given as linspace/logspace/vector scans are kept as vectors (reduced_field, electron_temperature).
BoltzmannSolvers.LoKISmartGrid — TypeLoKISmartGrid(; min_eedf_decay=20.0, max_eedf_decay=25.0, update_factor=0.05)LoKI-B's adaptive energy-grid settings (numerics.energyGrid.smartGrid): the grid boundary is moved until the EEDF falls between min_eedf_decay and max_eedf_decay decades below its maximum.
BoltzmannSolvers.MultiBoltDefinedSweep — TypeMultiBoltDefinedSweep(values)--sweep_style def v1 v2 ... — an explicit list of values, MultiBolt's manual/arbitrary-list scan (the analog of BOLSIG+'s BOLSIGExplicitRun).
BoltzmannSolvers.MultiBoltInput — TypeMultiBoltInput(; kwargs...)Configuration for one MultiBolt run. Unlike BOLSIGInput, this isn't read from/written to a file — MultiBolt takes its configuration entirely as command-line arguments — so MultiBoltInput is only ever translated into an argument vector (via _multibolt_args, used by run_solver(::MultiBoltInput; ...)), not serialized.
Required: cross_section_files, species, export_name. Everything else has a default matching MultiBolt's own CLI defaults, or nothing/false meaning "don't pass this flag, let MultiBolt use its own default".
BoltzmannSolvers.MultiBoltLinearSweep — TypeMultiBoltLinearSweep(start, stop, count)--sweep_style lin start stop count.
BoltzmannSolvers.MultiBoltLogSweep — TypeMultiBoltLogSweep(log10_start, log10_stop, count)--sweep_style log log10(start) log10(stop) count.
BoltzmannSolvers.MultiBoltRegularSweep — TypeMultiBoltRegularSweep(start, step, stop)--sweep_style reg start step stop.
BoltzmannSolvers.MultiBoltRunResult — TypeMultiBoltRunResultResult of run_solver(::MultiBoltInput; ...).
workdir— the temporary directory used as--export_location.output_dir—joinpath(workdir, config.export_name), where MultiBolt actually wrote its output — pass this directly toload_dataframe(MultiBolt(), ...).success—exit_code == 0 && isdir(output_dir).exit_code,log— the process's exit code and combined stdout/stderr, for diagnostics whensuccessisfalse.
BoltzmannSolvers.MultiBoltSpecies — TypeMultiBoltSpecies(name, fraction)--species name fraction. name is matched against whatever species are identifiable (as reactants/products) in the files listed in MultiBoltInput.cross_section_files — there's no explicit file→species pairing at the CLI level the way BOLSIGReadCollisions pairs one file with its species.
BoltzmannSolvers.MultiBoltSweep — TypeMultiBoltSweep(variable, style)--sweep_option <variable> + the args from style. variable's current value in MultiBoltInput (e.g. EN_Td) acts as a placeholder, silently overridden by the sweep — no VAR-marker mechanism is needed here the way BOLSIG+'s CONDITIONS block needs one (confirmed against MultiBolt's own example_sweep_calculations_EN_Td.sh, which passes a concrete --EN_Td 100 alongside --sweep_option EN_Td).
BoltzmannSolvers.MultiBoltXsecScale — TypeMultiBoltXsecScale(process, scale)--scale_Xsec process scale — a scalar weight applied to one named collision process.
BoltzmannSolvers.NamedInterpolationDerivative — TypeNamedInterpolationDerivative(name, itp)d/dx of a NamedInterpolation's interpolation. Symbolics needs this as its own callable object: a registered function is opaque to symbolic differentiation, so without a registered derivative any Jacobian built symbolically through an interpolation sees zero — silently freezing implicit solves that must invert a tabulated quantity.
BoltzmannSolvers._bolsig_normalize_process — Method_bolsig_normalize_process(desc) -> StringNormalize a raw BOLSIG+ collision description into a compact reaction string, e.g. "Ar Effective (momentum)" -> "Effective(Ar)", "Ar Excitation 11.50 eV" -> "Excitation(Ar,11.50eV)". Falls back to the original string, unmodified, if the description doesn't match the expected <species> <type> [threshold eV] shape rather than guessing.
BoltzmannSolvers._load_loki_hdf5 — Method_load_loki_hdf5(source)Overridden by ext/BoltzmannSolversHDF5Ext.jl once HDF5.jl is loaded.
BoltzmannSolvers._multibolt_args — Method_multibolt_args(config::MultiBoltInput, export_location::AbstractString) -> Vector{String}Translate config into the argument vector multibolt_linux/ multibolt_win64.exe expects, with --export_location fixed to export_location (managed by run_solver(::MultiBoltInput; ...)).
BoltzmannSolvers._parse_loki_hdf5_reactions — Method_parse_loki_hdf5_reactions(source)Overridden by ext/BoltzmannSolversHDF5Ext.jl once HDF5.jl is loaded.
BoltzmannSolvers.create_interpolation — Method`create_interpolation(df::DataFrame, y_name, x_name; name=y_name)`Create interpolation object y(x) from DataFrame df. y_name is the column of the dependent variable, x_name is the column name of the independent variable.
Returns a NamedInterpolation which works with Symbolics.jl and can be used in ModelingToolkit.jl models.
BoltzmannSolvers.derivative_of — MethodThe derivative object of a NamedInterpolation (see NamedInterpolationDerivative).
BoltzmannSolvers.load_raw_dataframe — Methodload_raw_dataframe(::BOLSIG, source; kwargs...)Read a single BOLSIG+ output file (source is a file path, unlike LoKI/ MultiBolt which take a directory — BOLSIG+ writes one output file per run). Auto-detects which of BOLSIG+'s three result layouts the file uses (condensed R#/A#/C# tables, a verbose block-per-quantity wrapped-table format, or a single-run R#-header name/value report) and returns one row per scanned condition (or a single row, for the single-run format).
BoltzmannSolvers.load_raw_dataframe — Methodload_raw_dataframe(::LoKI, source; kwargs...)source is either a directory containing LoKI-B's plain-text lookup tables (lookUpTableSwarm.txt, lookUpTableRateCoeff.txt, and optionally lookUpTablePower.txt) or a single .h5 file — LoKI-B's HDF5 export of the same simulation (requires using HDF5, see _load_loki_hdf5).
BoltzmannSolvers.normalize_reaction_names — Methodnormalize_reaction_name!(x)Normalize the reaction name using PlasmaSpecies.jl. If PlasmaSpecies.jl is not loaded, this is a NOP. PlasmaSpecies is NOT loaded!
BoltzmannSolvers.parse_reaction_names — Methodparse_reaction_names(::BOLSIG, source)Map each rate-coefficient column produced by load_raw_dataframe to a normalized reaction string via _bolsig_normalize_process.
BoltzmannSolvers.parse_reaction_names — Methodparse_reaction_names(::LoKI, source)source is either a directory containing lookUpTableRateCoeff.txt (LoKI-B's plain-text lookup-table output) or a single .h5 file (LoKI-B's HDF5 export — requires using HDF5, see _load_loki_hdf5).
BoltzmannSolvers.parse_reaction_names — Methodparse_reaction_names(::Multibolt, source)Do nothing. For MultiBolt it is more convenient to parse the reaction process already in load_raw_dataframe.
BoltzmannSolvers.read_bolsig_input — Methodread_bolsig_input(path) -> BOLSIGInputParse a BOLSIG+ input script into a BOLSIGInput. Expects one standalone script (see BOLSIGInput's docstring) — a file that concatenates multiple scripts via CLEARCOLLISIONS/CLEARRUNS resets (like _research/bolsig/input-examples.dat) should be split into separate files first.
BoltzmannSolvers.read_loki_input — Methodread_loki_input(path) -> LoKIInputParse a LoKI-B .in setup file. The workingConditions, electronKinetics (cross-section files, gas fractions, state populations, growth/ionization/e-e model choices) and numerics sections map onto LoKIInput fields; the complete parsed tree — including sections this struct does not model (chemistry, output, state energies and statistical weights, ...) — is kept in raw.
BoltzmannSolvers.run_solver — Methodrun_solver(input::BOLSIGInput; bolsig_path=nothing, collision_dir=pwd()) -> BOLSIGRunResultWrite input to a temporary directory (via write_bolsig_input, which also validates it), place every collision file it references alongside it, and run BOLSIG+ there.
bolsig_path— path to thebolsigminusexecutable. Resolved from this keyword argument first, then theBOLSIGMINUS_PATHenvironment variable; errors clearly if neither is given.collision_dir— directory to look up eachBOLSIGReadCollisions.filebare filename in (BOLSIG+'s input format can't reference collision files by absolute or subdirectory-relative path — see module notes). Defaults to the current working directory.
Example
result = run_solver(input; bolsig_path="/opt/bolsig/bolsigminus")
result.success || error("BOLSIG+ run failed:\n$(result.log)")
df = load_dataframe(BOLSIG(), result.output_files[1])BoltzmannSolvers.run_solver — Methodrun_solver(config::MultiBoltInput; multibolt_path=nothing) -> MultiBoltRunResultRun MultiBolt with config, exporting to a fresh temporary directory.
multibolt_path — path to the multibolt_linux/multibolt_win64.exe executable. Resolved from this keyword argument first, then the MULTIBOLT_PATH environment variable; errors clearly if neither is given.
Example
result = run_solver(config; multibolt_path="/opt/multibolt/multibolt_linux")
result.success || error("MultiBolt run failed:\n$(result.log)")
df = load_dataframe(MultiBolt(), result.output_dir)BoltzmannSolvers.write_bolsig_input — Methodwrite_bolsig_input(path, input::BOLSIGInput)Write input as a valid BOLSIG+ input script. Validates that conditions' VAR markers are consistent with what runs actually declares as swept (a BOLSIGExplicitRun's column count, a BOLSIGRun2D's second variable) before writing — BOLSIGSeriesRun identifies its variable by code and doesn't need or use a VAR marker.