Skip to content

ShravanKumar23/Dummy_TEO

Repository files navigation

EMB3RS-TEO-Module

Introduction

The Techno-Economic Optimization (TEO) module identifies least-cost combinations of technologies for using and conveying excess Heating and Cooling (HC) from defined sources to defined sinks. The user (representing the excess heat producer - i.e., source – or a demand point – i.e., sink) wants to evaluate the options of utilizing excess HC generated by one or more industrial sources to meet the heating/cooling demand for one or more known/assumed sinks. The objective of the optimization is to find the least-cost sink-source matching (in terms of installed capacities of technologies and energy flows within a year and across years)that satisfies the demands under constraints dictated by regulation, availability of heat, load profiles, techno-economic characteristics of technologies, investment plans, etc. The mix of technologies may include the District Heating/Cooling Network (DHN), technologies to upgrade the Temperature level on the sink or the source side, thermal storage on the sink or the source side, as well as heating alternatives.

OSeMOSYS

The Techno-economic module has been built using the long-term energy investment-planning tool OSeMOSYS. OSeMOSYS is an open-source energy system model that can be used for the optimization of long-term energy system investments and operation [1]. Further information about OSeMOSYS can be found at [2].

Requirements

A python version of 3.7.7 or higher is required to run the TEO Import os (most recent version) - The OS module in Python provides functions for interacting with the operating system Import datetime as dt (most recent version) - Used to display current date and time Import logging (most recent version) - Used for writing status messages to a file or any other output streams. Import numpy as np (version 1.16.4 or higher) - used for working with arrays and functions for working in domain of linear algebra, fourier transform, and matrices Import pandas as pd version (0.25.1 or higher) - Pandas will be used to read the in-puts from an excel file and write outputs into an excel/csv file import pulp (version 1.6.8 or higher) - Pulp is the optimization package in python which will be used to conduct the techno-economic optimization

The TEO module

The TEO module will optimize the matching between the different sources and the sinks, while taking into account various technical and economic constraints, such as demand profiles, technology cost, efficiencies and losses while also considering thermal energy storage. TEO optimizes investments and the operation for source and sink matching.

Script

TEO_model.py

This script contains the TEO module that has been defined as a function. The TEO module needs 5 different data objects as an input. These data objects are read in from the input file and are written into suitable dataframes by the load_data function. The main data frame that are needed are the 'Sets, Parameters, Defaults, mcs_Parameters and the MCS_number'. The dataframes are read in fro the excek input file using Pandas and written into 5 dataframes called 'sets_df, df, defaults_df, mcs_df, n'. The model is defined as a function called 'buildmodel'. The function takes these 5 data frames as input. The function creates the parameters, variables and the sets needed to structure the model. The equations that are needed to build the model are specified within the function. The function builds the model, solves it and returns the result as a single dataframe 'res_df'.

Functions

Several functions are used to build the TEO model. These functions are used to pre-process the data needed to run the model. The main function is the 'load_data' function which reads in the data from the current version of input file and stores it as the data frames that are used as input for the 'TEO_model' function.

Input file

An excel file is used as input to the TEO module. The inputs to the TEO module are in a tabular manner. There are mainly two different types of inputs to the TEO. The first main inputs are the SETS that are used to structure the model.Thesse rae input via the SETS sheet in the input excel file. The sets are used to build the skeleton of the model. The parameters are also input through the excel file. The parameters are input as a value that is indexed over the sets. The parameters are also arranged column wise in excel. The default for the parameters values are also specified into the excel file and read into as a data frame in the code.

Running in TEO

The input file for the prototype is ‘Input_file_TEO.xlsx’. To run the module:

