{ "cells": [ { "cell_type": "markdown", "id": "c0cd125d", "metadata": {}, "source": [ "# `WasteStream` \n", "\n", "*Click the badge below to try this tutorial interactively in your browser:*\n", "\n", "[](https://mybinder.org/v2/gh/QSD-Group/QSDsan-env/main?urlpath=git-pull%3Frepo%3Dhttps%253A%252F%252Fgithub.com%252FQSD-group%252FQSDsan%26urlpath%3Dlab%252Ftree%252FQSDsan%252Fdocs%252Fsource%252Ftutorials%26branch%3Dmain)\n", "\n", "*You can also run this tutorial in [Google Colab](https://colab.research.google.com). It takes a one-time setup per session: follow the [Colab instructions](https://qsdsan.readthedocs.io/en/latest/tutorials/index.html#run-in-colab).*\n", "\n", "- **Prepared by:**\n", "\n", " - [Yalin Li](https://github.com/yalinli2)\n", " - [Joy Zhang](https://github.com/joyxyz1994/)\n", "\n", "- **Learning objectives.** After this tutorial, you will be able to:\n", "\n", " - Create a `WasteStream` and set its composition\n", " - Read derived flow properties and concentrations\n", " - Convert between mass-flow and concentration representations\n", "\n", "- **Prerequisites:** [2. Component](https://qsdsan.readthedocs.io/en/latest/tutorials/2_Component.html)\n", "\n", "- **Covered topics:**\n", "\n", " - 1. Creating WasteStream\n", " - 2. Major attributes\n", "\n", "> **Companion video.** A walkthrough of this tutorial is available on [YouTube](https://youtu.be/yCOZ0F6E1Sw), presented by [Hannah Lohman](https://github.com/haclohman). Recorded against `QSDsan` v1.2.0. The concepts still apply, but if the code on screen differs from this notebook, follow the notebook.\n" ] }, { "cell_type": "markdown", "id": "3e788acbcc35", "metadata": {}, "source": [ "\n", "\n", "## Setup\n", "\n", "Import `QSDsan` and confirm the installed version.\n" ] }, { "cell_type": "code", "execution_count": 1, "id": "ea65fc2e", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "This tutorial was made with qsdsan v1.5.2.\n" ] } ], "source": [ "import qsdsan as qs\n", "print(f'This tutorial was made with qsdsan v{qs.__version__}.')" ] }, { "cell_type": "markdown", "id": "eef115d3", "metadata": {}, "source": [ "## 1. Creating `WasteStream` \n", "A `WasteStream` object can be created by defining flow rate of each `Component` or through built-in influent characterization models (e.g., by specifying total volumetric flowrate, concentrations of total COD, TKN, etc. together with COD fractions)." ] }, { "cell_type": "code", "execution_count": 2, "id": "1b5fe7a6", "metadata": {}, "outputs": [], "source": [ "# Before using `WasteStream`, we need to tell qsdsan what components we will be working with\n", "# let's load the default components for the demo purpose\n", "cmps = qs.Components.load_default()\n", "qs.set_thermo(cmps)" ] }, { "cell_type": "code", "execution_count": 3, "id": "aac56679", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "CompiledComponents([\n", " S_H2, S_CH4, S_CH3OH, S_Ac, \n", " S_Prop, S_F, S_U_Inf, S_U_E, \n", " C_B_Subst, C_B_BAP, C_B_UAP, C_U_Inf, \n", " X_B_Subst, X_OHO_PHA, X_GAO_PHA, X_PAO_PHA,\n", " X_GAO_Gly, X_PAO_Gly, X_OHO, X_AOO, \n", " X_NOO, X_AMO, X_PAO, X_MEOLO, \n", " X_FO, X_ACO, X_HMO, X_PRO, \n", " X_U_Inf, X_U_OHO_E, X_U_PAO_E, X_Ig_ISS, \n", " X_MgCO3, X_CaCO3, X_MAP, X_HAP, \n", " X_HDP, X_FePO4, X_AlPO4, X_AlOH, \n", " X_FeOH, X_PAO_PP_Lo, X_PAO_PP_Hi, S_NH4, \n", " S_NO2, S_NO3, S_PO4, S_K, \n", " S_Ca, S_Mg, S_CO3, S_N2, \n", " S_O2, S_CAT, S_AN, H2O, \n", "])\n" ] } ], "source": [ "# Just to remind ourselves what are the default components\n", "cmps.show()" ] }, { "cell_type": "markdown", "id": "6c64c7b1", "metadata": {}, "source": [ "