Haber-Bosch Analysis Tool via Web Assembly WASM - Pragmatic Rust for Engineers - Episode 3

Опубликовано: 07 Январь 2025
на канале: Tim Janus, Janus IT
257
8

In Episode 3 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. Initially, we explore an innovative configuration of a multi-bed reactor utilizing a WebAssembly (WASM)-based tool. Following this, we delve into the integration of Rust and JavaScript to develop a user interface. This interface facilitates the simulation and visualization of the sequential multi-bed reactor model we introduced in our previous episodes.

By the video's end, we saw how Rust most known as a low-level system programming languages can be executed in a Browser via WEBAssembly. This allows us to provide a great user-experience. With this 3rd video we conclude the Haber-Bosch process but there is more to come.

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! Aaaand don't forget to subscribe and hit the bell icon to stay updated on our series!

General Learning Objectives:
Use multiple software stacks to model complex chemical processes, mirroring the interdisciplinary approach needed in modern engineering solutions.
Use the Web browser as sandbox and user-interface to empower users of your tools
Provide a analysis tool to investigate Haber-Bosch multi-bed reactor configurations and visualize the results we discussed with Jonathan.

Rust Learning Objectives:
Use wasm-pack and serve Rust code on the Web
Bind the Web browser Developer Console to Rust outputs and panics
HTML Forms and CSS design
JavaScript for Event-Handling and Interaction
React on HTML formulas in Rust and end up with an interactive analysis tool

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 third Episode, we will discuss a multi-bed reactor analysis of the Haber-Bosch Reaction with Jonathan Ayala.

Social and Website Links:
Website: https://janus.rs/en/
Tims Twitter:   / darthb86  
Tims LinkedIn:   / tim-janus-07523b13  
Jonathans LinkedIn:   / jonathan-ayala-b679426b  
Follow us for more insights and updates on our journey on Chemical Engineering and Rust.

Chapters:
0:00 Highlights - Intro with Highlights of the Series
0:15 Introduction - Recap and Today's Agenda
1:29 Haber-Bosch Process - Exploring Design and Operational Parameters
4:32 Optimization - Meaning of Optimization in casual language and elseswhere
7:24 Synthesis Loop Recap - A brief review on the entire Haber-Bosch process
8:19 Catalyst Selection - Selectivity, Activity and more
9:48 Upcoming Code Transformations - From Machine-Code to WebAssembly
10:50 Rust and WebAssembly - Learning Goals and Implementing Rust for Web Applications
11:51 Start CODING - Installing Packages and Dependencies
14:59 Trigger Outputs - Trigger outputs from Rust in the Browser
19:22 Interface Rust with the Browser - Map the Web to Rust
23:16 Render into the Browser I - HTML Canvas Rendering, Rust Part
26:15 Render into the Browser II - Sandboxes and what to or not to expect
30:26 Render into the Browser III - HTML Canvas Rendering, Web Part
33:21 Interactive Web Elements I - Respond to Browser Events
36:58 Interactive Web Elements II - Forms for User Interaction
40:26 Summary - Dense Knowledge And Motivating Result
43:54 Outro - Not announced yet but more to come!

References:
https://hb-analysis.janus.rs - Online Version of the Analysis Tool
https://github.com/DarthB/pragmatic_r... - GitHub Repository containing the learning materials and much more information, references, etc. See the readme.md and the corresponding tasks.md in the repository.
https://github.com/srenevey/ode-solvers - GitHub Repository of the Crate we will be using as ODE-solver implementation.
https://github.com/plotters-rs/plotters - GitHub Repository of the Crate we will be using as Plotting library.
https://github.com/rustwasm/wasm-bindgen - GitHub Repository of the Crate that allows us to use WebAssembly WASM as output target for our Rust Code.
https://github.com/rustwasm/wasm-pack - GitHub Repository of the command line tool we use to build WebAssembly packages.
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