In Episode 2 of Pragmatic Rust for Engineers, we further delve into the Haber-Bosch process, a cornerstone in food production and climate change mitigation. Join me (Tim Janus) and Jonathan Ayala for an advanced exploration of a multi-bed Haber-Bosch Reactor. We dive into Rust programming by configuring two case-studies, extending our initial simulation to a sequential multi-bed reactor simulation, and introducing Haber-Bosch process visualization.
By the video's end, we'll have set the stage for generating temperature over yield, and concentration balance diagrams. Stay tuned for our next episode, where we'll delve deeper into analyzing these case studies!
We're excited to hear your thoughts on Rust programming and chemical process simulations. Share your experiences in the comments, and don't hesitate to reach out if you need help or have feedback on the video!
General Learning Objectives:
Simulation of a multi-bed Haber-Bosch Reactor
Modified Temkin's Equation by Dyson and Simon
- Fugacity coefficients describing non-idealist gas
Sequential simulation of a multiple bed reactor
- Modularization over several files
- Concepts behind Iterators and Closures
Rust Learning Objectives:
- (easy) Nested Data Structures
- (easy) The builder pattern
- (easy) Using Iterators
- (advanced) Build our own Iterator type
(advanced) Coarse Words on Lifetimes in Rust
Janus IT and friends:
Janus IT and friends that's me, Tim Janus, as your host and guests I will invite such that they can share their knowledge with us. In the second Episode, we will discuss a more sophisticated model of a Haber-Bosch with Jonathan Ayala that leads us to a model with inerts, fugacity and multiple reactor beds.
Social and Website Links:
Website: https://janus.rs/en/
Tims Twitter: / darthb86
Tims LinkedIn: / tim-janus-07523b13
Jonathans LinkedIn: / jonathan-ayala-b679426b
Chapters:
0:00 - Introduction: Highlights of the Series
0:15 - Recap & Today's Video Agenda
1:24 - Advanced Model Overview: Multi-Bed Haber-Bosch Reactor
2:13 - Ammonia Reaction Analysis: Temperature & Concentration Impact
3:09 - Optimal Operation Band in Ammonia Reaction
4:25 - Temperature Control in Exothermic Reactions
6:13 - Using Git to Navigate Pragmatic Rust for Engineers Learning Materials
6:53 - Rust Project Structure Update: Multi-Binaries
7:42 - Rust Programming: Using the Result Enum as Return Value with any Error type
8:03 - Creating Visuals with Plotters Crate in Rust
9:06 - Handling Unused Results in Rust Programming
10:07 - Chart Building Basics: Axes and Labels
11:42 - Plotting Cubic Functions with Rust Iterators
14:31 - Chemical Engineering Insights: The General Balance Equation
15:10 - Exploring Reaction Rates with Modified Temkin's Equation
16:00 - Fugacity Coefficients in Chemical Reactions
17:03 - The Interdisciplinary Nature of Chemical Engineering
17:49 - Expanding State Vector for Haber-Bosch Modeling
18:54 - Synthesis Loop in the Haber-Bosch Process
21:29 - Comparing Tubular & Multi-Bed Reactors
25:51 - Insights from the Heart: Personal Reflections on Scope of the Project
26:32 - Rust Programming Summary & What to Expect
29:17 - Maintaining a Positive Mindset in Learning
29:43 - Rust Coding Kick-off: Initial Code Overview
32:12 - Encapsulation and Separation of Concerns in Rust
33:04 - Implementing Builder Pattern in Rust
37:56 - Sequential Simulation of Multi-Bed Reactor in Rust
47:22 - Visualization Module in Rust: Starting Point
47:46 - Temperature Range Calculation with Rust Itertools
49:44 - Understanding Floats in Rust: Continuous Numbers & NaN
50:34 - Rust Programming: Handling MinMaxResult Enumeration
52:01 - Implementing a Custom Iterator Type in Rust
55:26 - Implementing the Rust Iterator Trait
1:01:36 - Couple the Data Model and Visualization module in the Main Function
1:02:48 - Debugging Logical Bugs in Rust
1:05:30 - Refactoring Techniques in Rust: Function Extraction
1:08:25 - Rust Refactoring: Avoiding Lifetimes with Closures
1:10:45 - Up Next: Interactive Elements & In-Depth Analysis in Rust
References:
https://github.com/DarthB/pragmatic_r... - The Series GitHub Repository.
https://github.com/srenevey/ode-solvers - Used ODE-Solver Implementation.
https://github.com/plotters-rs/plotters - Used Plotting Library
https://www.fertilizer.org/resource/t... - "# The Haber-Bosch Heritage: The Ammonia Production Technology", Max Appl, 1997, 50th Anniversary of the IFA Technical Conference, Sevilla, Spain, 25-26 September 1997
https://www.sciencedirect.com/science... - "Modeling and performance improvement of an industrial ammonia synthesis reactor", Ahmad Shamiri and Nia Aliabadi, 2021, Chemical Engineering Journal Advances.
• Ok, Err, and some secret third thing - Tim McNamaras Video on the Result data type.