Skip to content

Commit

Permalink
PV-Wind-Battery configurations initially running
Browse files Browse the repository at this point in the history
  • Loading branch information
sjanzou committed Sep 3, 2023
1 parent 7ca15af commit 115abc5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ssc/cmod_hybrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,8 @@ class cm_hybrid : public compute_module
if ( ts_adj ) log(util::format("Simulation time step for hybrid system is %d minutes.", 60 / int(maximumTimeStepsPerHour), SSC_NOTICE));
size_t genLength = 8760*maximumTimeStepsPerHour*analysisPeriod;// assumes single year gen
ssc_number_t* pGen = ((var_table*)outputs)->allocate("gen", genLength); // add to top level "output" - assumes analysis period the same for all generators
// ssc_number_t* pGen = ((var_table*)outputs)->allocate("gen", genLength); // move to top level to use accumlate funtions below - fails precheck


// TODO - test for different timesteps for each generator and lifetime and non-lifetime generators
size_t idx = 0;
for (size_t i=0; i<genLength; i++)
pGen[i] = 0.0;
Expand All @@ -245,7 +244,10 @@ class cm_hybrid : public compute_module
for (size_t sph = 0; sph < maximumTimeStepsPerHour; sph++) {
size_t offset = sph / maximumTimeStepsPerHour / genTimestepsPerHour[g];
if (offset > genTimestepsPerHour[g]) offset = genTimestepsPerHour[g];
pGen[idx] += gen[h + offset] * cf_degradation[y]; // Not valid for lifetime output - e.g. pvsamv1
if (count_gen == genLength)
pGen[idx] += gen[idx]; // lifetime output with degradation and availability
else
pGen[idx] += gen[h + offset] * cf_degradation[y];
idx++;
}
}
Expand Down
1 change: 1 addition & 0 deletions ssc/cmod_pvsamv1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1060,6 +1060,7 @@ cm_pvsamv1::cm_pvsamv1()
add_var_info(vtab_resilience_outputs);
add_var_info(vtab_utility_rate_common); // Required by battery
add_var_info(vtab_grid_curtailment); // Required by battery
add_var_info(vtab_hybrid_tech_om);
}


Expand Down

0 comments on commit 115abc5

Please sign in to comment.