reactor-sizing-and-kinetics
Skill7 starsChanged 6 months agoApache-2.0View on GitHub
Fit Arrhenius parameters from k(T) data and size isothermal CSTR, PFR, or batch reactors for nth-order or arbitrary user-supplied rate laws. Includes N-CSTRs-in-series and a numeric PFR integrator. Use when designing or rating a reactor or fitting laboratory rate data. Don't use for non-isothermal reactors (energy balance not included), heterogeneous catalysis with pore diffusion (Thiele modulus not covered), or polymerization with moments-based balances.
In this repository31 other files it gives its agents.
- absorption-stripping-designSkill
- bayesian-hierarchical-process-modelsSkill
- caustic-merox-extractionSkill
- censored-regressionSkill
- compositional-data-analysisSkill
- control-valve-sizing-isa75Skill
- convective-heat-transfer-correlationsSkill
- design-of-experimentsSkill
- dimensionless-numbersSkill
- distillation-shortcut-designSkill
- distributed-lag-modelsSkill
- engg-skills-commonSkill
- engineering-skill-creatorSkill
- engineering-statisticsSkill
- equation-of-state-selectionSkill
- heat-exchanger-sizingSkill
- literature-search-engineeringSkill
- material-energy-balancesSkill
- pipe-flow-pressure-dropSkill
- process-causal-inference-dagsSkill
- process-units-conversionSkill
- relief-valve-sizing-api520Skill
- separator-vessel-sizingSkill
- sour-gas-amine-treatingSkill
- statistical-process-controlSkill
- steam-tables-iapwsSkill
- thermo-process-propertiesSkill
- time-series-process-data-analysisSkill
- two-phase-flowSkill
- uvSkill
- vle-flash-calculationsSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 107
Run the listed script with representative inputs and an --output file when a deterministic calculation is available.
- Distinctive: line 109
Check result magnitudes against the stated assumptions, references, and a hand calculation or known operating range before reporting them.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Reactor Sizing and Kinetics
Overview
Isothermal liquid-phase reactor design equations from first principles:
- Arrhenius fit (
A,Ea) from temperature / rate-constant data. - CSTR / PFR / batch volume or time for nth-order kinetics (analytical).
- N equal-sized CSTRs in series for 1st-order kinetics.
- Numerical PFR for any user-defined rate law (Langmuir-Hinshelwood, Michaelis-Menten, reversible reactions).
Prerequisites
uvavailable.- On first use, the script writes
LICENSE_NOTIFICATION.txt.
When to Use
- Sizing a CSTR, PFR, or batch reactor for a known rate law.
- Fitting
AandEafrom experimental data at multiple temperatures. - Comparing CSTR-in-series vs single PFR for a target conversion.
Don't use for
- Non-isothermal design (no energy balance — would need a coupled
T(z)orT(t)solver). - Heterogeneous catalysis with pore diffusion (Thiele modulus, effectiveness factor not covered).
- Multiple parallel reactions where selectivity matters (extension needed).
- Polymerization moments / chain-length distribution work.
- Bioreactors with cell death / inhibition (use a specialised model).
Utility Scripts
uv run scripts/reactor.py arrhenius --temperatures 298,308,318,328 --k-values 1.2e-3,2.4e-3,4.8e-3,9.5e-3 --output /tmp/arr.jsonuv run scripts/reactor.py cstr --C0 1000 --conversion 0.9 --flow 0.001 --k 5e-4 --order 1 --output /tmp/cstr.jsonuv run scripts/reactor.py pfr --C0 1000 --conversion 0.9 --flow 0.001 --k 5e-4 --order 2 --output /tmp/pfr.jsonuv run scripts/reactor.py batch --C0 1000 --conversion 0.9 --k 5e-4 --order 1 --output /tmp/batch.jsonuv run scripts/reactor.py series --C0 1000 --conversion 0.95 --flow 0.001 --k 5e-4 --N 3 --output /tmp/series.json
Procedure
- Fit the rate constant if you have temperature data:
arrhenius. - Pick reactor type from process needs:
- CSTR: tight T control, easy fouling cleanout, lower conversion per volume for positive-order kinetics.
- PFR: higher conversion per volume for positive-order; flow regime matters (turbulent assumed in the simple formulas).
- Batch: small / specialty / multi-product.
- Compute volume or time at the design conversion.
- Sensitivity: re-run with
+10%/-10%inkto bracket uncertainty in the rate constant. - Compare against any pilot data; the analytical formulas assume perfect mixing (CSTR) or plug flow (PFR), neither of which is exact in industry.
Pitfalls
- Using a single-temperature
kfor a reactor that operates over a 20 K range. FitA,Eaand evaluatek(T)at the design temperature. - Confusing reaction order with stoichiometry. The order in the rate law is empirical; do not assume it equals the stoichiometric coefficient.
- Reporting reactor volume without stating whether it is liquid volume, total vessel volume, or void volume in a packed bed.
- Using
pfr_volume_nth_orderfor a system where back-mixing matters (low Re, large vessel). Real reactors are between CSTR and PFR. - Using
cstr_volume_nth_orderfor very high conversions with positive order kinetics — the volume blows up as conversion → 1. - Forgetting that batch time excludes load / unload / cleaning time.
- Treating
R^2from the Arrhenius fit as a substitute for prediction intervals; with three points an excellentR^2is not the same as a defensibleA. - Forgetting that real CSTRs in series do not behave like a single PFR
even at large
Nbecause of finite mixing in each vessel.
Fallback Strategies
- For arbitrary rate laws (Langmuir-Hinshelwood, Michaelis-Menten,
reversible reactions), use the
pfr-numeric --rate-fnsubcommand which accepts a Python expression inC(e.g.0.5*C/(1+0.1*C)). - For non-isothermal design, surface to the user that this skill does not cover it; they should set up a coupled ODE solver.
Verification
- Run the listed script with representative inputs and an
--outputfile when a deterministic calculation is available. - Confirm the JSON result contains
ok: true, expected units, and no unhandled warnings. - Check result magnitudes against the stated assumptions, references, and a hand calculation or known operating range before reporting them.
References
references/design_equations.md— derivations.- Fogler, Elements of Chemical Reaction Engineering.
- Levenspiel, Chemical Reaction Engineering.
Anti-Patterns
- Picking PFR over CSTR purely because PFR "is more efficient"; ignoring fouling, cleaning, and control implications.
- Citing reactor volume without the rate constant used.
- Using textbook
kwithout checking units consistency in the rate law.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

