This package contains a collection of functions useful for workflows with DHNx, LPagg, and GIS-data in general in the context of municipal heat planning.
Some functions of the script are specific to Germany.
This is not a stable release and breaking changes will occur often and without warning.
This package provides a default workflow that perfoms the following:
- Take a polygon defining an area as input
- Download OpenStreetMap building and street data
- Assign a status "heated" depending on the type of each building
- Assign a random distribution of construction years
- Assign a random refurbishment status depending on the building type and construction year based on typical distributions from the literature
- Assign a specific heat demand based on construction year, refurbishment status and building type from the literature
- Estimate domestic hot water demand based on the building type
- Calculate the heated reference area based on the building ground area from the OpenStreetMap-Data and an estimation of the number of floors
- Apply climate correction factor based on the TRY-region
- Based on the gathered heat demand for each building, create load profiles for each building with LPagg
- As weather data, the old DWD TRY (2011) is used for the appropriate region
- (It is recommended to download and use the current DWD TRY (2017) data for your location from https://kunden.dwd.de/obt/)
- Choose a random building as a producer for a district heating grid
- Optimize the installation of a district heating grid along the streets with DHNx, choosing paths and required diameters for the pipes
- Simulate the heating grid to determine pressure loss, flow rate and temperature distribution within the network
If you already have Anaconda installed, the easiest way to get everything
set up is to create a dedicated python environment from a yaml. Save the file
environment_user.yaml to a folder where you run the following command.
Change the environment name my-env-name to something useful like work
or dhnx:
conda env create --name=my-env-name --file=environment_user.yaml
(A simple conda install dhnx_addons will install all dependencies
available on conda, but cannot install the required pip dependencies.)
To update an existing environment, you can use:
conda env update --name=my-env-name --file=environment_user.yaml
If you want to instead clone this repository to develop it further, create a development environment with all the dependencies:
conda env create --name=my-env-name --file=environment_dev.yaml
- Download and install Anaconda. On windows, if
wingetis installed, the fastest way iswinget install anaconda3 - On windows, if the Terminal is used with PowerShell, do not forget to run
conda init powershell(which might require administrator rights) - Download and install
gitto clone this repository, e.g. withwinget install Git.Git - It is recommended to install the dependencies into a dedicated python
environment. This repository contains an example environment file
that can be used like this:
conda env create --file environment_dev.yaml - Activate the new environment with
conda activate work - If you want to use your new environment in
Spyder, you will likely need to installspyder-kernels. ButSpyderwill inform about the required version if necessary - Some dependencies (namely
dhnxandoemof) can only be obtained viapip, notconda - Installation instructions for
dhnxcan sometimes change, since it is often worked on. The publishedpipversion is not up-to-date, butenvironment_dev.yamlalways contains the current installation target, e.g. thedevbranch or a special feature branch. Perform adry-runfirst to see if any packages other than dhnx and oemof would be installed. Try to install those with conda, if possible. (Mixingpipandcondainstallations in generally not recommended, becausecondadoes not keep track of thepipinstallations properly.) To install thedevbranch ofdhnx, usepip install https://github.com/oemof/DHNx/archive/dev.tar.gz --dry-run - If everything seems fine, perform the actual installation with
pip install https://github.com/oemof/DHNx/archive/dev.tar.gz - Development on
dhnxis ongoing. Newer versions might require updates to the current workflow. These can be tested by installing directly from the repository at https://github.com/oemof/DHNx dhnxrequires a solver to perform its optimization, e.g. the freecbcorgurobi(which is faster)- The solver
cbc(https://github.com/coin-or/Cbc/releases/latest) is installed automatically to~\coin-or-cbcby the example workflow, if no solver is detected. Its location is added to the systempathonly during runtime, so it might not be available in other scripts - If the user is eligible, an academic license for
gurobican be obtained at https://www.gurobi.com/downloads/end-user-license-agreement-academic/ - To test the example OpenStreetMap workflow, run
python dhnx_addons.py