- Posts: 6
Running Solar Tower optimization from script
- Croisfelt
- Topic Author
Less
More
05 Sep 2016 13:56 #4740
by Croisfelt
Running Solar Tower optimization from script was created by Croisfelt
Hello NREL,
I would like to know if there is any special function to be called before running a simulation from script, in case of optimization of Heliostat Field for SAM CSP power tower model.
I wrote a script to run several simulations by varying some parameters, but for some scenarios I get different results from a run done directly through SAM's interface (pushing "Simulate" button). I am using "for" looping and calling simulate() function. Simplifying the code (erasing other loops and commands to save outputs) it remains like below:
//Code for solar tower molten salt
set('override_layout',1); //always layout heliostat field
set('override_opt',1);//always optimize heliostat field
outln("Set to auto optimize");
for (Solar_multiple=2; Solar_multiple
I would like to know if there is any special function to be called before running a simulation from script, in case of optimization of Heliostat Field for SAM CSP power tower model.
I wrote a script to run several simulations by varying some parameters, but for some scenarios I get different results from a run done directly through SAM's interface (pushing "Simulate" button). I am using "for" looping and calling simulate() function. Simplifying the code (erasing other loops and commands to save outputs) it remains like below:
//Code for solar tower molten salt
set('override_layout',1); //always layout heliostat field
set('override_opt',1);//always optimize heliostat field
outln("Set to auto optimize");
for (Solar_multiple=2; Solar_multiple
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5423
06 Sep 2016 10:18 #4741
by pgilman
Replied by pgilman on topic Running Solar Tower optimization from script
Dear Thiago,
I will look at your code more closely when I have a chance. In the meantime, did you see the sample LK script for running SolarPILOT? Perhaps it will help you solve your problem. It is available as item #7 in the LK Cookbook:
sam.nrel.gov/samples
Best regards,
Paul.
I will look at your code more closely when I have a chance. In the meantime, did you see the sample LK script for running SolarPILOT? Perhaps it will help you solve your problem. It is available as item #7 in the LK Cookbook:
sam.nrel.gov/samples
Best regards,
Paul.
Please Log in or Create an account to join the conversation.
- ceandra@sandia.gov
Less
More
- Posts: 8
06 Sep 2016 15:41 #4742
by ceandra@sandia.gov
Replied by ceandra@sandia.gov on topic Running Solar Tower optimization from script
Thiago:
I have seen similar issues with auto-optimization not playing well with scripting or with parametric studies, while manual optimization and field layout does work. One particular aspect is that auto-optimization does not seem to account for peak flux on the receiver, setting it to 1000 no matter your setting. Manual optimization correctly abides by this constraint.
That said, I ran your script on a new (clean) MS Power Tower, and it does appear to optimize. However, the reported number of heliostats is incorrect, while the reported area of glass is correct.It appears the code used the correct number of heliostats (optimized number), but reported the wrong number.
In similar cases I have taken the advice NREL has given you, and built the optimization into the loop rather than relying on the auto-optimization check box. Similarly, running parametric cases should be run with a looping script rather than the built-in parametric tool. Once you do this once, you will prefer this method anyway.
Chuck
I have seen similar issues with auto-optimization not playing well with scripting or with parametric studies, while manual optimization and field layout does work. One particular aspect is that auto-optimization does not seem to account for peak flux on the receiver, setting it to 1000 no matter your setting. Manual optimization correctly abides by this constraint.
That said, I ran your script on a new (clean) MS Power Tower, and it does appear to optimize. However, the reported number of heliostats is incorrect, while the reported area of glass is correct.It appears the code used the correct number of heliostats (optimized number), but reported the wrong number.
In similar cases I have taken the advice NREL has given you, and built the optimization into the loop rather than relying on the auto-optimization check box. Similarly, running parametric cases should be run with a looping script rather than the built-in parametric tool. Once you do this once, you will prefer this method anyway.
Chuck
Please Log in or Create an account to join the conversation.
- Croisfelt
- Topic Author
Less
More
- Posts: 6
09 Sep 2016 12:27 #4743
by Croisfelt
Replied by Croisfelt on topic Running Solar Tower optimization from script
Hello Chuck and Paul,
I changed my code, applying the manual optimization from the sample script for solarpilot (from sam.nrel.gov/samples ) and now we are getting good results. However, I think it would be simpler to learn and to code by calling the auto-optimization for each run.
Thank you for the advice!
Thiago
I changed my code, applying the manual optimization from the sample script for solarpilot (from sam.nrel.gov/samples ) and now we are getting good results. However, I think it would be simpler to learn and to code by calling the auto-optimization for each run.
Thank you for the advice!
Thiago
Please Log in or Create an account to join the conversation.
Moderators: pgilman