Skip to content

fugacio.sim

The differentiable process-simulation layer (depends on fugacio.thermo): streams, energy-balanced unit operations, a recycle/tear solver, columns, reactors, optimization, economics, and the time-domain dynamics, control, and heat-integration toolkits. Import the public surface from the package root:

from fugacio.sim import Stream, flash_drum, tear_solve, linear_mpc, pinch_analysis

Differentiable process-simulation layer for Fugacio (depends on fugacio.thermo).

The layer provides:

  • Stream: the differentiable material stream passed between units;
  • a stream property bridge (enthalpy_flow, entropy_flow, molar_enthalpy, molar_entropy, mass_flow) that gives any stream a two-phase-aware enthalpy/entropy via fugacio.thermo;
  • unit operations with rigorous material and energy balances (flash_drum, adiabatic_flash, heater, valve, pump, compressor, turbine, mix, splitter, component_separator), each a compile-once kernel that reports failures (see fugacio.sim.units for the contract and fugacio.sim.unit_limits for the operating limits);
  • enable_compilation_cache, an opt-in persistent compilation cache so a new process reuses the compiled kernels of an earlier one;
  • package_for, which turns component names and a method name into a ready cubic, gamma-phi, PC-SAFT, or reference-fluid fugacio.thermo.PropertyPackage;
  • liquid-liquid and three-phase separators (decanter, three_phase_flash) and binary diagram / azeotrope / residue-curve helpers (pxy_diagram, txy_diagram, azeotrope_pressure, azeotrope_temperature, residue_curve, residue_curve_map);
  • reactor unit operations (equilibrium_reactor, stoichiometric_reactor, cstr, pfr, batch_reactor) and reactive separations (reactive_flash, reactive_column);
  • a differentiable optimization toolkit (minimize, argmin, least_squares) that differentiates through the optimum by the implicit function theorem;
  • design specifications and set-point controllers (meet_spec, solve_design, controller) that adjust a degree of freedom to hit a target, plus end-to-end flowsheet optimization (optimize_flowsheet);
  • equipment sizing, Turton bare-module costing, utility pricing, and financial metrics (heat_exchanger_area, bare_module_cost, utility_cost, total_annual_cost, npv) for money-valued design objectives;
  • differentiable heat integration / pinch analysis (pinch_analysis, composite_curves, grand_composite_curve, area_target, optimal_dt_min, synthesize_network) for minimum-utility targets and heat-exchanger-network synthesis (see fugacio.sim.integration);
  • advanced process control: model predictive control and state estimation (linear_mpc, nonlinear_mpc, solve_qp, dare, lqr, kalman_gain, KalmanFilter, ExtendedKalmanFilter, UnscentedKalmanFilter, moving_horizon_estimate, simulate_closed_loop, tune_mpc), differentiable end to end, so the controller weights are tunable by gradient descent (see fugacio.sim.mpc);
  • physical steam/cooling-water utilities on IAPWS-95 steam tables (steam_heating, cooling_water, steam_turbine, condensate_flash_fraction) for utility balances with real latent heats, differentiable end to end;
  • the original lightweight modified-Raoult helpers (bubble_pressure, antoine_psat).

Where to look next

Area Page Key symbols
Streams & properties Streams & properties Stream, enthalpy_flow, molar_enthalpy, liquid_density
Unit operations Unit operations flash_drum, adiabatic_flash, heater, pump, compressor, mix, decanter, unit_limits, enable_compilation_cache
Flowsheet & recycle Flowsheet & recycle Flowsheet, FlowsheetResult, UnitRecord, tear_solve_with_info, continuation_solve
Process acceptance Process acceptance audit_stream, flash_drum_checked, audit_flowsheet, BalanceBoundary
Process cases & studies Process cases & studies ProcessCase, CaseRunner, SolverOptions, sweep, optimize, sensitivities
Two-sided heat exchanger Two-sided heat exchanger heat_exchanger, HeatExchangerResult
Equation-oriented flowsheeting Equation-oriented flowsheeting EOFlowsheet, Flash, HeatExchanger, Column, optimize_flowsheet_eo
Thermodynamic models Thermodynamic models package_for, METHODS, helmholtz_package_for, UnifacModel
Rigorous distillation Rigorous distillation rigorous_column, ColumnFeed, reflux_ratio, purity, absorber, stripper
Distillation & diagrams Distillation & diagrams shortcut_column, relative_volatility, pxy_diagram, residue_curve_map
Reactors Reactors & reactive separations equilibrium_reactor, cstr, pfr, stoichiometric_reactor, reactive_flash, reactive_column
Optimization & design Optimization & design minimize, argmin, meet_spec, optimize_flowsheet
Economics & sizing Economics & sizing heat_exchanger_area, bare_module_cost, total_annual_cost, npv
Dynamics & control Dynamics & control odeint, integrate, PID, DynamicFlowsheet, tune_pid
Advanced control (MPC) Advanced control (MPC) linear_mpc, nonlinear_mpc, solve_qp, KalmanFilter, tune_mpc
Heat integration Heat integration pinch_analysis, composite_curves, optimal_dt_min, synthesize_network
Steam & cooling utilities Steam & cooling utilities steam_heating, cooling_water, steam_turbine

See the flowsheeting guide, the rigorous distillation guide, the optimization & economics guide, the equation-oriented flowsheeting guide, the dynamics & control guide, the advanced-control guide, and the heat-integration guide for worked examples.