RELAP5 Nuclear Reactor Thermal-Hydraulics (.i, .inp, .r5)
@modelscript/relap5 (languages/relap5) provides high-fidelity 80-column card deck parsing, non-equilibrium two-phase hydrodynamic modeling, 6-group delayed neutron point kinetics solving, DAE lowering, and Modelica 3.x projection for INL RELAP5-3D nuclear reactor systems, thermal-hydraulic loops, and safety margin evaluations.
Supported Extensions & Standards
| Extension | Format | Description |
|---|---|---|
.i / .inp | RELAP5 Input Card Deck | Fixed-column card deck specifying hydrodynamic volumes, junctions, heat structures, trips, and kinetics |
.r5 | RELAP5-3D System Deck | Multi-loop PWR/BWR coolant systems, steam generators, emergency core cooling systems (ECCS) |
Key Capabilities
1. Two-Phase Non-Equilibrium Hydrodynamics
- Employs a full 6-equation two-fluid formulation with separate mass, momentum, and energy conservation equations for liquid and vapor phases:
- Phase Mass Conservation:
- Phase Momentum Conservation:
- Phase Energy Conservation:
- Phase Mass Conservation:
- Tracks interphase friction, bubbly/slug/annular flow regime transitions, and subcooled boiling.
2. 6-Group Delayed Neutron Point Kinetics & Reactivity Feedback
- Solves the stiff differential equations of reactor core power during transients and reactor SCRAM:
where is normalized thermal power, is prompt neutron generation time, and is delayed neutron fraction. - Incorporates dynamic physical reactivity feedback:
ensuring negative Doppler fuel temperature feedback stabilizes reactor transients.
3. Direct DAE Lowering
- Compiles hydrodynamic volumes, inter-volume junctions, and heat structures into
@modelscript/runtime'sDAEBuilderlinear memory arena. - Enables co-simulation between nuclear primary coolant loops, secondary steam turbine power plants, and electrical generator controls (
@modelscript/psse).
4. Bidirectional Modelica 3.x Projection
- Projects RELAP5 primary loops and core volumes into
Modelica.Fluidtwo-phase thermal hydraulic circuits and nuclear reactor models.
Pre-Flight Diagnostics
The RELAP5 parser and validator enforce card syntax, hydrodynamic connectivity, and trip cutset safety:
10 rules8 error2 warning Run with msx relap5 lint
| Code | Rule | Severity | Message |
|---|---|---|---|
M8601 | dangling-volume-connection | error | Junction '<junctionId>' specifies undefined <end>-volume '<volId>'. |
M8602 | unclosed-trip-logic-cutset | error | Trip logic '<parentTripId>' references undefined child trip ID '<childTripId>'. |
M8603 | negative-heat-capacity | error | Heat structure '<hsId>' specifies non-positive conductivity (<k> W/m-K) or capacity (<cp> J/m³-K). |
M8604 | sonic-choked-flow-singularity | warning | Junction '<junctionId>' flagged for critical sonic choked flow transition. |
M8605 | missing-kinetics-delayed-groups | error | Point kinetics model specifies <count> delayed groups; standard reactor kinetics requires 6 precursor groups. |
M8606 | negative-prompt-neutron-lifetime | error | Prompt neutron generation time '<lambda>' s must be strictly positive. |
M8607 | adverse-volume-elevation | warning | Volume '<volId>' elevation change dz (<dz> m) exceeds physical volume length (<length> m). |
M8608 | negative-junction-loss-coefficient | error | Junction '<junctionId>' specifies negative form loss coefficient (K_forw=<kForw>, K_rev=<kRev>). |
M8609 | invalid-time-step-bounds | error | Minimum time step (<minDt> s) exceeds maximum time step (<maxDt> s). |
M8610 | negative-pressure-state | error | Volume '<volId>' specifies non-positive thermodynamic pressure (<p> Pa). |
Generated from languages/relap5/src/errors.ts. All languages →
CLI Usage
bash
# Inspect hydrodynamic volumes, junctions, and core kinetics cards
msx relap5 inspect PwrPrimaryLoop.i
# Run pre-flight card validation and trip logic cutset analysis
msx relap5 lint PwrPrimaryLoop.i
# Simulate 6-group delayed neutron point kinetics during rod drop / SCRAM
msx relap5 kinetics PwrPrimaryLoop.i --duration=10.0
# Lower two-phase volumes and kinetics into ModelScript linear DAE arena
msx relap5 to-dae PwrPrimaryLoop.i
# Project into Modelica 3.x two-phase nuclear thermal-hydraulics model
msx relap5 to-modelica PwrPrimaryLoop.i -o NuclearLoop.mo
