Support RMS diffusion/mass-transfer interfaces (`ConstantReservoirDiffusion`, `FickDiffusionInternalInterface`) in `liquidSurfaceReactor`

Aperta
#3,035 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 9 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
38/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend, databases

Direzione di ricerca

Start with ConstantTLiquidSurfaceReactor.generate_reactor, then trace how selectobjects and getkeyselectioninds handle domains and interfaces; inspect EdgeAnalysis.jl and Domain.jl for existing RMS diffusion handling. The issue proposes constant-reservoir and finite-bulk modes, with core and edge reactors both supporting the added domain and interface. Done means both modes work and are documented in input.rst with an electrocatalysis example.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Note: This issue was drafted by Claude (Anthropic's AI assistant, via Claude Code), based on its diagnosis of the run described below, and posted at Richard West's request.

Context

Torrie Asifor's CO2RR-on-Cu(111) run (liquidSurfaceReactor, RMS backend, echem branch of RMS) slowed to ~4.4 h per iteration after 3 days. 67 of its 69 edge simulations ended with CVODE "corrector convergence test failed repeatedly or with |h| = hmin", most at t ≈ 1e-11 s with h ≈ 1e-19 s. Each failure takes RMS's "resurrect" branch, which adds the edge species with the largest rate, so the model was being grown by solver crashes, not by flux criteria (and the RMG log never says so).

ConstantTLiquidSurfaceReactor.generate_reactor builds the liquid phase with IdealDiluteSolution(..., diffusionlimited=True). That only limits liquid-phase bimolecular reactions. When the mechanism has no liquid-phase reactions, as in typical electrocatalysis models where everything happens at the interface, it does nothing. Interface reactions such as proton + adsorbate or adsorption have no transport limit at all.

For example, at pH 7 (1e-4 mol/m³ H⁺, D ≈ 9e-9 m²/s, film thickness about 100 µm) mass transfer caps the proton supply at about 10⁻⁸ mol/m²/s. That's about 3×10⁻⁴ turnovers per site per second, orders of magnitude below the kinetic rates RMS now uses.

RMS already has the pieces:

  • ConstantReservoirDiffusion(domain, conddict, A, layer_thickness) on echem/for_rmg (ReactionMechanismGenerator/ReactionMechanismSimulator.jl@a814423e): couples a domain to a constant-composition bulk through a film.
  • FickDiffusionInternalInterface, RMS PR 279, open and not yet reviewed: Fickian transfer between two finite domains, so the bulk can deplete or accumulate.

Proposal:

  1. New liquidSurfaceReactor keywords, e.g. diffusionLayerThickness=(100,'um'), plus either bulkConcentrations={...} (constant reservoir) or a bulk liquidVolume (finite bulk, using PR 279).
  2. In generate_reactor, split the liquid into a near-surface domain and the bulk, add the diffusion interface, and build both the core and edge reactors the same way.
  3. Make sure selectobjects / getkeyselectioninds handle the extra domain and non-reactive interface, and that edge species get diffusivities. EdgeAnalysis.jl only special-cases the reactive interfaces now; Domain.jl handles ConstantReservoirDiffusion.
  4. Document it in input.rst, with an electrocatalysis example.

Related: for buffered electrolytes, constantSpecies=["proton"] is the cheap alternative. Without either, a 1 m³ reactor at pH 7 holds 10⁻⁴ mol H⁺ against about 0.3 mol of sites, and the protons run out almost at once.

See also: #3034 (linear solver) and ReactionMechanismGenerator/ReactionMechanismSimulator.jl#280 (rate caps), which came out of the same diagnosis.

🤖 Generated with Claude Code

Lingua principale
Python
Stelle
541
Fork
265
Merge medio
8h 49m
PR unite (30g)
1

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ReactionMechanismGenerator/RMG-Py

Tutte le issue di ReactionMechanismGenerator/RMG-Py

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.