Skip to content

A brief tutorial of SolarTherm

John Pye edited this page Sep 7, 2023 · 5 revisions

This a brief tutorial about SolarTherm that involves using a simple energy balance model of a concentrated solar power (CSP) system in SolarTherm to evaluate its annual energy production and levelised cost of electricity. This was originally developed by Armando Fontalvo, Ye Wang and John Pye in Oct 2020 for an undergraduate course called Solar Thermal Technologies at the Australian National University (ANU). The tutorial sections are visible at the right of this page.

1. Introduction

A CSP tower system consists of a heliostat field, tower and receiver, power block, and optional storage. The field of heliostats focus direct normal solar radiation onto the receiver at the top of the tower, where a heat-transfer fluid (HTF) is heated and pumped to the power block where the thermal energy is converted to electricity. In this tutorial, the SimpleSystem model within SolarTherm will be used to simulate a CSP system (See the figure below, source from https://www.energy.gov) to estimate its performance and revenue by considering the solar resource and meteorological conditions of Mildura (Australia).

screenshot

2. SolarTherm and OpenModelica

SolarTherm is a computational tool that encompasses a variety of solar thermal-related component models built on OpenModelica. Modelica is an object-oriented modelling language that models systems by using differential-algebraic equation systems (DAEs), and discrete events. SolarTherm uses the Modelica standard libraries (MSL), and also groups the models into categories for source input, collectors, receivers, storage, power blocks, fluid properties, control and finances. SolarTherm users can create or modify models, edit connections, simulate models, and plot results using a graphical user interface such as OMEdit (see Figure below), or by editing the model files and running the simulation from the command line on Windows or Linux.

screenshot

Additionally, SolarTherm includes a set of Python subroutines (called st tools) designed for data preparation, simulation execution, and post-simulation result processing. The SolarTherm package parameterises the size and cost of components, and also estimate the revenue of a power plant based on external user-defined electricity price data. Besides, the Levelised Cost of Electricity (LCOE) is processed by the Python subroutines.

  • st_simulate: a python script for simulating a plant model. It compiles the model, calls the simulation, and post processes the results. It can also be used for performing parameter sweeps or just changing individual parameters without having to recompile the model each time.

  • st_optimise: a python script for optimising model parameters according to some cost. Currently this supports the unconstrained methods provided in the scipy library.

  • st_plotmat: a python script for easily plotting the results from a simulation. Behind the scenes it uses the common matplotlib library.

  • st_wea_to_mo: a python script for converting TMY3 weather data into a format that is suitable for import into a simulation table.

  • st_inspect: a python script for converting simulation results into CSV data. Results are output to the console (standard output) but can also be directed into a file (e.g. st_inspect myfile.res>output.csv ).

You can learn more about the above-mentioned commands by typing one command with '-h'. It shows the corresponding user manual. For example:

st_simulate -h

2.1 Installation

To install and run SolarTherm from command lines,

2.2 Running SolarTherm examples

To run SolarTherm examples from command lines, follow the steps shown here.

Alternative, you can run SolarTherm examples via OMEdit following the instructions from here.

3. CSP system-modelling example using SolarTherm

For this tutorial, you will use a simplified CSP system model, called SimpleSystem, which you can find in the SolarTherm examples folder. To access the source code of this example, you can open the text file SimpleSystem.mo by using your preferred text editor or OMEdit.

The SimpleSystem models the heliostats field, the receiver, the power cycle, and the storage (see Figure below), while integrates the operation of intermediate devices, such as pumps and controllers, to the energy balances of the main components.

screenshot

The SimpleSystem uses a Modelica class called model. This class allows declaring parameters and variables, importing other model classes, making assignments through algorithms, and specifying the algebraic differential equations (ADE) that model the dynamic behaviour of the components.

3.1 Parameters

The parameters are user-defined variables to size the system and define its nominal ratings, the trips for the control, the schedule of the power block operation, and the capital and maintenance costs of the system. For this tutorial, you would focus on the following design parameters:

  • A_con parameter defines the total field area. The field area can be calculated as: $$A_\mathrm{con} = n_\mathrm{heliostats}\cdot A_\mathrm{heliostat}$$

    where $n_\mathrm{heliostats}$ is the number of heliostats and $A_\mathrm{heliostat}$ is the heliostat aperture area.

  • A_rec parameter defines the area that absorbs the concentrated solar radiation from the heliostats field.

  • P_name parameter defines the power output of the turbine at nominal operation.

  • t_storage parameter defines the time, in hours, that the turbine can operate at nominal conditions when the field is off. This parameters also defines the maximum capacity of the thermal energy storage.

  • eff_rec and eff_blk parameters define the energy conversion efficiencies of the receiver and the power block. By increasing these parameters you can boost the annual energy output of the plant.

This is how these parameters are defined within the model of SimpleSystem:

screenshot

As you will see in section 3.6, these parameters can be updated from the command line without access the source code.

3.2 Variables

The time-dependent variables are the product of solving the model at each time step and represent the output of the simulation. For this tutorial you will focus on the following variables:

  • Q_flow_rec : the receiver input, which is also the field output.
  • Q_flow\_chg : the receiver output, which is the energy input of the thermal energy storage.
  • Q_flow\_dis: the heat input to the run the power block.
  • P_elec : the net power output to the grid.
  • R_spot : the accumulated revenue of the system at each time step.
  • E_elec : the accumulated energy output of the system at each time step.
  • E : the energy stored at the tanks at each time step.

This is how these variables are defined within the model of SimpleSystem:

screenshot

3.3 Component modelling

3.3.1 Sun

The impleSystem considers only the direct normal irradiance (dni), which is obtained from a Typical Meteorological Year (TMY3) file for the location of Mildura (Australia). SolarTherm reads the TMY3 file and interpolates dni as a function of time.

This is how SolarTherm reads the TMY3 file and creates the object wea to interpolate the direct normal irradiance:

screenshot

3.3.2 Heliostat field

The model assumes a constant optical efficiency, but calculates the receiver input depending on the available DNI and the available storage capacity. The figure below shows the system operation modes. The system shuts-down the field when DNI is too low to operate, and starts-up the field until when the DNI is high enough to operate. The figure below also shows that the system operates the power block directly from the receiver when the storage is full.

screenshot

Based on the operation modes , the system calculates the receiver input as:

screenshot

This is how the heliostats field model is defined within the model of SimpleSystem:

screenshot

3.3.3 Receiver

The receiver output is calculated assuming a constant thermal efficiency:

$\dot{Q}_\mathrm{flow,chg} = \eta_\mathrm{rec}\dot{Q}_\mathrm{flow,rec}$

This is how the receiver model is defined within the model of SimpleSystem:

screenshot

3.3.4 Energy storage and power block

Energy storage is explicitly modelled only in the tanks, since the controlled dynamics of the receiver and power block is much faster. The energy accumulated in the storage is calculated based on the energy balance: $\frac{dE}{dt} = \dot{Q}_\mathrm{flow,charge} - \dot{Q}_\mathrm{flow,discharge}$

screenshot

From Figure above, the system shuts-down the power block when the storage is empty or there is no demand from the grid. Then it starts-up the power block when the storage is available and the demand is above zero.

screenshot

The SimpleSystem model simulates the power block operation assuming a constant power block efficiency $\eta_\mathrm{blk}$.

This is how the storage and power block models are defined within the \texttt{SimpleSystem}:

screenshot

3.4 System cost

The SimpleSystem model calculates the system cost from the following costing categories:

  • Field cost: The cost basis is 120 USD per m$^2$ of mirror area. Therefore $C_\mathrm{field} = 120\cdot A_{\mathrm{col}}$

  • Receiver cost: The receiver cost is calculated from the concentration ratio and the receiver area, i.e $C_\mathrm{rec} = 135\cdot C\cdot A_\mathrm{rec}$

    where the concentration ratio is $C = 0.65\cdot A_\mathrm{col}/A_\mathrm{rec}$

  • Storage cost: The cost basis is 30 USD per MWh of storage capacity, then $C_\mathrm{storage} = 30\cdot E_\mathrm{max,MWh}$

  • Power block cost: The cost basis is 1440 USD per kWe of power block nominal power, then $C_\mathrm{block} = 1440\cdot P_\mathrm{name,kWe}$

3.5 LCOE

The levelised cost of electricity (LCOE) is calculated by $$LCOE= \frac{ \sum_{i=0}^{i=t_\mathrm{cons}-1} \frac{C_\mathrm{tot}}{t_\mathrm{cons}(1+r)^i}+\sum_{i=1}^{i=t_\mathrm{life}} \frac{C_\mathrm{OM}}{(1+r)^i}} {\sum_{i=1}^{i=t_\mathrm{life}}\frac{E}{(1+r)^i}}$$

where $C_\mathrm{tot}$ is the total capital cost, $C_\mathrm{OM}$ is the operations and maintenance (O&M) cost, $E$ is the energy produced per year, $r$ is the real discounted rate, $t_\mathrm{cons}$ is the construction time and $t_\mathrm{life}$ is the total life time of the plant.

We take the convention that payments made or energy produced during a year are discounted at the end of that year. For example, in the O&M costs, the payment of the first year has a present value of $C_\mathrm{OM}/(1 + r)$. This will tend to underestimate costs but also underestimate the value of the energy produced. The effect will tend to be cancelled out, but it will remain a difference between LCOE calculated using the start of the year. The capital costs are discounted at the start of the year instead, and are split over each year of construction.

3.6 Running the case from a command line

  1. Open a new terminal window to run SolarTherm and type the following command to access the examples folder:\par
cd ~/solartherm/examples
  1. Then, run the following command to set up the correct environment variables for the command line to find SolarTherm:
st env
  1. Finally, run the st_simulate command to compile the SimpleSystem model, call the simulation, and post processes the results:
st_simulate SimpleSystem.mo

You should obtain the following results:

index,epy (MWh/year),lcoe ($/MWh),capf (%), srev ($)
0, 352.558326091, 96.4900803985, 40.246384257, 16518.5840944

You should read these results as follows:

  • index: 0
  • Annual energy output (epy): 352.558326091 MWh/year
  • Levelised cost of energy (lcoe): 96.4900803985 USD/MWh
  • Capacity factor (capf): 40.246384257%
  • Revenue (srev): 16518.5840944 USD
  1. Run the st_plotmat command to plot the following variables by using the python matplotlib library:
st_plotmat SimpleSystem_res_0.mat Q_flow_rec:wea.wbus.dni E P_elec
  1. This last command will open a window with which the user can see the full year simulation. The user can also zoom in and see different parts of the simulation (see the figure below).

screenshot

  1. To plot the results for a limited number of days, you can use the --xlim option from the st_plotmat command. As an example type the following instruction to plot the variables $\dot{Q}_\mathrm{flow,chg}$, $I_\mathrm{dni}$, $E$ and $P_\mathrm{elec}$ for the first 2 days of the year.
st_plotmat --xlim 0d 2d SimpleSystem_res_0.mat wea.wbus.dni:P_elec,Q_flow_chg E

screenshot

You will obtain the plots as shown above. From this Figure, on day 1 the receiver output ($1\dot{Q}_\mathrm{flow,chg}1$) follows the DNI profile, charging the storage and allowing the power block to run a few hours after sunset. However, on day 2 the DNI is higher than on day 1, increasing the receiver output. This causes the tank to fill up and the receiver output must be reduced in the afternoon. As a result, the stored energy is enough to run the power block a few hours more than on day 1.

  1. st_simulate can be used to run parametric sweeps. To sweep a parameter like the full load hours of storage (t_storage), a single command can be typed on the command line, obtaining the curves shown below
st_simulate --plot capf,epy,lcoe SimpleSystem.mo t_storage=5,6,7

screenshot

  1. To plot the dynamic results for one specific case in step 7), you can use the st_plotmat command and the index of the result file (SimpleSystem_res_*.mat): The * is 0 for the first case (t_storage=5), 1 for the second case (t_storage=6), and 2 for the third case (t_storage=7).

