Skip to content

Commit

Permalink
Update pGen with battery outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
brtietz committed Dec 5, 2024
1 parent ac78e40 commit 70ed538
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ssc/cmod_hybrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,10 @@ class cm_hybrid : public compute_module
if (batteries.size() > 0) {
use_batt_output = true;
pBattGen = ((var_table*)outputs)->lookup(batteries[0])->table.as_array("gen", &battGenLen);
for (size_t g = 0; g < genLength; g++) {
// Batt's gen is an inout that includes other system components
pGen[g] = pBattGen[g];
}
}

ssc_number_t* pHybridOMSum = ((var_table*)outputs)->allocate("cf_hybrid_om_sum", analysisPeriod + 1); // add to top level "output" - assumes analysis period the same for all generators
Expand Down

1 comment on commit 70ed538

@sjanzou
Copy link
Collaborator

@sjanzou sjanzou commented on 70ed538 Dec 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please confirm the array lengths are the same before assigning - i.e. genLength == battGenLen

Please sign in to comment.