SAM sCO2 cycle integration macro

  • kongxiangfei
  • Topic Author
More
28 May 2024 18:41 #13211 by kongxiangfei
SAM sCO2 cycle integration macro was created by kongxiangfei
Dear developers:

Recently, I want to run a simulation about MSPT with SCO2 power cycle. I try to use the sCO2 cycle integration macro to define the power cycle. After running the macro, the message box shows "Macro did not finish, [132] operand to sizeof must be a array, string, or table type".  See the picture below. Does problem affect the simulation and how to solve this problem.

 

Thanks.

Best regards. 

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

  • pgilman
More
29 May 2024 10:15 #13212 by pgilman
Replied by pgilman on topic SAM sCO2 cycle integration macro
Hi Xiangfei Kong,

To run the "sCO2 Cycle Integration" macro with SAM's Molten Salt Power Tower model, you must first run the "Supercritical Carbon Dioxide (sCO2) Power Cycle Model" in Python to generate a JSON file. the macro reads the JSON file to populate SAM inputs with data from the Python model. The Python model is available in the SAM GitHub repository at github.com/NREL/SAM/tree/develop/samples/CSP/sco2_analysis_python_V2 .

You can investigate the macro error about Line 132 by clicking View code at the top right corner of SAM's Macros page to see the macro's source code. SAM macros are written in the LK scripting language, which is described on the SAM website here: sam.nrel.gov/lk-script.html .

This error suggests that there is a problem with the UDPC (User Defined Power Cycle) input table on the Power Cycle page. The 'udpc_table' value is set in Line 107 of the macro from the 'udpc_table' variable in the JSON file generated by the Python script.

Hopefully this information helps you troubleshoot this problem.

Best regards,
Paul.

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

Moderators: pgilman
Powered by Kunena Forum