-
Notifications
You must be signed in to change notification settings - Fork 394
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
PVWatts Speed Up #8960
PVWatts Speed Up #8960
Changes from 4 commits
466dc5a
92ccf20
12b8a4d
d7fb6a5
b14b368
b264d6d
4a0e26d
3c91451
9f2165a
58bc0d9
51699fe
d7e5dbd
6a357a2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -644,18 +644,24 @@ static var_info _cm_vtab_pvwattsv5_1ts_outputs[] = { | |
|
||
class cm_pvwattsv5_1ts : public cm_pvwattsv5_base | ||
{ | ||
private: | ||
bool system_inputs_are_setup; | ||
public: | ||
|
||
cm_pvwattsv5_1ts() | ||
{ | ||
add_var_info(_cm_vtab_pvwattsv5_1ts_weather); | ||
add_var_info(_cm_vtab_pvwattsv5_common); | ||
add_var_info(_cm_vtab_pvwattsv5_1ts_outputs); | ||
system_inputs_are_setup = false; | ||
} | ||
|
||
void exec() | ||
{ | ||
setup_system_inputs(); | ||
if (!system_inputs_are_setup) { | ||
setup_system_inputs(); | ||
system_inputs_are_setup = true; | ||
} | ||
double ts = as_number("time_step"); | ||
Comment on lines
+647
to
665
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is probably the biggest win. Using the 1-timestep model from SSC caused the panels to be initialized every timestep. This isn't a design flaw on their end because they take the unchanging properties of the PV system as inputs each timestep, so it could need to be reinitialized, but we know we're not changing those, so I hacked it to only initialize the first time. |
||
if (is_assigned("tcell") && is_assigned("poa")) | ||
initialize_cell_temp(ts, as_double("tcell"), as_double("poa")); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,9 +64,9 @@ bool compute_module::compute(handler_interface *handler, var_table *data) { | |
try { // catch any 'general_error' that can be thrown during precheck, exec, and postcheck | ||
|
||
if (!evaluate()) return false; // This can be enabled when we want automatic updating of interdependent-inputs | ||
if (!verify("precheck input", SSC_INPUT)) return false; | ||
// if (!verify("precheck input", SSC_INPUT)) return false; | ||
exec(); | ||
if (!verify("postcheck output", SSC_OUTPUT)) return false; | ||
// if (!verify("postcheck output", SSC_OUTPUT)) return false; | ||
Comment on lines
-67
to
+69
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The "compute module" (cmod) in SSC verifies all inputs at each timestep are within valid ranges or enums. We're doing that validation with the idd, so no need to redo that here. |
||
|
||
} catch (general_error &e) { | ||
log(e.err_text, SSC_ERROR, e.time); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This lookup of the PVWatts object in the list was adding some time mostly because we called the input processor every time around to get the
ObjNum
from the object name. Changed thestd::map
that holds those to have the names as keys instead ofObjNum
and it shaved some time off.