Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Commit

Permalink
Fix to the powerflow/init.cpp to support units (#1012)
Browse files Browse the repository at this point in the history
* Fix to the init.cpp to support units
* Updating the unit definitions for powerflow globals
  • Loading branch information
aivanova5 committed Sep 27, 2021
1 parent c875344 commit b2aefc1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
26 changes: 13 additions & 13 deletions module/powerflow/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ EXPORT CLASS *init(CALLBACKS *fntable, MODULE *module, int argc, char *argv[])

/* exported globals */
gl_global_create("powerflow::show_matrix_values",PT_bool,&show_matrix_values,NULL);
gl_global_create("powerflow::primary_voltage_ratio",PT_double,&primary_voltage_ratio,NULL);
gl_global_create("powerflow::nominal_frequency",PT_double,&nominal_frequency,NULL);
gl_global_create("powerflow::primary_voltage_ratio[pu]",PT_double,&primary_voltage_ratio,NULL);
gl_global_create("powerflow::nominal_frequency[Hz]",PT_double,&nominal_frequency,NULL);
gl_global_create("powerflow::require_voltage_control", PT_bool,&require_voltage_control,NULL);
gl_global_create("powerflow::geographic_degree",PT_double,&geographic_degree,NULL);
gl_global_create("powerflow::fault_impedance",PT_complex,&fault_Z,NULL);
gl_global_create("powerflow::ground_impedance",PT_complex,&ground_Z,NULL);
gl_global_create("powerflow::warning_underfrequency",PT_double,&warning_underfrequency,NULL);
gl_global_create("powerflow::warning_overfrequency",PT_double,&warning_overfrequency,NULL);
gl_global_create("powerflow::warning_undervoltage",PT_double,&warning_undervoltage,NULL);
gl_global_create("powerflow::warning_overvoltage",PT_double,&warning_overvoltage,NULL);
gl_global_create("powerflow::fault_impedance[Ohm]",PT_complex,&fault_Z,NULL);
gl_global_create("powerflow::ground_impedance[Ohm]",PT_complex,&ground_Z,NULL);
gl_global_create("powerflow::warning_underfrequency[Hz]",PT_double,&warning_underfrequency,NULL);
gl_global_create("powerflow::warning_overfrequency[Hz]",PT_double,&warning_overfrequency,NULL);
gl_global_create("powerflow::warning_undervoltage[V]",PT_double,&warning_undervoltage,NULL);
gl_global_create("powerflow::warning_overvoltage[V]",PT_double,&warning_overvoltage,NULL);
gl_global_create("powerflow::warning_voltageangle",PT_double,&warning_voltageangle,NULL);
gl_global_create("powerflow::maximum_voltage_error",PT_double,&default_maximum_voltage_error,NULL);
gl_global_create("powerflow::maximum_voltage_error[V]",PT_double,&default_maximum_voltage_error,NULL);
gl_global_create("powerflow::solver_method",PT_enumeration,&solver_method,
PT_KEYWORD,"FBS",SM_FBS,
PT_KEYWORD,"GS",SM_GS,
Expand All @@ -46,18 +46,18 @@ EXPORT CLASS *init(CALLBACKS *fntable, MODULE *module, int argc, char *argv[])
gl_global_create("powerflow::NR_iteration_limit",PT_int64,&NR_iteration_limit,NULL);
gl_global_create("powerflow::NR_deltamode_iteration_limit",PT_int64,&NR_delta_iteration_limit,NULL);
gl_global_create("powerflow::NR_superLU_procs",PT_int32,&NR_superLU_procs,NULL);
gl_global_create("powerflow::default_maximum_voltage_error",PT_double,&default_maximum_voltage_error,NULL);
gl_global_create("powerflow::default_maximum_power_error",PT_double,&default_maximum_power_error,NULL);
gl_global_create("powerflow::default_maximum_voltage_error[pu]",PT_double,&default_maximum_voltage_error,NULL);
gl_global_create("powerflow::default_maximum_power_error[pu]",PT_double,&default_maximum_power_error,NULL);
gl_global_create("powerflow::NR_admit_change",PT_bool,&NR_admit_change,NULL);
gl_global_create("powerflow::enable_subsecond_models", PT_bool, &enable_subsecond_models,PT_DESCRIPTION,"Enable deltamode capabilities within the powerflow module",NULL);
gl_global_create("powerflow::all_powerflow_delta", PT_bool, &all_powerflow_delta,PT_DESCRIPTION,"Forces all powerflow objects that are capable to participate in deltamode",NULL);
gl_global_create("powerflow::deltamode_timestep", PT_double, &deltamode_timestep_publish,PT_UNITS,"ns",PT_DESCRIPTION,"Desired minimum timestep for deltamode-related simulations",NULL);
gl_global_create("powerflow::current_frequency",PT_double,&current_frequency,PT_UNITS,"Hz",PT_DESCRIPTION,"Current system-level frequency of the powerflow system",NULL);
gl_global_create("powerflow::master_frequency_update",PT_bool,&master_frequency_update,PT_DESCRIPTION,"Tracking variable to see if an object has become the system frequency updater",NULL);
gl_global_create("powerflow::enable_frequency_dependence",PT_bool,&enable_frequency_dependence,PT_DESCRIPTION,"Flag to enable frequency-based variations in impedance values of lines and loads",NULL);
gl_global_create("powerflow::default_resistance",PT_double,&default_resistance,NULL);
gl_global_create("powerflow::default_resistance[Ohm]",PT_double,&default_resistance,NULL);
gl_global_create("powerflow::enable_inrush",PT_bool,&enable_inrush_calculations,PT_DESCRIPTION,"Flag to enable in-rush calculations for lines and transformers in deltamode",NULL);
gl_global_create("powerflow::low_voltage_impedance_level",PT_double,&impedance_conversion_low_pu,PT_DESCRIPTION,"Lower limit of voltage (in per-unit) at which all load types are converted to impedance for in-rush calculations",NULL);
gl_global_create("powerflow::low_voltage_impedance_level[pu]",PT_double,&impedance_conversion_low_pu,PT_DESCRIPTION,"Lower limit of voltage (in per-unit) at which all load types are converted to impedance for in-rush calculations",NULL);
gl_global_create("powerflow::enable_mesh_fault_current",PT_bool,&enable_mesh_fault_current,PT_DESCRIPTION,"Flag to enable mesh-based fault current calculations",NULL);
gl_global_create("powerflow::convergence_error_handling",PT_enumeration,&convergence_error_handling,PT_DESCRIPTION,"Flag to handle convergence error",
PT_KEYWORD,"FATAL",CEH_FATAL,
Expand Down
2 changes: 1 addition & 1 deletion module/powerflow/powerflow.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ EXTERN int64 NR_delta_iteration_limit INIT(10); /**< Newton-Raphson iteration l
EXTERN bool FBS_swing_set INIT(false); /**< Forward-Back Sweep swing assignment variable */
EXTERN bool show_matrix_values INIT(false); /**< flag to enable dumping matrix calculations as they occur */
EXTERN double primary_voltage_ratio INIT(60.0); /**< primary voltage ratio (@todo explain primary_voltage_ratio in powerflow (ticket #131) */
EXTERN double nominal_frequency INIT(60.0); /**< nomimal operating frequencty */
EXTERN double nominal_frequency INIT(60.0); /**< nomimal operating frequency */
EXTERN double warning_underfrequency INIT(55.0); /**< frequency below which a warning is posted */
EXTERN double warning_overfrequency INIT(65.0); /**< frequency above which a warning is posted */
EXTERN double warning_undervoltage INIT(0.8); /**< voltage magnitude (per unit) below which a warning is posted */
Expand Down

0 comments on commit b2aefc1

Please sign in to comment.