|
1 | 1 | # Euro Calliope |
2 | 2 |
|
3 | | -A model of the European power system built using Calliope. |
| 3 | +A model of the European electricity system built using Calliope. |
4 | 4 |
|
5 | | -This repository contains the model and the routines that automatically generate the model from source data. |
| 5 | +This repository contains the workflow routines that automatically build the model from source data. Alternatively to building models yourself, you can use pre-built models that run out-of-the-box, see link below. |
6 | 6 |
|
7 | | -## Getting ready |
| 7 | +[](https://doi.org/10.5281/zenodo.3949553) |
8 | 8 |
|
9 | | -You need [conda](https://conda.io/docs/index.html) to use the model. Using conda, you can create a conda environment from within you can run the model: |
| 9 | +## At a glance |
10 | 10 |
|
11 | | - conda env create -f requirements.yml |
| 11 | +euro-calliope models the European electricity system with each location representing an administrative unit. It can be built on three spatial resolutions: on the continental level as a single location, on the national level with 34 locations, and on the regional level with 497 locations. On each node, renewable generation capacities (wind, solar, bioenergy) and balancing capacities (battery, hydrogen) can be built. In addition, hydro electricity and pumped hydro storage capacities can be built up to the extent to which they exist today. All capacities are used to satisfy electricity demand on all locations which is based on historic data. Locations are connected through transmission lines of unrestricted capacity. Using [Calliope](https://www.callio.pe), the model is formulated as a linear optimisation problem with total monetary cost of all capacities as the minimisation objective. All elements of euro-calliope can be manipulated either by changing the configuration in `config/default.yaml` or by manipulating the build workflow before building the model. |
12 | 12 |
|
13 | | -Don't forget to activate the environment. |
| 13 | +## Get ready to build the model |
| 14 | + |
| 15 | +1. The workflow is developed on macOS, should run on Linux (untested), and cannot run natively on Windows. |
| 16 | + |
| 17 | +2. You need [conda](https://conda.io/docs/index.html) to build and use the model. Using conda, you can create a conda environment from within you can build the model: |
| 18 | + |
| 19 | +``` |
| 20 | +conda env create -f environment.yaml |
| 21 | +conda activate euro-calliope |
| 22 | +``` |
| 23 | + |
| 24 | +3. You need a Gurobi license installed on your computer, or you need to choose a different solver. |
| 25 | + |
| 26 | +4. You need an account at the Copernicus Climate Data Service and you need to create a `$HOME/.cdsapirc` file with your credentials, see their [How To](https://cds.climate.copernicus.eu/api-how-to) (you do not need to manually install the client). |
| 27 | + |
| 28 | +5. Further, you need all data files that cannot be retrieved automatically: |
| 29 | + |
| 30 | +* [Maritime Boundaries v10 -> World Exclusive Economic Zones v10](http://www.marineregions.org/downloads.php), to be placed in `./data/World_EEZ_v10_20180221` |
| 31 | +* [hydroBASINS -> Standard -> Europe and Middle East -> hybas_eu_lev07_v1c](https://www.hydrosheds.org/downloads) downloaded to `./data/hybas_eu_lev07_v1c/` |
| 32 | + |
| 33 | +## Build the model |
| 34 | + |
| 35 | +Because input data is large, the actual model including its data is not part of this repository. To use the model, you first need to build it from input data and scripts. Running the build step will build the model in the `./model` folder. |
| 36 | + |
| 37 | + snakemake --use-conda |
| 38 | + |
| 39 | +## Build the model on Euler cluster |
| 40 | + |
| 41 | +To run on Euler, use the following command: |
| 42 | + |
| 43 | + snakemake --use-conda --profile config/euler |
| 44 | + |
| 45 | +If you want to run on another cluster, read [snakemake's documentation on cluster execution](https://snakemake.readthedocs.io/en/stable/executable.html#cluster-execution) and take `config/euler` as a starting point. |
14 | 46 |
|
15 | 47 | ## Example use of the model |
16 | 48 |
|
17 | | -Coming soon. |
| 49 | +The build step creates all individual components of `euro-calliope`, like technologies and time series. These can be combined to eventually build a final model to run simulations with. For an example of such a model, see `./build/model/{resolution}/example-model.yaml`. It is a complete Calliope model and can be used like any other, for example like this: |
18 | 50 |
|
19 | | -## Run the tests |
| 51 | +```Bash |
| 52 | +$ calliope run ./build/model/national/example-model.yaml |
| 53 | +``` |
20 | 54 |
|
21 | | -Coming soon. |
| 55 | +For more information on how to use and modify Calliope models, see [Calliope's documentation](https://calliope.readthedocs.io). |
| 56 | + |
| 57 | +## Model components |
| 58 | + |
| 59 | +After a successful full build (see "Build the model"), the following files will exist in `build/model`: |
| 60 | + |
| 61 | +``` |
| 62 | +├── {resolution} <- For each spatial resolution an individual folder. |
| 63 | +│ ├── capacityfactors-{technology}.csv <- Timeseries of capacityfactors of all renewables. |
| 64 | +│ ├── directional-rooftop.yaml <- Override discriminating rooftop PV by orientation. |
| 65 | +│ ├── electricity-demand.csv <- Timeseries of electricity demand on each node. |
| 66 | +│ ├── example-model.yaml <- Calliope model definition. |
| 67 | +│ ├── link-all-neighbours.yaml <- Connects neighbouring locations with transmission. |
| 68 | +│ ├── locations.csv <- Map from Calliope location id to name of location. |
| 69 | +│ └── locations.yaml <- Defines all locations and their max capacities. |
| 70 | +├── build-metadata.yaml <- Metadata of the build process. |
| 71 | +├── demand-techs.yaml <- Definition of demand technologies. |
| 72 | +├── environment.yaml <- A conda file defining an environment to run the model. |
| 73 | +├── interest-rate.yaml <- Interest rate of all capacities. |
| 74 | +├── link-techs.yaml <- Definition of link technologies. |
| 75 | +├── README.md <- Documentation. |
| 76 | +├── renewable-techs.yaml <- Definition of supply technologies. |
| 77 | +└── storage-techs.yaml <- Definition of storage technologies. |
| 78 | +``` |
| 79 | + |
| 80 | +Alternatively to a full build, each of these model components can be built individually, by running `snakemake --use-conda <path-to-component>`. The model components can be used to [configure a Calliope model](https://calliope.readthedocs.io/en/stable/user/building.html). For an example model configuration, see "Example use of the model" above. |
| 81 | + |
| 82 | +## Units and scaling |
| 83 | + |
| 84 | +The default units used within euro-calliope are `100 GW`, `100 GWh`, `billion EUR`, and `10,000 km2`. All data going into Calliope and all Calliope result data will be given using these units. While they may be unusual, these units lead to a numerical model that is well suited for the interior-point solution algorithm that is used by default. The units are tuned so as to work best for models with a time resolution of a few hours and a duration of one year. For other types of problems, or other solution algorithms, the units may need to be changed to avoid numerical issues within the solver. |
| 85 | + |
| 86 | +You can easily change the units and scale all values using the `scaling-factor` configuration values in `config/default.yaml`. However, these values must be changed before building the model. You may want to run `snakemake clean` before changing these values. The base units on which the scaling factors are applied are `1 MW`, `1 MWh`, `EUR`, and `km2`. So for example, the default unit for energy (100 GWh) is derived by scaling the base unit (1 MWh) with a scaling factor of `0.00001`. |
22 | 87 |
|
23 | 88 | ## Repo structure |
24 | 89 |
|
25 | | -* `model`: contains the entire model, including Calliope definition files and data |
26 | | -* `src`: contains the Python source code to generate the model |
27 | | -* `tests`: contains a test usage of the model |
| 90 | +* `build/model`: Contains the entire model after the build step, including Calliope definition files and data (does not exist initially). |
| 91 | +* `config`: Files with configuration parameters which influence the model build process. |
| 92 | +* `data`: Small input data used within the model build process. |
| 93 | +* `docs`: Documentation of the model and the build process. |
| 94 | +* `envs`: Files defining the conda environment which are used to build the model. |
| 95 | +* `rules`: Snakemake workflows defining the build process. |
| 96 | +* `src`: Contains the source code to build the model. |
| 97 | +* `tests`: Contains a test usage of the model. |
| 98 | + |
| 99 | +## Run the tests |
| 100 | + |
| 101 | +Tests of models with continental and national resolution run automatically when you run the entire workflow. To run the tests of models with regional resolution do the following: |
| 102 | + |
| 103 | + snakemake --use-conda build/logs/regional/test-report.html |
| 104 | + |
| 105 | +Exchanging `regional` with `national` or `continental` allows you to run tests on the respective resolution explicitly. |
| 106 | + |
| 107 | +## License |
| 108 | + |
| 109 | +euro-calliope has been developed and is maintained by Tim Tröndle, IASS Potsdam. The code in this repository is MIT licensed. |
0 commit comments