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#
Thin wrapper around a solved STONE YAML network. |
Functions#
|
Build a |
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
SimulationResultasresultfor typed access to the staged network, trajectory, per-reactor states and plugin scalars.The central object is
network, aStagedReactorNet— 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
StagedReactorNetfacade.
- 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
Simulationfrom STONE YAML.All loading, normalisation, validation, mechanism resolution, and plugin registration flow through
BlocRunner.sim.networkis aStagedReactorNet— a ReactorNet-compatible staged network facade that owns both the global visualizationReactorNet(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.