Giter Site home page Giter Site logo

heatdesalination's Introduction

HEATDesalination

Simulation and optimisation of hybrid electric and thermal powered desalination systems

Table Of Contents

πŸ”— Dependencies

πŸ‘ Acknowledgements

Downloading HEATDesalination

🐍 Setting up your Python environment

🌦️ PVGIS

πŸ“ Completing input files

πŸ”₯ Running HEATDesalination

πŸŽ“ Running HEATDesalination on Imperial College London's high-performance computers

πŸ“ References

Dependencies

This module imports libraries from:

  • The open-source pvlib Python package developed by Holmgren, Hansen and Mikofski [1].

This module integrates with the open-source PVGIS framework, developed by Huld et al., [2].

Acknowledgements

This repository uses code developed by the CLOVER-energy team by Winchester et al. (2022). Thanks to all at the @CLOVER-energy/clover-development-team for their work.

Downloading HEATDesalination

heat-desalination is best installed from pypi:

python -m pip install heat-desalination

should be run from a terminal or powershell window. This will fetch and install the latest version of heat-desalination along with all of its dependencies. heat-desalination runs best in Python 3.10.

Working as a developer

If you wish to help develop and work on the project, or, if you have any modifications that you wish to make to the code, the best approach is to run a git clone of the reposiroty. This will ensure that you have an up-to-date copy of the code which you can use to make changes, push commits and open pull requests within the repository:

git clone https://github.com/BenWinchester/HEATDesalination

Setting up your Python environment

heat-desalination uses Python 3.10. If you have installed the package heat-desalination following the instructions in the Downloading HEATDesalination section, then you should already have everything that you need. Otherwise, you will need to install the required dependencies.

Anaconda method

To install using conda, a Python-based virutal-environment manager, from the root of the repository, run:

conda install --file requirements.txt

Note, on some systems, Anaconda may be unable to find the requirements.txt file. In these cases, it's necessary to use the absolute path to the file, e.g.,

conda install --file C:\Users\<User>\...\requirements.txt
Pip install

If you feel more comfortable using pip, the Python package manager, you can use this either from within an Anaconda environment or straight from the command-line:

python -m pip install -r requirements.txt

PVGIS

heat-desalination relies on the package pvlib.iotools.pvgis [[1]]. This package is responsible for fetching weather data from the Photovoltaic Geographical Information System (PVGIS). This data is used in the internal models to assess the performance of the solar collectors considered in the system. No API tokens or login keys are needed in order to use this API.

In order to download weather related data for your given location, simply run

python -m heat-desalination-weather -lat <latitude> -lon -<longitude> -t <timezone>

or

heat-desalination-weather -lat <latitude> -lon -<longitude> -t <timezone>

from your command-line interface, provided that you have installed the heat-desalination package, where <latitude> and <longitude> are floating-point (i.e., decimal) numbers that give the latitude and longitude of the location for which you wish to download data respectively and <timezone> is the decimal timezone offset, e.g., 5.5 for a 5-and-a-half hour time difference from UTC.

If you have downloaded the code from Github, you will need to run

python -m src.heatdesalination.weather -lat <latitude> -lon -<longitude> -t <timezone>

from your command-line interface.

Completing input files

Location-based files

System-based files

Running HEATDesalination

Fetching weather data

Running a simulation

Running an optimisation

Parallel simulation and optimisation

Running HEATDesalination on Imperial College London's high-performance computers

References

[1] Holmgren, W. F., Hansen, C. W., & Mikofski, M. A. 2018 "pvlib python: a python package for modeling solar energy systems." Journal of Open Source Software, 3(29), 884. https://doi.org/10.21105/joss.00884

[2] Huld, T., MΓΌller, R. & Gambardella, A., 2012 "A new solar radiation database for estimating PV performance in Europe and Africa". Solar Energy, 86, 1803-1815. http://dx.doi.org/10.1016/j.solener.2012.03.006

[3] Winchester, B., Beath, H., Nelson, J., & Sandwell, P. "CLOVER (Version v5.0.5)" 2020. [Computer software]. https://doi.org/10.5281/zenodo.6925535

[4] Sandwell P., Winchester B., Beath H., & Nelson J. "CLOVER: A modelling framework for sustainable community-scale energy systems." Journal of Open Source Software, 8(82), 4799, 2023. https://doi.org/10.21105/joss.04799

heatdesalination's People

Contributors

benwinchester avatar

Stargazers

Michael John avatar Caleb Bell avatar Tobias Augspurger avatar  avatar  avatar

Watchers

James Cloos avatar  avatar

heatdesalination's Issues

Inverter costs

The costs of installing an inverter for the solar system scale based on the number of electrical solar collectors installed, or, more accurately, on their total rated output power. This cost is in addition to the costs incurred through purchasing the collectors and through operation and maintenance (O&M).

The inverter costs need to be included in the modelling.

There are no alternatives other than simply neglecting these costs which is likely to result in a bias of the optimisation algorithms towards solar-based systems.

Edge effects and rounding issues

Describe the bug

Due to the continuous nature of the optimisation algorithm(s) used, continuous results will be generated. I.E., non-physical results that have non-integer component sizes. Whilst rounding these post-optimisation is a solution, it is currently producing incorrect and unphysical values for the optimum systems.

To Reproduce

Steps to reproduce the behavior:

  1. Checkout the tag v1.0.0a3
  2. Run
python -u -m src.heatdesalination -sim -l sas_al_nakhl_united_arab_emirates -pv 79 -b 19.8 -m 2.75669 -pv-t 0 -st 1e-12 -t 3.3 -sl 30 -sh 0 --scenario abu_dhabi_joo_rec_insulated_augusta -o debug_non_zero_size -pt avr -v
  1. Run
