Skip to content
schmager edited this page May 28, 2021 · 2 revisions

In order to calculate the spectral and hourly resolved irradiance data for the different locations, you need to download the SMARTS (Simple Model of the Atmospheric Radiative Transfer of Sunshine) and the TMY3 (Typical Meteorological Year) dataset!

You can also download the pre-calculated irradiance data for Miami in our first release. Extract the files to Irradiance\Spectra_722020TYA_Miami\ (see below for the exact folder structure). In this case you can skip (1) downloading the SMARTS code and the TMY3 dataset and (2) the calculation of the irradiance data, which takes (once) ~30 min for each location. However, if you want to work with different locations, you have to follow the guide below!

SMARTS

In order to download the SMARTS code, you need to register and agree their license requirements!

Download the files and extract them under:

Irradiance\Code_SMARTS_295_PC\
|--- Albedo
|--- CIE_data
|--- Documentation
|--- Examples
     ...
|--- smarts.295.exe
|--- smarts295.xls
|--- smarts295bat.exe

TMY3

You can find the TMY3 datasets on the NREL website. Download the National Solar Radiation Database 1991-2005 and extract the files here:

Irradiance\Dataset_TMY3\
|--- 690150TYA.CSV
|--- 690190TYA.CSV
|--- 690230TYA.CSV
     ...
|--- 912850TYA.CSV
|--- User Manual TMY3.pdf

Calculate the irradiance files

Now all required files for the irradiance calculations should be there and you can start to run the simulations for the spectral and hourly resolved realistic irradiance files.

You can do this with the example code provided in the main.m. First, select a location from the User Manual TMY3.pdf (p 23) and define the code and alias:

CodeLocation  = '722020TYA';
AliasLocation = 'Miami';

Next, simulate the irradiance data by calling the irradiance function:

Irradiance(CodeLocation, AliasLocation);

The irradiance function then calls three sub functions, which

  1. loads the TMY3 dataset for the specified location
  2. calculates the clear sky irradiance
  3. enhances the irradiance by a simple cloud model
% Extract the data from the TMY3 datasets
extractTMY3(Code_location,Alias_location)

% Calculate the irradiance spectra with help of the SMARTS code
calcSMARTS(Code_location,Alias_location)

% Enhance irradiance by a simply clouds model
simpleclouds(Code_location,Alias_location)

Note: Step 2, calcSMARTS() might fail on slower systems! In this case, you can increase some delays. See the debugging details below!

Once everything is done, the data is stored in the irradiance folder and it will look like:

Irradiance\
|--- Spectra_722020TYA_Miami
	 |--- Irr_spectra_clear_sky.mat
	 |--- Irr_spectra_clouds.mat
	 |--- TMY3_722020TYA_Miami.mat
|--- Spectra_722780TYA_Phoenix
     ...
|--- Spectra_726060TYA_Portland
     ....
|--- Spectra_AM1.5G_spectrum
     ....

ECOSTRESS spectral library

In order to use albedo, you need to download and extract the ECOSTRESS spectral data to the following folder:

EnergyYield\LibraryEcospec\
|--- artificialblack.txt
|--- artificialwhite.txt
|--- manmade.concrete.constructionconcrete.solid.all.0598uuucnc.jhu.becknic.spectrum.txt
|--- rock.sedimentary.sandstone.coarse.all.greywacke_1.jhu.becknic.spectrum.txt
|--- rock2.sedimentary.sandstone.fine.all.sandstone_1.jhu.becknic.spectrum.txt
     ....

Initially, only artificial black and artificial white are included. If you like add other or define your own grounds, search in the ECOSTRESS library or consult the ECOSTRESS documentation.

Debugging

On slower systems, the calculation of the irradiance data might fail due to a too short delay! You can simply increase the delay pause(xx) in the calcSMARTS() function:

[...]
while exist([location_SmartS,'\smarts295.out.txt'], 'file') ~= 2
    pause(0.02);  % you might need to increase this value a bit
end
while true
    pause(0.02);  % you might need to increase this value a bit
    try
        Data_import = importdata([location_SmartS,'\smarts295.ext.txt'],' ',1);
        break
    catch
        continue
    end
end
[...]
Clone this wiki locally