screenshot

From the figures below you can see that the 7-hour case produces more energy because it has a higher storage capacity and does not get full as quickly as the 6-hour and 5-hour cases.

screenshot

screenshot

screenshot

4. Questions to consider

This section contains several questions to think about and to check how you have learnt SolarTherm. The figure below (Source from NREL System Advisor Model) shows a schematic diagram of a two-tank CSP plant using solar salt as the heat transfer fluid and storage medium.

screenshot

The table below presents the default parameters of a 110 MWe of such kind CSP plant located in Mildura (Australia).

screenshot

  1. By using the SimpleSystem model and the data from the Table, determine the annual energy output, the capacity factor, and the LCOE of the CSP plant assuming a receiver efficiency of 80% and a power block efficiency of 43%.

  2. From the answer of question (1), plot the results for the summer and winter solstice (i.e. 21 Dec and 21 Jun) and compare the behaviour of DNI (dni), receiver output (Q_flow,chg), stored energy (E), and electricity output (P_elec) between these two days.

  3. Use the SimpleSystem to simulate the CSP plant in the Table but considering the following hours of storage: 8 h, 12 h, 16h and 18h.

    • (a) Plot and identify the trend in the annual energy output and the capacity factor when the storage hours are increased.

    • (b) Based on the behaviour of DNI (I_dni), receiver output (Q_flow,chg), stored energy (E), and electricity output (P_elec) for one week in summer and one week in winter, justify the trend from question 3(a).

    • (c) Plot and identify the trend in LCOE. Based on this trend, is it better to design CSP plants for low-capacity storage or high capacity storage? Justify your answer.

  4. Use the SimpleSystem to simulate the CSP plant in the Table but considering the following number of heliostats: 7000, 9000, 11000. Hint:

    • (a) Plot and identify the trend in the annual energy output and the capacity factor when the area of collector (field area) is increased.

    • (b) Based on the behaviour of DNI, receiver output, stored energy, and electricity output for one week in summer and one week in winter, justify the trend from question 4(a).

    • (c) Plot and identify the trend in LCOE. Based on this trend, is it better to design CSP plants with smaller or larger fields? Is it reasonable to make this decision based on a constant optical efficiency? Justify your answer.

  5. Use the SimpleSystem to simulate the CSP plant in the Table but considering the following receiver efficiencies: 70%, 80% and 90%.

    • (a) Plot and identify the trend in the annual energy output and the capacity factor when the receiver efficiency is increased.

    • (b) Based on the behaviour of DNI, receiver output, stored energy, and electricity output for one week in summer and one week in winter, justify the trend from question 5(a).

    • (c) Plot and identify the trend in LCOE. Is it reasonable to select the high-efficiency receiver under the assumptions of the SimpleSystem? Justify your answer.

  6. By using the SimpleSystem and the parameters from the Table, find the optimum hours of storage and number of heliostats that minimises LCOE.

  7. How does the SimpleSystem model work and how does Modelica solve equations? More to check here:

  8. Consider about the receiver model. Instead of using a constant receiver efficiency, how to physically evaluate the receiver efficiency with surface temperature, emissivity, external heat transfer coefficient and ambient temperature that provided in the weather file?

  9. The optical efficiency of the heliostat field is affected by sun positions, but was assumed as a constant in the SimpleSystem model. How to implement the field efficiency as a result that depends on sun positions? (Hint: see the model Reference_2.mo in the examples folder)

  10. How much backup fuels can be saved by applying the energy storage system in the configuration of the CSP plant that was defined in the table above?