reskit.csp.workflows.csp_workflow_manager#
Classes#
The WorkflowManager class assists with the construction of more specialized WorkflowManagers, |
Module Contents#
- class reskit.csp.workflows.csp_workflow_manager.PTRWorkflowManager(placements)#
Bases:
reskit.solar.workflows.solar_workflow_manager.SolarWorkflowManagerThe WorkflowManager class assists with the construction of more specialized WorkflowManagers, such as the WindWorkflowManager or the SolarWorkflowManager. In addition to providing the general structure for simulation workflow management, the WorkflowManager also defines functionalities which should be common across all WorkflowManagers.
- This includes:
Basic initialization
Time domain management
Reading weather data
Adjusting variables by a long-run-average value
Applying simple loss factors
Saving the state of WorkflowManagers to XArray datasets, either in memory or on disc
Initialization:#
WorkflowManager( placements )
__init_(self, placements)
Initialization of an instance of the generic SolarWorkflowManager clas
- param placements:
The locations that the simulation should be run for. Columns must include “lon”, “lat”
- type placements:
pandas Dataframe
- rtype:
SolarWorkflorManager
- _time_sel_ = None#
- _time_index_ = None#
- sim_data_daily#
- check_placements()#
- loadPTRdata(datasetname)#
Loads the dataset with the name datasetname.
- Parameters:
datasetname (str) – [description]
- determine_area()#
Determines the land area, aperture area from given placement dataframe. If only ‘area’ is given, it will be assumed as land area.
- get_timesteps()#
- check_ERA5_input()#
Check inputs
- direct_normal_irradiance_from_trigonometry()#
direct_normal_irradiance_from_trigonometry(self):
- Parameters:
None
- Return type:
Returns a reference to the invoking SolarWorkflowManager object.
Notes
Required columns in the placements dataframe to use this functions are ‘lon’, ‘lat’ and ‘elev’. Required data in the sim_data dictionary are ‘direct_horizontal_irradiance’ and ‘apparent_solar_zenith’.
- Calculates the direct normal irradiance from the following equation:
- \[dir_nor_irr = dir_hor_irr / cos( solar_zenith )\]
Where: dir_nor_irr -> The direct irradiance on the normal plane dir_hor_irr -> The direct irradiance on the horizontal plane solar_zenith -> The solar zenith angle in radians
- apply_elevation(elev)#
apply_elevation(self)
Adds an elevation (name: ‘elev’) column to the placements data frame.
- Parameters:
elev (str, list) – If a string is given it must be a path to a rasterfile including the elevations. If a list is given it has to include the elevations at each location.
- Return type:
Returns a reference to the invoking SolarWorkflowManager object
- apply_azimuth()#
Applies the azimuth angle for each placement. Three options: ‘northsouth’:
azimuth is always 180° (N-S)
- ‘eastwerst’:
azimuth is always 90° (E-W)
- ‘song2013’:
azimuth determined by lat: if |lat|<46: N-S, else: E-W
params: orientation: str
see above
- apply_capacity_sf()#
- calculateSolarPosition()#
Calculates the solar position in terms of hour angle and declination from time series and location series of the current object
- Returns:
[CSPWorkflowManager] –
solar_zenith_degree: solar zenith angle
solar_altitude_angle_degree: solar altitude (elevation) angle in degrees
aoi_northsouth: angle of incidence for northsouth-orientation of through
aoi_eastwest: angle of incidence for eastwest-orientation of through
- Return type:
Updated CSPWorkflowManager with new values for sim_data[‘values’][timeserie_iter, location_iter]. The calculated values are:
- calculateIAM(a1=0.000884, a2=5.369e-05, a3=0)#
Calculates the IAM (Incident Angle Modifier) angle modifier from incidence angle. Formula and default values are from: [1] GAFUROV, Tokhir, Julio USAOLA, and Milan PRODANOVIC. Modelling of concentrating solar power plant for power system reliability studies [online]. IET Renewable Power Generation. 2015, 9(2), 120-130. Available from: 10.1049/iet-rpg.2013.0377.
- Parameters:
a1 (float, optional) – IAM-modifier1. Defaults to 0.000884.
a2 (float, optional) – IAM-modifier1. Defaults to 0.00005369.
a3 (float, optional) – IAM-modifier1. Defaults to 0.
- Returns:
[CSPWorkflowManager]
- Return type:
[Updated CSPWorkflowManager with new value for sim_data[‘IAM’][timeserie_iter, location_iter]
- calculateShadowLosses(SF_density=0.383, method='wagner2011')#
Estimates shadow losses from solar field density and solar altitude
- Parameters:
SF_density (float, optional) – [description]. Defaults to 0.383.
method (str, optional) – [choose from ‘wagner2011’ and ‘gafurov2015’]
- Returns:
[type]
- Return type:
[description]
References
[1] WAGNER, Michael J. and Paul GILMAN. Technical Manual for the SAM Physical Trough Model, 2011. [2] GAFUROV, Tokhir, Julio USAOLA, and Milan PRODANOVIC. Modelling of concentrating solar power plant for power system reliability studies [online]. IET Renewable Power Generation. 2015, 9(2), 120-130. Available from: 10.1049/iet-rpg.2013.0377.
- calculateDegradationLosses(efficiencyDropPerYear=0, lifetime=40)#
- calculateWindspeedLosses(max_windspeed_threshold=14)#
If windspeed is above threshold, the efficiency is set to zero.
- Parameters:
max_windspeed_threshold (float, optional) – [description]. Defaults to 9999.
- Returns:
[CSPWorkflowManager]
- Return type:
[Updated CSPWorkflowManager with new value for sim_data[‘eta_wind’][timeserie_iter, location_iter] as np.narray
- calculateHeattoHTF(eta_ptr_max=0.742, eta_cleaness=1, eta_other=0.99)#
Calculates the heat from Collector to heat transfer fluid. The result is before the heat losses of the HTF.
- Parameters:
eta_ptr_max (float, optional) – [Value for optical efficiency of through mirror and absorber]. Defaults to 0.742.
eta_cleaness (float, optional) – Cleannes factor of the solar receiver (mirrors)
A_aperture_sf (int, optional) – [Size of the solar field in m^2]. Defaults to 909060.
eta_other (float)
- Returns:
[type]
- Return type:
[description]
- applyHTFHeatLossModel(calculationmethod='gafurov2013', params={})#
Calculate the heat losses of the HTF and determines the Heat output of the solar field
- Parameters:
calculationmethod (str, optional) – [calculation method for heat losses. Choose from ‘zero’ or ‘gafurov2013’]. Defaults to ‘zero’.
params (dict, optional) – [Parameters for the heat models as dict. For ‘gafurov2013’ use relHeatLosses and ratedFieldOutputHeat_W]. Defaults to {}.
- Raises:
error – [description]:
- Returns:
[CSPWorkflowManager]
- Return type:
[Updated CSPWorkflowManager with new value for sim_data[‘HeattoPlant_W’][timeserie_iter, location_iter] as np.narray
- calculateParasitics(calculationmethod='gafurov2013', params={})#
Calculating the parasitic losses of the plant
- Parameters:
calculationmethod (str, optional) – [description], by default ‘gafurov2013’
params (dict, optional) –
- For calculationmethod gafurov013:
PL_plant_fix: Fixed plant losses in % of design point power output of the plant PL_sf_track: Fixed solar field losses in % of design point power output of the field PL_sf_pumping: Solar field pumping losses in % of design point power output PL_plant_other: Plant Pumping losses in % of design point power output
- calculateCapacityFactors()#
- calculateEconomics_SolarField(WACC=8, lifetime=25, calculationmethod='franzmann2021', params={})#
Calculating the cost for internal heat from CSP. CAPEX: Contains solar field cost, land cost, indirect cost for solar field OPEX: fixOPEX is 2%/a of CAPEX and varCAPEX is electricity demand for solar field pumping
- Parameters:
WACC (float, optional) – [description], by default 8
lifetime (float, optional) – [description], by default 25
calculationmethod (str, optional) – [description], by default ‘franzmann2021’
params (dict, optional) – [description], by default {}
- Returns:
[description]
- Return type:
[type]
- optimize_plant_size(onlynightuse=True, fullvariation=False, debug_vars=False)#
Returns the optimal pLant configuration for each placement by finding the lowest expected LCOE: sm_opt, tes opt
- Parameters:
onlynightuse (bool, optional) – allheat has to be stored, i order to be used contrary to PV, by default True
fullvariation (bool, optional) – for plotting purpose, full variation can be set to true to calculate variation over more values, by default False
- optimize_heat_output_4D()#
- Calculates the heat usage for different type of plant configuration: SM and TES
- Calculates the following variables:
Annual heat: Total heat, that can be used annually for the plant configuration Direct heat Usage: Heat, that must be directly processed through the plant (storage size limitations) Stored heat: Heat, that is stored and can be used daily at any given time
- Returns:
[description]
- Return type:
[type]
- calculateEconomics_Plant_Storage_4D()#
Calculate the Capex for the Plant for placements, and variations of TES and SM
- Parameters:
params ([type]) – [description]
- Returns:
[description]
- Return type:
[type]
- optimal_Plant_Configuration_4D()#
- calculate_electrical_output(onlynightuse=True, debug_vars=False)#
From sm and tes opt, calculate the electrical output. idea: as much energy as possible will be stored to be flexible, the rest is forced to be depending on solar radiation
- calculate_LCOE()#
Calculates the LCOE from plant and storage sizes, SF totex and Net power output
- calculateSolarPositionfaster()#
DOES NOT WORK PV LIP DOES NOT SUPPORT MULTIPLE LOCATIONS calculates the solar position in terms of hour angle and declination from time series and location series of the current object
- Returns:
[CSPWorkflowManager] ([Updated CSPWorkflowManager with new value for sim_data[‘hour_angle’][timeserie_iter, location_iter] and)
sim_data[‘declination_angle’][timeserie_iter, location_iter]]
- _applyVariation()#
If DNI_factor and _T_offset in placements, manipulate the input time series in order to calculate the DNI/T_amb variation
- _get_capex(A_aperture_m2, A_land_m2, Qdot_field_des_W, eta_des_power_plant, sm, tes, c_field_per_aperture_area_EUR_per_m2, c_land_per_land_area_EUR_per_m2, c_storage_EUR_per_kWh_th, c_plant_EUR_per_kW_el, c_indirect_cost_perc_per_direct_Capex)#
Calculate the initial capex in EUR (Invest)
- Parameters:
A_aperture_m2 ([type]) – [description]
A_land_m2 ([type]) – [description]
Qdot_field_des_W ([type]) – [description]
eta_des_power_plant ([type]) – [description]
sm ([type]) – [description]
tes ([type]) – [description]
c_field_per_aperture_area_EUR_per_m2 ([type]) – [description]
c_land_per_land_area_EUR_per_m2 ([type]) – [description]
c_storage_EUR_per_kWh_th ([type]) – [description]
c_plant_EUR_per_kW_el ([type]) – [description]
c_indirect_cost_perc_per_direct_Capex ([type]) – [description]
annuity ([type]) – [description]
- Returns:
[description]
- Return type:
np.nparray
- _get_opex(CAPEX_total_EUR, OPEX_fix_perc_CAPEX_per_a, auxilary_power_Wh_per_a, electricity_price_EUR_per_kWh)#
Calculate the opex
- Parameters:
CAPEX_total_EUR ([type]) – [description]
OPEX_fix_perc_CAPEX_per_a ([type]) – [description]
auxilary_power_Wh_per_a ([type]) – [description]
electricity_price_EUR_per_kWh ([type]) – [description]
- _get_totex(CAPEX_total_EUR_per_a, OPEX_EUR_per_a)#
Calculate totex from capex and opex
- Parameters:
CAPEX_total_EUR_per_a ([type]) – [description]
OPEX_EUR_per_a ([type]) – [description]
- Returns:
[description]
- Return type:
[type]
- _get_totex_from_self(sm_manipulation=None, tes_manipulation=None, P_aux_manipulation=None)#
Calculates CSP Totes per a
- Returns:
TOTEX_EUR_per_a
- Return type:
pd.DataFrame
- _get_plant_efficiency(rel_load_plant, eta_nom)#
Calculate the efficiency for the powerplant depending on its size
- Parameters:
rel_load_plant ([type]) – [description]
eta_nom ([type]) – [description]
- Returns:
[description]
- Return type:
[type]