-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add current violation to busbar section
Signed-off-by: jamal-khey <[email protected]>
- Loading branch information
1 parent
621570f
commit 9768bfd
Showing
13 changed files
with
660 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...agram/single-line-diagram-core/src/main/java/com/powsybl/sld/util/LimitViolationUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** | ||
* Copyright (c) 2019, RTE (http://www.rte-france.com) | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
package com.powsybl.sld.util; | ||
|
||
import com.powsybl.iidm.network.BusbarSection; | ||
|
||
/** | ||
* @author jamal kheyyad {@literal <jamal.kheyyad at rte-international.com>} | ||
*/ | ||
public final class LimitViolationUtil { | ||
private LimitViolationUtil() { | ||
} | ||
|
||
// this code is an adaptation of the code from the OpenLoadFlow project | ||
// see the original code at | ||
// LimitViolationManager.java | ||
public static boolean detectBusViolations(BusbarSection bus) { | ||
double nominalV = bus.getTerminal().getVoltageLevel().getNominalV(); | ||
double busV = bus.getV(); | ||
double highVoltageLimit = bus.getTerminal().getVoltageLevel().getHighVoltageLimit() / nominalV; | ||
double lowVoltageLimit = bus.getTerminal().getVoltageLevel().getLowVoltageLimit() / nominalV; | ||
if (!Double.isNaN(highVoltageLimit) && busV > highVoltageLimit) { | ||
return true; | ||
} | ||
if (!Double.isNaN(lowVoltageLimit) && busV < lowVoltageLimit) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.