agentleFS
jskhermanjskherman/engg-skills/skills/reactor-sizing-and-kinetics/SKILL.md

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.

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
  1. Very specific:

    Run the listed script with representative inputs and an --output file when a deterministic calculation is available.

    line 107
  2. Distinctive:

    Check result magnitudes against the stated assumptions, references, and a hand calculation or known operating range before reporting them.

    line 109

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

  1. uv available.
  2. 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 A and Ea from 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) or T(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.json
  • uv run scripts/reactor.py cstr --C0 1000 --conversion 0.9 --flow 0.001 --k 5e-4 --order 1 --output /tmp/cstr.json
  • uv run scripts/reactor.py pfr --C0 1000 --conversion 0.9 --flow 0.001 --k 5e-4 --order 2 --output /tmp/pfr.json
  • uv run scripts/reactor.py batch --C0 1000 --conversion 0.9 --k 5e-4 --order 1 --output /tmp/batch.json
  • uv run scripts/reactor.py series --C0 1000 --conversion 0.95 --flow 0.001 --k 5e-4 --N 3 --output /tmp/series.json

Procedure

  1. Fit the rate constant if you have temperature data: arrhenius.
  2. 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.
  3. Compute volume or time at the design conversion.
  4. Sensitivity: re-run with +10%/-10% in k to bracket uncertainty in the rate constant.
  5. 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 k for a reactor that operates over a 20 K range. Fit A, Ea and evaluate k(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_order for a system where back-mixing matters (low Re, large vessel). Real reactors are between CSTR and PFR.
  • Using cstr_volume_nth_order for 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^2 from the Arrhenius fit as a substitute for prediction intervals; with three points an excellent R^2 is not the same as a defensible A.
  • Forgetting that real CSTRs in series do not behave like a single PFR even at large N because of finite mixing in each vessel.

Fallback Strategies

  • For arbitrary rate laws (Langmuir-Hinshelwood, Michaelis-Menten, reversible reactions), use the pfr-numeric --rate-fn subcommand which accepts a Python expression in C (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 --output file 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 k without checking units consistency in the rate law.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.