How to apply changes to the source code?

2 posts / 0 new
Last post
Zhuoran
How to apply changes to the source code?

Dear all,

I'm trying to derive the condenser pressure (P_cond) from the CSP parabolic trough physical model. Since this variable was not one of the defaulted outputs, I guessed I needed to modify the source code a little bit. But I found that I couldn't apply any change even after I modified the code. Here's what I did to test for the modification:

1. I commented the definition of an array output 'monthly_energy' in 'cmod_tcstrough_physical.cpp' (line 428 and line 1036).
2. I created a new dynamic library (ssc.dylib for OS X) using this modified code (I followed the wiki to make it)
3. In the python code folder that SAM software generated, I replaced the original dynamic library with the new one. Then I ran the code, and I could still get the results for 'monthly_energy', which I think should not be defined.

Did I wrongly understand the source code, or did I build the library in a wrong way?

Many thanks to your help and time!

Best regards,
Zhuoran

Paul Gilman

Dear Zhuoran,

I think you're on the right track. Commenting out Line 428 should be enough to prevent the variable from appearing in the results.

You might try replacing the dynamic library in your SAM installation with the one you compiled, and then regenerating the Python code from that modified version of SAM. (Of course, don't delete the original dynamnic library so you can go back to that if you need to.)

Please let me know whether or not that works.

Best regards,
Paul.

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer