dover/lib.rs
1// SPDX-License-Identifier: GPL-3.0-only
2// Copyright (C) 2026 OUTRAM PARK contributors
3//
4// This file is part of OUTRAM PARK.
5//
6// OUTRAM PARK is free software: you can redistribute it and/or modify it
7// under the terms of the GNU General Public License as published by the
8// Free Software Foundation, either version 3 of the License, or (at your
9// option) any later version.
10//
11// OUTRAM PARK is distributed in the hope that it will be useful, but
12// WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14// General Public License for more details.
15//
16// You should have received a copy of the GNU General Public License along
17// with OUTRAM PARK. If not, see <https://www.gnu.org/licenses/>.
18
19//! **DOVER** — *Deck-based Open-source Visualisation Engine for Reactors*, the
20//! low-fidelity counterpart of `dhoby-ghaut`.
21//!
22//! # What is here
23//!
24//! One worked low-fidelity case, run from a TOML deck, headless:
25//! **steam methane reforming in a continuous stirred-tank reactor.**
26//!
27//! ```text
28//! TOML deck ──► deck::Deck (validated) ──► smr::SmrCase
29//! │
30//! dwsim-libs Cstr ◄───────────┘
31//! (Newton on the reaction extents)
32//! │
33//! ▼
34//! headless::run_deck ──► CSV on stdout
35//! ```
36//!
37//! ```no_run
38//! use dover::headless::run_toml;
39//!
40//! let csv = run_toml(&std::fs::read_to_string("decks/smr_cstr.toml").unwrap()).unwrap();
41//! print!("{csv}");
42//! ```
43//!
44//! # What was reused rather than written
45//!
46//! Almost all of it. The workspace's "search before building" rule turned up
47//! a complete reactor stack in `outram-park-fork-dwsim-libs` that this crate
48//! composes rather than duplicates:
49//!
50//! | needed | already existed |
51//! |---|---|
52//! | the CSTR itself | `reactors::Cstr` — damped Newton on reaction extents, tested against `X = kτ/(1+kτ)` |
53//! | reversible rate law | `reactions::Reaction::net_rate` |
54//! | `K_eq(T)` from `ΔH°`/`ΔS°` | `reactions::EquilibriumConstant::GibbsVantHoff` |
55//! | feed/outcome plumbing | `reactors::{ReactorFeed, ReactorOutcome}` |
56//! | TOML + serde | already in the root `[workspace.dependencies]` |
57//!
58//! What is genuinely new here is the **deck reader** (DOVER's own
59//! `CLAUDE.md` identified it as the missing piece), the **species
60//! thermochemistry** ([`species`] — the workspace had critical constants for
61//! three of the five species and no formation data at all), and the
62//! **thermodynamic-consistency derivation** ([`smr::consistent_reverse`])
63//! that `net_rate`'s independent forward/reverse pairs leave to the caller.
64//!
65//! # Status
66//!
67//! **Untrusted AI-assisted draft. No human V&V. Not declared mature.**
68//! Education, research and V&V only per the workspace `RESPONSIBLE_USE.md` —
69//! never process design, plant operation or a safety case.
70//!
71//! The model's scope and its approximations are set out in [`smr`], and
72//! should be read before quoting any number it produces. In particular it is
73//! **isothermal** and holds volumetric flow constant, neither of which a real
74//! reformer does.
75
76#![forbid(unsafe_code)]
77
78pub mod deck;
79pub mod headless;
80pub mod smr;
81pub mod species;
82
83#[cfg(test)]
84mod tests {
85 /// The crate builds and links.
86 #[test]
87 fn builds_and_links() {
88 assert_eq!(crate::deck::SCHEMA_VERSION, 1);
89 }
90}