Skip to main content

Crate chrom_rs

Crate chrom_rs 

Source
Expand description

chrom-rs: Chromatography Simulation Framework

A flexible and extensible framework for simulating liquid chromatographic processes using numerical methods. Built with Rust for performance and safety.

§Architecture

chrom-rs is built on two core principles:

  1. Separation of physics and numerics — physical models define the equations (what to solve); numerical solvers provide the integration method (how to solve them). The same model can be solved with any solver, and the same solver can integrate any model.

  2. Extensibility and type safety — all extension points are traits; state is managed through typed containers; the API is stable from v0.1.0 onwards.

§Quick Start

use chrom_rs::physics::{PhysicalModel, PhysicalState, PhysicalQuantity, PhysicalData};
use chrom_rs::solver::{EulerSolver, Solver, SolverConfiguration, Scenario, DomainBoundaries};
use nalgebra::DVector;
use serde::{Deserialize, Serialize};

// 1. Configure physical model and scenario
let model = Box::new(MyModel);
let initial_state = model.setup_initial_state();
let boundaries = DomainBoundaries::temporal(initial_state);
let scenario = Scenario::new(model, boundaries);

// 2. Configure solver
let config = SolverConfiguration::time_evolution(
    600.0,    // 10 minutes total time
    1000,     // 1000 time steps
);

// 3. Run simulation
let solver = EulerSolver::new();
let result = solver.solve(&scenario, &config)?;

// 4. Access results
println!("Simulation completed!");
println!("Trajectory length: {}", result.len());

§Modules

ModuleRole
physicsCore traits and data types for physical models
modelsConcrete chromatography models (Langmuir single and multi-species)
solverNumerical solvers, scenario definition, and simulation result
configYAML/JSON configuration file loaders
outputCSV export, JSON export, and chromatogram visualisation
cliCommand-line interface built on dynamic-cli
preludeConvenience re-exports for the most common types

Modules§

cli
Command-line interface.
config
Configuration file loaders for the three-file layout.
domain
Physical domain model — equipment description layer.
models
Concrete chromatography models.
output
Result visualisation and data export.
physics
Physical model traits, state containers, and data types.
prelude
Convenient re-exports for the most commonly used types.
solver
Numerical solvers and simulation infrastructure.