pvwattsv8 is not working in c#

  • asifak
  • Topic Author
More
22 Jul 2024 12:40 #13334 by asifak
pvwattsv8 is not working in c# was created by asifak
Hi 
I am using C-sharp to develop a code for pvwattsv8.

Interestingly, Modules pvwatts8 executes but without calculating any Power. Irradiance Data is being processed by the SAM Module pvwattsv8, however, it does not generate any Output realted to Power.

For instance, following Output variables are receiving values (there are few other output variable also which are getting values but I am not listing here )ghdndftambwspdsnowalbpoa_monthlysolrad_monthly
However, when it comes to the output variables related to Power like following then all gives 0 valuesolrad_monthlydc_monthlyac_monthlymonthly_energyannual_energy_distribution_timesolrad_annualac_annualac_annual_pre_adjustannual_energycapacity_factorcapacity_factor_ackwh_per_kw
I did many experiments like if there is any missing or wrong input, but I am unsuccessful. Here, very interestingly, when I execute the same code using Module pvwattsv5, then it works fine. Is'nt  this Strange!! I tried to find out whats the difference between Input Variables of Modules pvwatts5 and pvwatts8, tried to focus on that but still I am unsuccessful. 

I am attaching my c-sharp code herewith, and you may see in line 126 that module pvwatts8 is declared. simple changing this to pvwatts5, it works fine. 

File Attachment:

File Name: C-sharp co...tsv8.txt
File Size:19 KB
 
Attachments:

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

  • pgilman
More
22 Jul 2024 23:45 #13338 by pgilman
Replied by pgilman on topic pvwattsv8 is not working in c#
Hello,

Does the pvwattsv8 module generate a non-zero value for ac_annual when you run it using C# created by SAM's code generator for the default PVWatts / No Financial configuration?

To test that:

1. In SAM create a PVWatts / No Financial case.
2. From the Case menu, click Generate code and choose C# from the list of programming languages.
3. Run the resulting C# program from your coding environment.

If that works, I would recommend using that C# project as a basis for your code.

Best regards,
Paul.

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

  • asifak
  • Topic Author
More
25 Jul 2024 11:16 #13345 by asifak
Replied by asifak on topic pvwattsv8 is not working in c#
Hi Paul

Thanks for the quick response.

I am using PVWatts Non-Financial version to generate code c# coding. I think you might have missed my point in last message.

When I rum pvwattv8 simulation module in c# then it reads weather file and process the weather data and  generates output like gh, dn, df, aoi, poa, etc. 

However, it does not calculate any Power. In other words, my code genrates 0 value for all of the following variables: dc_monthly, ac_monthly, monthly_energy, capacity_factor, capacity_factor_ac, kwh_per_kw

So basically all power related output are zero values.

My same c# code works fime if I uses pvwattsv5 simulation module. 

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

  • asifak
  • Topic Author
More
26 Jul 2024 10:38 #13349 by asifak
Replied by asifak on topic pvwattsv8 is not working in c#
Reason Found and problem fixed,

Reason is I was using Weather File from another source. The paramter 'elevaton' was missing or set to null in the my Weather File, which perhaps forced all the calculations inside SAM Module pvwattsv8 to zero, therefore, all power outputs were zero.

Technically, above is ok, but shouldnot pvwattsv8 use a default value of elevation if it is missing in the weather file ? Other SAM modules lile pvwattsv5 works fine without this parameter of elevation. 

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

  • pgilman
More
31 Jul 2024 23:50 #13357 by pgilman
Replied by pgilman on topic pvwattsv8 is not working in c#
Thanks for the update.

The PV models should check for valid values in the weather file header. The elevation input is required for accurate sun position calculations, so the model should return an error if the input is missing or invalid. We will address this for a future update to SAM and PySAM:

github.com/NREL/ssc/issues/973

Best regards,
Paul.

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

Moderators: pgilman
Powered by Kunena Forum