- Posts: 7
Embedded equations in SAM software
- Zhuoran
- Topic Author
Less
More
17 Nov 2020 09:37 #9010
by Zhuoran
Embedded equations in SAM software was created by Zhuoran
Dear team,
I've been looking at how variables are calculated within SAM software. Specifically in CSP parabolic trough model, it uses lookup functions to find the TES fluid density/specific heat as indicated in the help menu.
May I ask where I can find those lookup functions?
I checked the UI files in SAM/runtime/ui folder, but only find the function names that being called, such as 'substance_density' or 'cspdtr_tes_userhtf'. I couldn't find the definition of those functions. Could you help me locate them? Thanks!
Best,
Zhuoran
I've been looking at how variables are calculated within SAM software. Specifically in CSP parabolic trough model, it uses lookup functions to find the TES fluid density/specific heat as indicated in the help menu.
May I ask where I can find those lookup functions?
I checked the UI files in SAM/runtime/ui folder, but only find the function names that being called, such as 'substance_density' or 'cspdtr_tes_userhtf'. I couldn't find the definition of those functions. Could you help me locate them? Thanks!
Best,
Zhuoran
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5447
30 Nov 2020 10:28 - 30 Nov 2020 10:29 #9031
by pgilman
Replied by pgilman on topic Embedded equations in SAM software
Hi Zuoran,
If the heat transfer fluid is user-defined, SAM uses a lookup function to interpolate between the values provided in a table of fluid properties. For the physical trough model, you can find an example of a user-defined HTF table for the Storage HTF fluid input on the Thermal Storage input page: Choose the user-defined fluid from the list, and then click Edit to see the table.
The lookup function Linear_Interp::linear_1D_interp() interpolates these table values and is defined in tcs/interpolation_routines.cpp: github.com/NREL/ssc/blob/develop/tcs/interpolation_routines.cpp#L65 .
For non-user-defined heat transfer fluids, the property functions are in tcs/htf_props.cpp: github.com/NREL/ssc/blob/develop/tcs/htf_props.cpp#L309 .
Functions from the user interface call intermediate functions in the SSC code like the ones here, github.com/NREL/ssc/blob/develop/ssc/cmod_ui_tes_calcs.cpp#L128 , but the final calls are to htf_props.cpp.
Best regards,
Paul.
If the heat transfer fluid is user-defined, SAM uses a lookup function to interpolate between the values provided in a table of fluid properties. For the physical trough model, you can find an example of a user-defined HTF table for the Storage HTF fluid input on the Thermal Storage input page: Choose the user-defined fluid from the list, and then click Edit to see the table.
The lookup function Linear_Interp::linear_1D_interp() interpolates these table values and is defined in tcs/interpolation_routines.cpp: github.com/NREL/ssc/blob/develop/tcs/interpolation_routines.cpp#L65 .
For non-user-defined heat transfer fluids, the property functions are in tcs/htf_props.cpp: github.com/NREL/ssc/blob/develop/tcs/htf_props.cpp#L309 .
Functions from the user interface call intermediate functions in the SSC code like the ones here, github.com/NREL/ssc/blob/develop/ssc/cmod_ui_tes_calcs.cpp#L128 , but the final calls are to htf_props.cpp.
Best regards,
Paul.
Last edit: 30 Nov 2020 10:29 by pgilman.
Please Log in or Create an account to join the conversation.
- Zhuoran
- Topic Author
Less
More
- Posts: 7
01 Dec 2020 09:27 #9036
by Zhuoran
Replied by Zhuoran on topic Embedded equations in SAM software
Thanks Paul! This is what I wanted to find. Really appreciate for your help.
Best regards,
Zhuoran
Best regards,
Zhuoran
Please Log in or Create an account to join the conversation.
Moderators: pgilman