- We use the data produced by students from Beirut Arab University for the town Tebnine, Lebanon.
- If you want to see the code with better readability, refer to this branch
The domestic sewage carried into the Anaerobic digester Floating drum digester by the truck. The digester consist of the propeller for mixing with a sludge retention time of 22 days. Methane gas which is in the range of 55 - 65% of bio-gas [reference] is also considered during modelling of the energy system. Methane gas is burned in a combined heat & power plant(CHP). Part of the heat and electricity is supplied to the digester itself to maintain the heat loss and to power the propeller respectively. The major part of electricity produced is used to power the wastewater treatment plant. Slurry is taken into consideration through dewatering unit where water is allowed to pass through constructed wetlands and remained digestate can be further used as fertilizer. The model analyze the operational parameters like; Biochemical oxygen demand (BOD), Chemical oxygen demand (COD), Nitrate, pathogens.
- Bus
- FLow
- Sink (one input, no output)
- Source (one output, no input)
- Linear Transformer (one input, n outputs)
- Storage (one input, one output)
All flows into and out of a bus are balanced. Following names were used to define BUS.
- Sludge (m3/day)
- Slurry (m3/day)
- Effluent (m3/day)
- Electricity (Kwh)
- Biogas (m3/day)
- Bio-methane (m3/day)
- Heat (Kwh)
The flow class has to be used to connect. An instance of the Flow class is normally used in combination with the definition of a component.
Sink is normally used to define the demand within the model, but it can also be used to detect excesses. Following names were used to define the sinks of the iWEFEs.
- Demand 1 (water)
- Demand 2 (fertilizer)
- Demand 3 (electricity)
- Demand 4 (Heat)
In contrast to the demand sink, ‘excess sink’ has normally less restrictions but is opened to take the whole excess.
The model can be represented by only one source, ‘Domestic Sewage’, where it might be restricted by maximum value (nominal_value), annual limit (Summed_max), cost for importing the sewage (Variable_cost). The nominal_value sets the installed capacity.
LinearTransformer in the model represents the transforming process of given input to output. Following system elements were modelled as linear transformers:
- Anaerobic digester
- Dewatering Unit
- Constructed wetland (CW)
- Combined heat & power plant (CHP)
The currently supported Python Version is 3.8.10. For using OWEFE clone the repository to your local machine. Then create a new virtual environment with Python Version 3.8.10. Activate the new virtual environment and move to the repository folder.
`pip install -r requirements`
Further, you need to intall a solver in your system. To do so, please see the oemof README: oemof README
We assume you already have the following data named ww_biogas_tibnine_raw.csv
-
main_wastewater_biogas_tibnine.py calls pre_design_wastewater_biogas.py
import pre_design_wastewater_biogas
-
pre_design_wastewater_biogas.py calls digester_demand.py for heat and electricity demand for digester.
from digester_demand import heat_calculation from digester_demand import electricity_calculation
-
pre_design_wastewater_biogas.py again calls digester.py to calculate bio-gas production per feed and dimension of digester.
from components.digester import Digester
-
pre_design_wastewater_biogas.py produce a new csv file named under [proceed.csv] and it will automatically saved in your local repository.
for i, r in inpdf.iterrows(): heat_demand = heat_calculation(temp_ambient=r['temperature'], heat_transfer_coefficient=0.6, temp_digester=35, surface_area_total_overground= area) inpdf.loc[i, "heat_demand_digester"] = heat_demand.compute() inpdf.to_csv("ww_biogas_tibnine_proceed.csv", index=False) for i, r in inpdf.iterrows(): electricity_demand = electricity_calculation(wastewater=r['wastewater']) inpdf.loc[i, "electricity_demand_digester"] = electricity_demand.compute() inpdf.to_csv("ww_biogas_tibnine_proceed.csv", index=False)
-
Read the new Proceed csv file
pd.read_csv(r"ww_biogas_tibnine_proceed.csv")
-
main_wastewater_biogas_tibnine.py calls constructedwetlands.py. This will produce average discharge from constructed wetlands, area required for wetlands, BOD effluent, COD effluent and Nitrate effluent.
from components.constructedwetlands import Constructed_wetlands
electricity_bus["sequences"].sum(axis=0)
heat_bus["sequences"].sum(axis=0)
digested_bus["sequences"].sum(axis=0)
custom_storage["sequences"].sum(axis=0)
sludge_bus["sequences"].sum(axis=0)
slurry_bus["sequences"].sum(axis=0)
bio_gas_bus["sequences"].sum(axis=0)
effluent1_bus["sequences"].sum(axis=0)
effluent2_bus["sequences"].sum(axis=0)
bio_methane_bus["sequences"].sum(axis=0)
Constructed_wetlands(inflow, outflow)
A line graph for electricity demand, heat demand, water demand, fertilizer demand and bio-methane gas production is plotted against time period. For example;
fig, ax = plt.subplots(figsize=(10, 5))
electricity_bus["sequences"].plot(
ax=ax, kind="line", drawstyle="steps-post"
)
plt.legend(
loc="upper center", prop={"size": 8}, bbox_to_anchor=(0.5, 1.3), ncol=2
)
fig.subplots_adjust(top=0.8)
plt.show()
Feel free to create a issue or contact us if there are any questions Julian Fleischmann or Kapil Tiwari.
If there are any issues involving running/using OWEFE, make sure to open an issue, it would be greatly appreciated, and will help improve the project.
Functions have been designed with flexibility in mind, so that full customization of built-in-functions and filters can be utilised; for every buses differing graph with demand and supply can be created; just by changing parameters slightly, demand sink can be convert into excess sink.
Planners & developers who would like to work with renewable energy and environmental technolohies can use the present tool to model biogas wastewater systems including usability of methane gas for combined heat and power generation, water filtration under WHO guideliness, and usage of digestate as fertilizer. This library provides a complete suite of functions to do so, as well as in-built filters and presets.
OWEFE is always open for modeling further technologies and functionalities. So if you'd like to contribute, we're always ready to investigate and develop new models coperativley.
- Fix Constructed wetlands
- Fix slurry flow (currently 0), digestate and effluent 2 graph
- Simplify Sludge to Methane Conversion (omit Biogas Bus and Methane storage),
- change methane bus unit from kWh (chemical energy content) to m³
- add dewatered_sludge_sum to output results.csv, main_wastewater_tibnine, line 558
This project is licensed under the GNU Affero General Public License v3.0 - see the LICENSE.md file for details.