python -u -m src.heatdesalination -sim -l sas_al_nakhl_united_arab_emirates -pv 79 -b 19.8 -m 2.75669 -pv-t 0 -st 0 -t 3.3 -sl 30 -sh 0 --scenario abu_dhabi_joo_rec_insulated_augusta -o debug_zero_size -pt avr -v
  1. Observe the analysis results for the auxiliary_heating_fraction variable in each case, and note that the value of 0.21 is reported for 0 solar-thermal collectors and 1 solar-thermal collector, but -2.7 is reported for 1e-12.
  2. See error

Expected behaviour

The optimisation algorithm should automatically examine the nearest integer values of the various variables open to being optimised and return the nearest integer value to the minimum point with the lowest total cost. I.E., it should explore one step in each direction and determine which system is optimum. E.G.,

⬇️ PV & ➑️ PV-T 155 155.432.. 156
36 βœ… β˜‘οΈ
35.787293.. (optimum)
35 β˜‘οΈ β˜‘οΈ

where the optimum system is shown but contains non-integer values for some components which only come in integer sizes. Systems that should be evaluated are marked with β˜‘οΈ and βœ… symbols where βœ… denotes the optimum system.

Additional Information

Desktop

  • OS: 🐧
  • Installation setup: downloaded source from Github
  • Version: v1.0.0a3
  • Branch, if relevant: main

Grid cost names

The grid costs are so specific to individual locations, in terms of whether the tariffs are tiered etc., that it makes sense to include this functionality with a series of allowed grid profile names.

Automated testing

Describe the bug

Automated testing is currently not working due to the many rapid changes to the repository. This is both annoying and something which needs fixing before submission to the JOSS.

To Reproduce

Steps to reproduce the behavior:

  1. Push any code to any branch,
  2. Observe error.

Expected behaviour

Automated testing should run MUTs, CUTs and ITs to ensure that the code works and is reproducible.

Additional Information

Desktop

  • OS: 🐧 but affects 🏁 and 🍎
  • Installation setup: downloaded source from Github
  • Version: v1.0.0b2

Grid infrastructure costs

Issue

Specific costs for using grid electricity are including in the modelling, but the infrastructure associated with taking power from the grid is currently not considered. Including this would result in a greater cost for using the grid on top of the grid-network incurred costs.

Proposal

The solution proposed is to include the infrastructure costs associated with including a grid connection for the plant. These could either consist of, depending on the literature,

  • a scalable grid cost which depends on the peak grid-power consumption of the desalination plant over the day,
  • a slab-rate cost with discrete increases in the infrastructure cost as the peak grid-power consumption of the plant passes a series of set thresholds,
  • a flat-rate grid-infrastructure cost which is needed to connect to the grid, i.e., is zero when there is no grid power consumed and is included when there is a non-zero amount of power consumed from the grid.

The only alternative is to not consider this cost as a limitation in the model.

Installed package entry points

Issue

When running heat-desalination, it's currently only possible to use the downloaded source code from Github. I.E., there is no way to install the package and access all of the entry points that are needed. This is a barrier, both to use, and to submission as a fully-fledged piece of software.

Proposal

Entry points should be coded in the setup.cfg file and checked, along with the necessary Python scripts, so that a user can run heat-desalination and the weather-data-fetching program all from the command-line interface.

There is no alternative really which enables easy use of this software.

Remove electric performance curve

Describe the bug

The electric performance curve is obsolete. This is, however, causing runs to fail, and so should be removed.

To Reproduce

Steps to reproduce the behavior:

  1. Run any optimisation,
  2. See error

Expected behaviour

No error should be raised as the pv_module_characteristics variable contains all the needed information.

Emissions criterion

Issue

The carbon emissions associated with the systems being simulated and optimised can't be currently assessed. This is a useful keystone in making decisions regarding which system(s) are optimum and which are best in-line with the United Nations Sustainable Development Goals (SDGs).

Proposal

Users should have the emissions calculated along with the other Criterion class children defined, with this simply being None if there are no inputs on emissions data provided.

The only alternatives are ad-hoc post-computation calculations.

Fractional component cost changes

Functionality is built in to change the cost of the grid for sensitivity analyses. This should be extended to collectors as well.

This is a useful feature as it moves this work from the inputs/solar.yaml file, where a series of different collectors would need to be defined, all at slightly different costs, to the inputs/scenarios.yaml file, which makes more logical sense.

The alternative is continuing with the current process.

HPC Array Jobs

Issue

Running parallel optimisations on the HPC takes a large amount of time when the optimisations themselves contain multiple/many parameters. This is due to all of the optimisations being run on a single node.

Proposal

HPC array jobs should be utilised to spread the load across multiple HPC instances.

There are no viable alternatives as the walltime is likely to be exceeded.you've considered.

Wiki pages and Readme.MD

Issue

There is currently very little documentation within the repository. Once #21 and #20 have been merged, there will be a functional specification (FS) and design specification (DS) within the root of the repository. However, these do not contain information about how the software should be installed and run.

Proposal

  • The wiki pages should be written properly;
  • The README.md file should be properly updated.

Alternatives include writing a PDF user guide to place at the root of the repository.

Water pump power consumption

Describe the bug

Water pumps are currently not considered within the model. However, collectors will have flow rates which will introduce a power consumption (and a cost) on top of the other equipment and operation costs.

Expected behaviour

The operation costs of the pumps should be included.

Submission to the JOSS

Issue

It would be nice to have this software package properly submitted to the Journal of Open Source Software (JOSS).

Proposal

A paper should be written, within the guidelines of the JOSS, to be submitted to the JOSS.

Alternatives include scientific publishing of the package.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.