Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inverter Temperature Derate based on Pmax ratio #471

Merged
merged 20 commits into from
Nov 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
d3b1051
Updated inverter temp derate function to be based on power ratio rather
mjprilliman Oct 26, 2020
aaf9e53
Merge branch 'develop' into inv_temp_derate_pmax
mjprilliman Oct 26, 2020
e5663c1
Merge branch 'develop' into inv_temp_derate_pmax
mjprilliman Oct 27, 2020
202f9f6
Merge branch 'develop' into inv_temp_derate_pmax
mjprilliman Oct 27, 2020
209db8f
Updated variables in shared inverter test
mjprilliman Oct 27, 2020
9b923f2
Merge branch 'develop' into inv_temp_derate_pmax
mjprilliman Oct 27, 2020
2aec0d3
Fixed ratio value for shared inverter calculation of AC power, updated
mjprilliman Oct 28, 2020
0d62263
Merge branch 'develop' into inv_temp_derate_pmax
mjprilliman Oct 30, 2020
afcd907
make error about slope > 0 rather than slope >= 0
dguittet Oct 30, 2020
4d28ee0
Merge branch 'inv_temp_derate_pmax' of https://github.com/nrel/ssc in…
mjprilliman Oct 30, 2020
c3f1e7d
Added shared inverter function for pulling max DC power, used in
mjprilliman Oct 30, 2020
c58414d
Merge branch 'develop' into inv_temp_derate_pmax
mjprilliman Nov 2, 2020
29a2665
Updated test results, accounted for PVYield inverter model not using
mjprilliman Nov 2, 2020
0f66295
Merge branch 'develop' into inv_temp_derate_pmax
mjprilliman Nov 2, 2020
0593915
Fixed tab spacing
mjprilliman Nov 2, 2020
ff1efeb
Updated test results
mjprilliman Nov 3, 2020
5839e91
Merge branch 'develop' into inv_temp_derate_pmax
mjprilliman Nov 3, 2020
cc7c8d5
Restored pvyield input cases to fix failing test
mjprilliman Nov 3, 2020
766cbbc
Merge branch 'develop' into inv_temp_derate_pmax
mjprilliman Nov 6, 2020
dd693f9
Removed unnecessary comments
mjprilliman Nov 6, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 17 additions & 13 deletions shared/lib_pv_io_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,19 +287,19 @@ Subarray_IO::Subarray_IO(compute_module* cm, const std::string& cmName, size_t s
if (subarrayNumber > 1)
enable = cm->as_boolean(prefix + "enable");

if (enable)
{
if (enable)
{
int n = cm->as_integer(prefix + "nstrings");
if (n < 0) {
throw exec_error(cmName, "invalid string allocation between subarrays. all subarrays must have zero or positive number of strings.");
}

nStrings = n;
if (nStrings == 0) //subarrays with no strings need to be treated as if they are disabled to avoid divide by zero issues in the subarray setup
{
enable = false;
return;
}
if (nStrings == 0) //subarrays with no strings need to be treated as if they are disabled to avoid divide by zero issues in the subarray setup
{
enable = false;
return;
}

nModulesPerString = cm->as_integer(prefix + "modules_per_string");
mpptInput = cm->as_integer(prefix + "mppt_input");
Expand Down Expand Up @@ -416,10 +416,10 @@ Subarray_IO::Subarray_IO(compute_module* cm, const std::string& cmName, size_t s
}
}

// Initialize module model
std::unique_ptr<Module_IO> tmp(new Module_IO(cm, cmName, 1 - dcLossTotalPercent));
Module = std::move(tmp);
}
// Initialize module model
std::unique_ptr<Module_IO> tmp(new Module_IO(cm, cmName, 1 - dcLossTotalPercent));
Module = std::move(tmp);
}
}
void Subarray_IO::AssignOutputs(compute_module* cm)
{
Expand Down Expand Up @@ -1477,6 +1477,10 @@ void Inverter_IO::setupSharedInverter(compute_module* cm, SharedInverter* a_shar
{
inv_tdc = cm->as_matrix("inv_tdc_cec_cg");
}
else
{
return;
}

// Parse into std::vector form
std::vector<std::vector<double>> thermalDerateCurves;
Expand All @@ -1488,7 +1492,7 @@ void Inverter_IO::setupSharedInverter(compute_module* cm, SharedInverter* a_shar
thermalDerateCurves.push_back(row);
}
int err = sharedInverter->setTempDerateCurves(thermalDerateCurves);
if (err > 1) {
throw exec_error("pvsamv1", "Inverter temperature derate curve " + util::to_string((int)(-err - 1)) + " is invalid.");
if (err > 0) {
throw exec_error("pvsamv1", "Inverter temperature derate curve row " + util::to_string((int)(err - 1)) + " is invalid.");
mjprilliman marked this conversation as resolved.
Show resolved Hide resolved
}
}
Loading