Instruction to run the model

  • Download the code and the input file in the test folder.

  • The code for the TEO us organised in three python files, ‘TEO_Model’, ‘TEO_functions’ and ‘TEO_running_file’. The ‘TEO_Model’ file contains the code of the TEO module and all the equations of the optimization model. ‘TEO_functions’ contains certain pre and post processing functions that are needed to run the module. ‘TEO_running_file’ is the executable file of the TEO. The user can specify the input file and desired format of outputs in the ‘TEO_running_file’.

  • The code and the input file must be downloaded and saved in a specific manner. A main folder called ‘TEO’ must be created and the code will be down-loaded into this folder. Within this main folder, two sub folders named ‘Input_data’ and ‘Output_data’ must be created. The input file must be down-loaded into the ‘Input_data’ folder. A representation of how the files must be organized is shown below.

• TEO (Main folder)

o Input_data

    	Input_file_TEO.xlsx 

o Output_data

o TEO_Model

o TEO_functions

o TEO_running_file

  • Create two folders, named ‘Input_data’ and ‘Output_data’. The python file with the code, the functions and the two folders mentioned above should be located in the same directory on the computer.
  • Once the files are downloaded and the folder structure is established, the model can be run using the TEO_running_file. The name if the input directory and the input file must be checked in the TEO_running_file. The TEO module can output results in two formats, excel and csv. The preference for the output format can also be set in the TEO_running_file by specifying a ‘True’ or ‘False’ next to the output formats in the TEO_running_file. Once the TEO analyses in completed, the results file named ‘Input_file_TEO_Results.xlsx’ will be save in ‘Output_data’ sub-folder.
  • When the model is run, python will provide a series of logs, which describe the model simulation status as shown in the figure 1 below.
  • Once the model run is completed, the output will be saved in a file name ‘Input_file_TEO_Results.xlsx’ in the ‘Output_data’ folder.

Results:

  • Python Log A quick check of the results can be done by looking at the python log. For the current test case, the model must return optimal solution found a cost value of 1748164.2. Tjis can be used to evaluate the results of the model.

  • Results in excel The results are shown in an excel spreadsheet. Results for each variable is written on a sheet. The results for production from the different technologies is shown in figure 2.

Emb3rs project

EMB3Rs (“User-driven Energy-Matching & Business Prospection Tool for Industrial Excess Heat/Cold Reduction, Recovery and Redistribution) is a European project funded under the H2020 Program (Grant Agreement N°847121) to develop an open-sourced tool to match potential sources of excess thermal energy with compatible users of heat and cold.

Users, like industries and other sources that produce excess heat, will provide the essential parameters, such as their location and the available excess thermal energy. The EMB3Rs platform will then autonomously and intuitively assess the feasibility of new business scenarios and identify the technical solutions to match these sources with compatible sinks. End users such as building managers, energy communities or individual consumers will be able to determine the costs and benefits of industrial excess heat and cold utilization routes and define the requirements for implementing the most promising solutions.

The EMB3Rs platform will integrate several analysis modules that will allow a full exploration of the feasible technical routes to the recovery and use of the available excess thermal energy.

Acknowledgments

The EMB3RS project has received funding from the European Union’s Horizon 2020 research and innovation program under grant agreement No 847121. This publication reflects only the views of its authors, and the European Commission cannot be held responsible for its content.

Licenses

• Check the license for PuLP, I suppose we will have to use the same; report the li-cense name and info and link; • The PULP version of OSeMOSYS has been licensed under an ‘Apache License 2.0’ which is a permissive license whose main conditions require preservation of copy-right and license notices. Contributors provide an express grant of patent rights. Li-censed works, modifications, and larger works may be distributed under different terms and without source code. • The input data file ‘Input_file_TEO.xlsx’ is licensed under a Creative Commons At-tribution 4.0 International License. References

[1] M. Howells et al., “OSeMOSYS: The Open Source Energy Modeling System. An introduction to its ethos, structure and development.,” Energy Policy, vol. 39, no. 10, pp. 5850–5870, 2011, doi: 10.1016/j.enpol.2011.06.033. [2] “OSeMOSYS - Home.” 2018, [Online]. Available: http://www.osemosys.org/.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages