bloc.simulation_builder#

YAML-driven network builder exposing a simple sim.solve() API.

Bridges Bloc and Boulder to construct and solve Cantera reactor networks directly from STONE YAML files. The pipeline goes through BlocRunner so Bloc-specific normalisation, mechanism resolution, and plugin registration all flow through one class hierarchy.

Public API#

>>> from bloc.simulation_builder import build_simulation_from_yaml
>>> sim = build_simulation_from_yaml("sandbox/from_boulder/design_torch_psr_pfr.yaml")
>>> net, results = sim.solve()

Classes#

Simulation

Thin wrapper around a solved STONE YAML network.

Functions#

build_simulation_from_yaml(yaml_path)

Build a Simulation from STONE YAML.

Module Contents#

class bloc.simulation_builder.Simulation(config, results, result=None)#

Thin wrapper around a solved STONE YAML network.

Provides a minimal, stable API for downstream scripts and notebooks, and exposes a SimulationResult as result for typed access to the staged network, trajectory, per-reactor states and plugin scalars.

The central object is network, a StagedReactorNet — a ReactorNet-compatible staged network facade. It is not a single global CVODE integrator; staged solves with mechanism switches and custom PFR solvers are not one monolithic ODE problem.

Key accessor pattern:

sim.network                              # StagedReactorNet
sim.network.draw(...)                    # delegates to viz network
sim.network.get_stage("default")         # PFRHomogeneousShellNet / DesignTubeFurnaceNet
sim.network.networks                     # {stage_id: stage solver}
sim.network.visualization_network        # raw ct.ReactorNet (Sankey etc.)
config#
results#
result = None#
solve()#

Return the staged network facade and results captured during build.

property network: boulder.staged_network.StagedReactorNet#

The StagedReactorNet facade.

property reactors#

Convenience delegate to network.reactors.

property trajectory#

Convenience delegate to network.trajectory.

property scalars: Dict[str, Any]#

Convenience delegate to network.scalars.

bloc.simulation_builder.build_simulation_from_yaml(yaml_path)#

Build a Simulation from STONE YAML.

All loading, normalisation, validation, mechanism resolution, and plugin registration flow through BlocRunner.

sim.network is a StagedReactorNet — a ReactorNet-compatible staged network facade that owns both the global visualization ReactorNet (sim.network.visualization_network) and the stage solver networks (sim.network.networks).

Parameters:

yaml_path – Path to a STONE-standard YAML config defining components and connections.