CSP and Wind models combination

  • Mohammed Alfailakawi
  • Topic Author
More
17 Mar 2022 11:40 #10701 by Mohammed Alfailakawi
CSP and Wind models combination was created by Mohammed Alfailakawi
Hello, 
I have been trying to combine a CSP performance model with a wind model, I thought I might use LK for SDK and combine both models in order to get a integrated outputs, e.g. LCOE, CF, CAPEX and AEG.

Can this be realized by the SDK ?
Also, if yes that is doable, can I run the wind model for example under multiple configurations (say different number to turbines) along with different configurations of the CSP model (say different TES sizes)?

Thanks a lot.

Regards,
Mohammed
 

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

  • pgilman
More
17 Mar 2022 17:52 - 17 Mar 2022 17:57 #10702 by pgilman
Replied by pgilman on topic CSP and Wind models combination
Hi Mohammed,

You can use SAM's new Combine Cases feature for the Generic System model to do this. This short video on the SAM YouTube channel explains how:



You could also use the SDK to have more control over how the cases are combined.

Best regards,
Paul.
Last edit: 17 Mar 2022 17:57 by pgilman.

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

  • Mohammed Alfailakawi
  • Topic Author
More
18 Mar 2022 10:34 #10705 by Mohammed Alfailakawi
Replied by Mohammed Alfailakawi on topic CSP and Wind models combination
Wow! that's really great!
Thanks a lot I really appreciate it!

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

  • Mohammed Alfailakawi
  • Topic Author
More
22 Mar 2022 11:40 #10720 by Mohammed Alfailakawi
Replied by Mohammed Alfailakawi on topic CSP and Wind models combination
Dear Mr. Gilman,

One more question about the multiple RE systems combination.
I created a wind turbine model (WT) and a solar power tower model (SPT) and then a combined WT + SPT model using the Combine Cases feature. Then, I created a simple loop in a script in order to vary the TES and SM of the SPT and see how this will effect the combined WT + SPT model as follows:

a = csvread(cwd()+'/Design TES range.csv', {'skip'=1, 'numeric'=true});
b = csvread(cwd()+'/Design SM range.csv', {'skip'=1, 'numeric'=true});

active_case = ('WT + SPT');

for (i=0; i<19; i++)
   
     {   for (k=0; k<16; k++)
  
{
     R = a[0];
              set ('tshours', R);
     
              R = b[k][0];
              set ('solarm', R);
     
              simulate ();   
                
              Annualgen = get('annual_energy_pre_curtailment_ac');
              CapacityFac = get('capacity_factor');
              LCOE = get('lcoe_real');
                   
              outln(LCOE);
              outln(CapacityFac);
              outln(Annualgen);
                   
            }  
      }  


The problem is that the loop only works for the SPT model (when I shift to the SPT model) and outputs the results of the SPT. When I shift to the combined WT +SPT and run the loop, I get the same results each time.

I also generated a LK for SDK code for the combined WT + SPT, however didn't find the desired variables that I would like to change through the loop (TES and SM).

Is it possible to run such loop on a combined RE system?

Thanks a lot.

Regards,
Mohammed

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

  • Mohammed Alfailakawi
  • Topic Author
More
27 Mar 2022 11:31 #10730 by Mohammed Alfailakawi
Replied by Mohammed Alfailakawi on topic CSP and Wind models combination
Dear Mr. Gilman,

I hope this finds well.

I combined a wind turbine model (WT) and a Solar Power Tower (SPT) model using the Combined Cases Feature (WT +SPT) and since then I have been trying to automate the combined model (through changing some parameters inside the individual cases, e.g. TES and SM of the SPT) and could not.

I wrote this simple loop in LK which works for the individual case but not for the combined one (the loop seems to ''work'' but with the same results values each time..):
a = csvread('C:/Users/Mohammed/Desktop/SAM trials/SPT + WT/Design TES range.csv', {'skip'=1, 'numeric'=true});
b = csvread('C:/Users/Mohammed/Desktop/SAM trials/SPT + WT/Design SM range.csv', {'skip'=1, 'numeric'=true});

active_case = ('WT + SPT');

for (i=0; i<16; i++)
                 
{    R = b[0];
              set ('solarm', R);
     
              simulate ();   
                
              Annualgen = get('annual_energy_pre_curtailment_ac');
              CapacityFac = get('capacity_factor');
              LCOE = get('lcoe_real');
                   
              outln(LCOE);
              outln(CapacityFac);
              outln(Annualgen);         }  

Can the combined case be automated?

I also tried using the LK for SDK (generating a code for each individual case and combining them manually), however had difficulties changing the variables from being a single value to an array. The following loop ''worked'' however with the same results each time and had the message below:
a = csvread('C:/Users/Mohammed/Desktop/SDK for MOO/Design no of WT range.csv', {'skip'=1, 'numeric'=true});
for (i=0; i<5; i++)
   
{ R = a[0];
var ('num_turbines', R); }


The message:
Notice: precheck input: variable 'num_turbines' (Number of Turbines) required but not assigned time -1.000000

Thanks a lot in advance.

Regards,
Mohamed

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

  • pgilman
More
28 Mar 2022 15:32 - 28 Mar 2022 15:33 #10745 by pgilman
Replied by pgilman on topic CSP and Wind models combination
Hi Mohamed,

You should be able to accomplish this using LK in SAM. It might be easier than working in SDKtool because the user interface helps to ensure that all of the inputs are correctly set.

The overall steps would be:

1. Create cases for the combined system as you would normally: Create generic system / single owner, wind power / single owner, molten salt power tower / single owner cases.

2. Run a script that sets inputs for the wind and power tower cases, runs a simulation for each, adds the resulting output arrays to calculate the total output, and sets the generic system input power generation profile to the total output.

Pseudocode for the script would be:
Code:
1. active_case( 'power tower case name') 2. Set inputs for power tower case. 3. simulate() 4. power_tower_output_array = get('gen') 5. active_case( 'wind power case name' ) 6. Set inputs for wind power case. 7. simulate() 8. wind_output_array = get('gen'); 9. for ( i=0; i<#gen; i++ ) { total_output[i] = power_tower_output_array[i] + wind_output_array[i] } 10. active_case( 'generic system case name' ) 11. set( 'spec_mode', 1 ) // sets mode to import hourly or subhourly profile from file 12. set('energy_output_array', total_output) 13. simulate() 14. Get outputs from generic system case.

Note that the Combine Cases feature in SAM has an option to calculate total installed and operating costs for the generic system case from the inputs for the other cases. I did not include that step in my pseudocode, so you would have to set those costs by hand before running the script, or add those steps to your script.

Best regards,
Paul.
Last edit: 28 Mar 2022 15:33 by pgilman.

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

Moderators: pgilman
Powered by Kunena Forum