Enhance SAM with features tailored to your specific needs! We collaborate with companies, universities, and organizations to privately fund new capabilities or analyses. Your investment drives innovation while benefiting the broader energy community. Email us to learn more.

entering 35040 wind_resource data but SAM outputs 8760 generation

  • smishra732
  • Topic Author
More
06 Dec 2018 11:24 #6541 by smishra732
Hi Paul,

My goal is to output system generation (or system power) given wind_resource data as input to SAM. I am giving 35040 wind_resource data but the output is 8760 generation. The code is:

ssc = PySSC()
ssc.module_exec_set_print(0)
data = ssc.data_create()
module = ssc.module_create('windpower')

wind_resource = ssc.data_create()

ssc.data_set_number(wind_resource, 'latitude', self.latitude)
ssc.data_set_number(wind_resource, 'longitude', self.longitude)
ssc.data_set_number(wind_resource, 'elevation', self.elevation)
ssc.data_set_number(wind_resource, 'year', self.year)
heights = [self.hub_height_meters, self.hub_height_meters, self.hub_height_meters, self.hub_height_meters]
ssc.data_set_array(wind_resource, 'heights', heights)
fields = [1, 2, 3, 4]
ssc.data_set_array(wind_resource, 'fields', fields)

# temperature_celsius, pressure_atmospheres, wind_meters_per_sec and wind_direction_degrees are all of length 35040

data_matrix = np.matrix([self.temperature_celsius, self.pressure_atmospheres, self.wind_meters_per_sec, self.wind_direction_degrees])
data_matrix = data_matrix.transpose()
ssc.data_set_matrix(wind_resource, 'data', data_matrix.tolist() )

ssc.data_set_table(data, 'wind_resource_data', wind_resource)
ssc.data_set_number(data, 'wind_resource_shear', 0.14000000059604645)
ssc.data_set_number(data, 'wind_resource_turbulence_coeff', 0.10000000149011612)
ssc.data_set_number(data, 'system_capacity', self.system_capacity)
ssc.data_set_number(data, 'wind_resource_model_choice', 0)
ssc.data_set_number(data, 'weibull_reference_height', 50)
ssc.data_set_number(data, 'weibull_k_factor', 2)
ssc.data_set_number(data, 'weibull_wind_speed', 7.25)
ssc.data_set_number(data, 'wind_turbine_rotor_diameter', self.rotor_diameter)
ssc.data_set_array(data, 'wind_turbine_powercurve_windspeeds', self.wind_turbine_speeds)
ssc.data_set_array(data, 'wind_turbine_powercurve_powerout', self.wind_turbine_powercurve);
ssc.data_set_number(data, 'wind_turbine_hub_ht', self.hub_height_meters)
ssc.data_set_number(data, 'wind_turbine_max_cp', 0.44999998807907104)
wind_farm_xCoordinates = [0]
ssc.data_set_array(data, 'wind_farm_xCoordinates', wind_farm_xCoordinates)
wind_farm_yCoordinates = [0]
ssc.data_set_array(data, 'wind_farm_yCoordinates', wind_farm_yCoordinates)
ssc.data_set_number(data, 'wind_farm_losses_percent', 0)
ssc.data_set_number(data, 'wind_farm_wake_model', 0)
ssc.data_set_number(data, 'adjust:constant', 0)

ssc.data_free(wind_resource)
self.ssc = ssc
self.data = data
self.module = module

self.ssc.module_free(self.module)
system_power = self.ssc.data_get_array(self.data, 'gen')

# this system power is 8760. I expect it to be 35040.
Thanks for your time in advance..

Please Log in or Create an account to join the conversation.

  • Paul Gilman
More
28 Jan 2019 10:17 #6542 by Paul Gilman
Hi,

This should work. Would you mind emailing me the data (or a link to the data) you are working with?

Best regards,
Paul.

Please Log in or Create an account to join the conversation.

Moderators: Paul Gilman
Powered by Kunena Forum