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

Commit

Permalink
Merge pull request #1184 from slacgismo/develop-fix-node-violation-de…
Browse files Browse the repository at this point in the history
…fault

Update node.cpp
  • Loading branch information
johnsonhsiung committed Jun 14, 2022
2 parents cc3579d + d9a808d commit b4b91e0
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions module/powerflow/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,39 +511,6 @@ int node::create(void)
//Multi-island tracking
reset_island_state = false; //Reset is disabled, by default

if ( voltage_violation_threshold == 0.0 ) // 0.0 --> use global default threshold
{
voltage_violation_threshold = default_voltage_violation_threshold;
}
else if ( voltage_violation_threshold < 0.0 ) // <0.0 --> disable threshold
{
voltage_violation_threshold = 0.0;
}
if ( undervoltage_violation_threshold == 0.0 ) // 0.0 --> use global default threshold
{
undervoltage_violation_threshold = default_undervoltage_violation_threshold;
}
else if ( undervoltage_violation_threshold < 0.0 ) // <0.0 --> disable threshold
{
undervoltage_violation_threshold = 0.0;
}
if ( overvoltage_violation_threshold == 0.0 ) // 0.0 --> use global default threshold
{
overvoltage_violation_threshold = default_overvoltage_violation_threshold;
}
else if ( overvoltage_violation_threshold < 0.0 ) // <0.0 --> disable threshold
{
overvoltage_violation_threshold = 0.0;
}
if ( voltage_fluctuation_threshold == 0.0 ) // 0.0 --> use global default threshold
{
voltage_fluctuation_threshold = default_voltage_fluctuation_threshold;
}
else if ( voltage_fluctuation_threshold < 0.0 ) // <0.0 --> disable threshold
{
voltage_fluctuation_threshold = 0.0;
}

return result;
}

Expand Down Expand Up @@ -1464,6 +1431,39 @@ int node::init(OBJECT *parent)
freq_omega_ref = 2.0 * PI * nominal_frequency;
}

if ( voltage_violation_threshold == 0.0 ) // 0.0 --> use global default threshold
{
voltage_violation_threshold = default_voltage_violation_threshold;
}
else if ( voltage_violation_threshold < 0.0 ) // <0.0 --> disable threshold
{
voltage_violation_threshold = 0.0;
}
if ( undervoltage_violation_threshold == 0.0 ) // 0.0 --> use global default threshold
{
undervoltage_violation_threshold = default_undervoltage_violation_threshold;
}
else if ( undervoltage_violation_threshold < 0.0 ) // <0.0 --> disable threshold
{
undervoltage_violation_threshold = 0.0;
}
if ( overvoltage_violation_threshold == 0.0 ) // 0.0 --> use global default threshold
{
overvoltage_violation_threshold = default_overvoltage_violation_threshold;
}
else if ( overvoltage_violation_threshold < 0.0 ) // <0.0 --> disable threshold
{
overvoltage_violation_threshold = 0.0;
}
if ( voltage_fluctuation_threshold == 0.0 ) // 0.0 --> use global default threshold
{
voltage_fluctuation_threshold = default_voltage_fluctuation_threshold;
}
else if ( voltage_fluctuation_threshold < 0.0 ) // <0.0 --> disable threshold
{
voltage_fluctuation_threshold = 0.0;
}

return result;
}

Expand Down

0 comments on commit b4b91e0

Please sign in to comment.