- Posts: 18
Parametric Analysis of Parabolic Trough plant using SamUL
- hrk2888
- Topic Author
Less
More
14 Nov 2013 20:37 #1939
by hrk2888
Parametric Analysis of Parabolic Trough plant using SamUL was created by hrk2888
Hi,
I am trying to modify a sample SamUL script to perform a thorough parametric analysis and then writing the output in a csv file. I am trying to do it with 6-7 variables like SM, TES, Row Spacing, Stow angle, Deploy angle etc. Further, I want to use the collector, receiver and HTF fluid types available in the database. I can see that it is possible to give a range of values for the properties of the collector, receiver or HTF considering them as individual parameters. But, is it possible to use the ones available in database as is in the SamUL script?
I am imagining something like trying out SCA type 1 or HCE type 2 as a possible value of the parameter SCA or HCE respectively. Please give your suggestion on how to do it, if at all it is possible?
Thanks,
Hemang
I am trying to modify a sample SamUL script to perform a thorough parametric analysis and then writing the output in a csv file. I am trying to do it with 6-7 variables like SM, TES, Row Spacing, Stow angle, Deploy angle etc. Further, I want to use the collector, receiver and HTF fluid types available in the database. I can see that it is possible to give a range of values for the properties of the collector, receiver or HTF considering them as individual parameters. But, is it possible to use the ones available in database as is in the SamUL script?
I am imagining something like trying out SCA type 1 or HCE type 2 as a possible value of the parameter SCA or HCE respectively. Please give your suggestion on how to do it, if at all it is possible?
Thanks,
Hemang
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5423
15 Nov 2013 10:42 #1940
by pgilman
Replied by pgilman on topic Parametric Analysis of Parabolic Trough plant using SamUL
Dear Hemang,
It is possible to use SamUL to set the SCA for Types 1-4 and the HCE for Types 1-4, but you'll need to know the names of the following input variables to do so. Unfortunately, they do not appear in the SamUL editor's list of input variables.
For the physical trough model SCA, the input variables for the SCA name for each of Types 1 through 4 is:
csp.dtr.sca.notify_text_1
csp.dtr.sca.notify_text_2
csp.dtr.sca.notify_text_3
csp.dtr.sca.notify_text_4
Similarly, for the physical trough model HCEs:
csp.dtr.hce.notify_text_1
csp.dtr.hce.notify_text_2
csp.dtr.hce.notify_text_3
csp.dtr.hce.notify_text_4
To set the Type 1 SCA to the Luz LS-2 collector:
SetInput("csp.dtr.sca.notify_text_1","SAM/CSP Trough SCAs/Luz LS-2")
You can use the Library() function to generate a list of library names. For example, the SCA library is "TroughSCA".
I've attached a .zsam file that contains a sample script to your original post. I've also pasted the script below my signature.
Best regards,
Paul.
' SamUL Script Created: Fri Nov 15 08:20:35 2013 by Paul
setactivecase("Sample Trough")
sca1_current = getinput("csp.dtr.sca.notify_text_1") ' SCA name is stored as a string
sca2_current = getinput("csp.dtr.sca.notify_text_2") ' Number indicates the SCA type (1-4)
library_types = Library()
outln("List of SAM library names:")
outln(library_types)
outln()
sca = Library("TroughSCA") ' Library names are stored as strings
num_scas = length(sca)
outln("The trough SCA library contains " + num_scas + " SCAs:")
outln()
outln("Index Name")
outln("============================================")
for (i=0; i<num_scas; i=i+1)
outln(i + " " + sca) ' Library entries are stored in an array
end
outln()
' Change the SCA for Type 1
'
outln("The current SCA for Type 1 is " + sca1_current)
' Change SCA to Luz LS-3. If current SCA is LS-3 then change to LS-2 instead.
i = 2
if (sca1_current == sca) i = 1
setinput("csp.dtr.sca.notify_text_1",sca)
outln("The SCA for Type 1 changed to " + sca)
outln()
' Change the SCA for Type 2
'
outln("The current SCA for Type 2 is " + sca2_current)
i = 2
if (sca2_current == sca) i = 1
setinput("csp.dtr.sca.notify_text_2",sca)
outln("The SCA for Type 2 changed to " + sca)
outln()
outln("Check the SCA for Types 1 and 2 on the Collectors (SCA) input page.")
It is possible to use SamUL to set the SCA for Types 1-4 and the HCE for Types 1-4, but you'll need to know the names of the following input variables to do so. Unfortunately, they do not appear in the SamUL editor's list of input variables.
For the physical trough model SCA, the input variables for the SCA name for each of Types 1 through 4 is:
csp.dtr.sca.notify_text_1
csp.dtr.sca.notify_text_2
csp.dtr.sca.notify_text_3
csp.dtr.sca.notify_text_4
Similarly, for the physical trough model HCEs:
csp.dtr.hce.notify_text_1
csp.dtr.hce.notify_text_2
csp.dtr.hce.notify_text_3
csp.dtr.hce.notify_text_4
To set the Type 1 SCA to the Luz LS-2 collector:
SetInput("csp.dtr.sca.notify_text_1","SAM/CSP Trough SCAs/Luz LS-2")
You can use the Library() function to generate a list of library names. For example, the SCA library is "TroughSCA".
I've attached a .zsam file that contains a sample script to your original post. I've also pasted the script below my signature.
Best regards,
Paul.
' SamUL Script Created: Fri Nov 15 08:20:35 2013 by Paul
setactivecase("Sample Trough")
sca1_current = getinput("csp.dtr.sca.notify_text_1") ' SCA name is stored as a string
sca2_current = getinput("csp.dtr.sca.notify_text_2") ' Number indicates the SCA type (1-4)
library_types = Library()
outln("List of SAM library names:")
outln(library_types)
outln()
sca = Library("TroughSCA") ' Library names are stored as strings
num_scas = length(sca)
outln("The trough SCA library contains " + num_scas + " SCAs:")
outln()
outln("Index Name")
outln("============================================")
for (i=0; i<num_scas; i=i+1)
outln(i + " " + sca) ' Library entries are stored in an array
end
outln()
' Change the SCA for Type 1
'
outln("The current SCA for Type 1 is " + sca1_current)
' Change SCA to Luz LS-3. If current SCA is LS-3 then change to LS-2 instead.
i = 2
if (sca1_current == sca) i = 1
setinput("csp.dtr.sca.notify_text_1",sca)
outln("The SCA for Type 1 changed to " + sca)
outln()
' Change the SCA for Type 2
'
outln("The current SCA for Type 2 is " + sca2_current)
i = 2
if (sca2_current == sca) i = 1
setinput("csp.dtr.sca.notify_text_2",sca)
outln("The SCA for Type 2 changed to " + sca)
outln()
outln("Check the SCA for Types 1 and 2 on the Collectors (SCA) input page.")
Please Log in or Create an account to join the conversation.
- hrk2888
- Topic Author
Less
More
- Posts: 18
18 Nov 2013 19:00 #1941
by hrk2888
Replied by hrk2888 on topic Parametric Analysis of Parabolic Trough plant using SamUL
Hi Paul,
I have tried using the same logic as above to try to use all the collectors and receivers available in the library. I am just using the SCA type 1 and HCE type 1 and using a for loop to input all the library items in that variable. The result gets printed in my output csv file but, it seems its not getting used in the simulation. The results(LCOE, Annual Energy) do not change until one of my other variable's(SM, TES) value changes. I am using similar script as the PToptimize()sample which you suggested earlier.
Moreover, I also tried to use different types of heat transfer fluids. The simulation does give different results for different values when the integer value of HTF fluid is changed. But is there an option to display the name of the HTF fluid, without creating an array by manually entering the names.
Thanks.
I have tried using the same logic as above to try to use all the collectors and receivers available in the library. I am just using the SCA type 1 and HCE type 1 and using a for loop to input all the library items in that variable. The result gets printed in my output csv file but, it seems its not getting used in the simulation. The results(LCOE, Annual Energy) do not change until one of my other variable's(SM, TES) value changes. I am using similar script as the PToptimize()sample which you suggested earlier.
Moreover, I also tried to use different types of heat transfer fluids. The simulation does give different results for different values when the integer value of HTF fluid is changed. But is there an option to display the name of the HTF fluid, without creating an array by manually entering the names.
Thanks.
Please Log in or Create an account to join the conversation.
- hrk2888
- Topic Author
Less
More
- Posts: 18
18 Nov 2013 23:27 #1942
by hrk2888
Replied by hrk2888 on topic Parametric Analysis of Parabolic Trough plant using SamUL
Please see the sample output file which I have uploaded.
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5423
19 Nov 2013 09:44 #1943
by pgilman
Replied by pgilman on topic Parametric Analysis of Parabolic Trough plant using SamUL
Hi Hemang,
Are you using the SetInput() function to set the value of SCA Type 1? It should look something like this:
SetInput("csp.dtr.sca.notify_text_1","SAM/CSP Trough SCAs/Luz LS-2")
If you are still having trouble, could you add a copy of your SamUL script to the attachments to your original post? You can either cut and paste it from SAM's script editor into a text file, or save it as a .sul file from SAM.
Best regards,
Paul.
Are you using the SetInput() function to set the value of SCA Type 1? It should look something like this:
SetInput("csp.dtr.sca.notify_text_1","SAM/CSP Trough SCAs/Luz LS-2")
If you are still having trouble, could you add a copy of your SamUL script to the attachments to your original post? You can either cut and paste it from SAM's script editor into a text file, or save it as a .sul file from SAM.
Best regards,
Paul.
Please Log in or Create an account to join the conversation.
- hrk2888
- Topic Author
Less
More
- Posts: 18
19 Nov 2013 17:55 #1944
by hrk2888
Replied by hrk2888 on topic Parametric Analysis of Parabolic Trough plant using SamUL
I have uploaded the .sul file.
Please Log in or Create an account to join the conversation.
Moderators: pgilman