Desalsim Tutorial
1. Introduction
This tutorial provides a comprehensive overview and guide to utilizing a simulation package tailored for analyzing desalination and brine treatment technologies. Here’s what you’ll find:
Usage: Instructions on how to use the simulation models, including input parameters and result interpretation.
Technical Process Models: Detailed descriptions of each technology model, including input-output relationships and simulation steps.
Economic Models: Explanation of economic models for evaluating operating and investment costs.
Treatment trains Comparison: Guidance on comparing different treatment trains using provided tools.
2. Installation
The easiest way is through pip, in command-line interface:
pip install DesalSim
You can find the last version: https://pypi.org/project/desalsim/
If you want to install the latest GitHub version:
Download the repository to your local machine:
https://github.com/rodoulak/Desalination-and-Brine-Treatment-Simulation-
Install the required dependencies:
pip install -r requirements.txt
3. Usage
Each simulation model serves as a standalone tool for analyzing the performance of a specific desalination or brine treatment technology. Before running the simulation, ensure that you have provided the necessary input parameters, such as feed flow rates, salinity levels, membrane properties, heat sources, and operating conditions.
The simulation results, including salt concentration profiles, ion fluxes, energy consumption, chemical consumption, and operational costs, will be generated based on the specified inputs and displayed in the console output or saved to output files for further analysis.
However, simulation models of more than one technology can be combined to simulate and evaluate the performance of a treatment train (desalination and brine treatment system). In this case, the output flow rates and stream concentrate are the input data for the next technology.
Additionally, two example files are provided to demonstrate the usage of the simulation suite (see Example 1 and Example 2). These examples simulate and evaluate two different treatment trains, showcasing the integration of multiple technologies. The economic evaluation of the treatment train is given in Example 1 and in the Economic Tutorial. Furthermore, a comparison file is included, where the results of the two examples are compared in terms of various parameters. Users can extend this comparison by adding more indicators as needed.
Followed steps:
Step 1: Import required functions for process units in the treatment train.
Step 2: Set input data like feed flow rate, ion concentration, relevant ions for the feed solution.
Step 3: Set input parameters for each process unit as shown in Table 1 and for economic model as shown in Table 2 and Table 3.
Step 4: Call function of each process unit, create objects for each calculation.
Step 5: Results interpretation.
3.1. Documentation
You can find Tutorials and documents at:
Tutorial for Example 1
The mathematical description of each technology is given in Mathematical description
4. Technical process models
For more detailed steps and instructions see Tutorial for Example 1. The mathematical description of each technology is given in Mathematical description. Table 1 gives an overview of the main inputs and outputs for each process unit in Desalsim.
Process |
Input |
Output |
|---|---|---|
Nanofiltration |
Feed flow rate [m³/h] |
Permeate flow rate and composition [g/L] |
Ion concentration [g/L] |
Concentrate flow rate and composition [g/L] |
|
Osmotic pressure [bar] |
Electrical requirements [kWhel] |
|
Water recovery [%] |
||
Ion rejection [-] |
||
Multi-effect distillation |
Feed flow rate [m³/h] |
Flow rate of water [m³/h] |
Ion concentration [g/L] |
Effluent flow rate and composition [g/L] |
|
Feed temperature [°C] |
Electrical [kWhel] and thermal [kWhth] requirements |
|
Steam temperature [°C] |
Cooling water flow rate [m³/h] |
|
Thermal crystallizer |
Feed flow rate [m³/h] |
Flow rate of water [kg/h] |
Ion concentration [g/L] |
Flow rate of NaCl [kg/h] |
|
Feed temperature [°C] |
Cooling water flow rate [m³/h] |
|
Steam temperature [°C] |
Electrical [kWhel] and thermal [kWhth] requirements |
|
Multi-plug flow reactor |
Feed flow rate [m³/h] |
Alkaline solution flow rate [L/h] |
Ion concentration [g/L] |
Flow rate of Mg(OH)₂ [kg/h] |
|
Concentration of the alkaline solution (NaOH) [M] |
Flow rate of Ca(OH)₂ [kg/h] |
|
Concentration of the acid solution (HCl) [M] |
Acid solution flow rate [L/h] |
|
Effluent flow rate [m³/h] and composition [g/L] |
||
Electricity requirements [kWhel] |
||
Eutectic freeze crystallizer |
Feed flow rate [m³/h] |
Flow rate of Na2SO4 [kg/h] |
Ion concentration [g/L] |
Flow rate of ice [kg/h] |
|
Feed temperature [°C] |
Effluent flow rate [m³/h] and composition [g/L] |
|
Electricity requirements [kWhel] |
||
Electrodialysis with bipolar membranes |
Feed flow rate [m³/h] |
Flow rate of acid [m³/h] and composition [g/L] |
Ion concentration [g/L] |
Flow rate of base [m³/h] and composition [g/L] |
|
Current Density [A/m2] |
Flow rate of salt [m³/h] and composition [g/L] |
|
Electricity requirements [kWhel] |
||
Electrodialysis |
Feed flow rate [m³/h] |
Flow rate of diluted stream [m³/h] and composition [g/L] |
Ion concentration [g/L] |
Flow rate of concentrate stream [m³/h] and composition [g/L] |
|
Current Density [A/m2] |
Electricity requirements [kWhel] |
5. Economic models
For more detailed steps and instructions see Economic Tutorial. The mathematical description of economic model is given also in Mathematical description.
Table 2 gives an overview of the main inputs and outputs of economic model (economic_f.py).
Input |
Output |
|---|---|
Selling price for products [€/ton] or [€/m³] |
Operating cost (OPEX) [€/year] |
Prices for energy [€/KWh], input chemicals [€/m³], cooling water [€/m³] |
Investment cost (CAPEX) [€] |
Operating hours, lifetime |
Revenues from selling products [€/year] |
Interest rate, Inflation rate |
|
Equipment cost [€] |
|
Assumptions on CAPEX and OPEX calculations |
For the economic analysis of a full-scale desalination plant, the equipment costs of pilot-scale units are scaled-up to a capacity of 30000 m³/d. The equipment (material) costs of the full-scale plant are derived from the cost of the same equipment in the pilot plant with known capacity using function scaleup.py.
Table 3 gives an overview of the main assumptions made to calculate the CAPEX and OPEX.
CAPEX |
Annual OPEX |
|---|---|
Installation: 25% of purchased equipment cost |
Maintenance: 3% of the fixed-capital investment |
Buildings, process, and auxiliary: 20% of purchased equipment cost |
Operating Supplies: 5% of maintenance |
Land: 6% of purchased equipment cost |
Operating Labor: 15% of annual OPEX |
Indirect costs: 15% of direct cost |
Direct supervisory and clerical labor: 15% of operating labor |
Working capital: 20% of total investment cost |
Laboratory charges: 15% of operating labor |
Patents and royalties: 3% of annual OPEX |
|
Fixed charges: 5% of annual OPEX |
|
Plant overhead costs: 5% of annual OPEX |
Note
Note that the assumptions listed in Table 3 can be modified to suit different case studies.
6. Treatment trains comparison
In comparison file, results from different treatment trains are summarised. Indicators are formulated to compare the treatment trains.
Import results
First, import the results from the two examples.
# Import results
import example_1 as sc1
import example_2 as sc2
Import required functions:
import numpy as np
import pandas as pd
Create lists with results
X = ['Example 1', 'Example 2']
X_axis = np.arange(len(X))
Electrical consumption Vs Thermal consumption
For instance, the two examples are compared based on their electrical and thermal energy requirements.
# Create lists for OPEX and assigned results for Electrical consumption and thermal consumption
Eel = [ sc1.sum_el_en, sc2.sum_el_en]
Eth = [sc1.sum_th_en, sc2.sum_th_en]
# Yearly calculation
Eel = [i * hr/1e6 for i in Eel] # Total electrical energy consumption
Eth = [i * hr/1e6 for i in Eth] # Total thermal energy consumption
Visualization
For the visualization, a bar figure is created and saved.
# Create Figure 1: Electrical consumption Vs thermal consumption
plt.bar(X_axis - 0.2, Eel, 0.4, color="#00516a", label = 'Electrical (GWel)')
plt.bar(X_axis + 0.2, Eth, 0.4, color="sandybrown", label = 'Thermal (GWth)')
plt.xticks(X_axis, X)
plt.ticklabel_format(style='sci', axis='y', scilimits=(0,0))
plt.xlabel("Scenarios")
plt.ylabel("Energy consumption (GW)")
plt.legend()
plt.savefig('electricVSthermal.png')
plt.show()
Operating costs (OPEX)
For instance, the two examples are compared based on the operating costs (OPEX).
# Create lists for OPEX and asigned reuslts
OPEX = [sc1.OPEX, sc2.OPEX]
# Yearly calculation
OPEX = [i/1e6 for i in OPEX]
Visualization
For the visualization, a bar figure is created and saved.