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

StandbyAutomaton extension of static var compensator #2335

Merged
merged 7 commits into from
Oct 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
/**
* Copyright (c) 2022, 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.iidm.network.extensions;

import com.powsybl.commons.extensions.Extension;
import com.powsybl.iidm.network.StaticVarCompensator;

/**
* @author Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com>
*/
public interface StandbyAutomaton extends Extension<StaticVarCompensator> {

String NAME = "standbyAutomaton";

@Override
default String getName() {
return NAME;
}

/**
* Get the status of the automaton. Use true if in service, false otherwise.
*/
boolean isStandby();

StandbyAutomaton setStandby(boolean standby);

/**
* Get the fix part of the susceptance (in S) used when the static var compensator is in stand by. Should be between the mininal
* and the maximal susceptance of the static var compensator.
*/
double getB0();

/**
* Set the fix part of the susceptance (in S) used when the static var compensator is in stand by. Should be between the mininal
* and the maximal susceptance of the static var compensator.
*/
StandbyAutomaton setB0(double b0);

/**
* Get the voltage setpoint (in kV) used when the high voltage threshold is reached.
*/
double getHighVoltageSetpoint();

/**
* @deprecated Use {@link #getHighVoltageSetpoint()} instead.
*/
@Deprecated(since = "4.11.0")
default float getHighVoltageSetPoint() {
return (float) getHighVoltageSetpoint();
}

/**
* Set the voltage setpoint (in kV) used when the high voltage threshold is reached.
*/
StandbyAutomaton setHighVoltageSetpoint(double highVoltageSetpoint);

/**
* @deprecated Use {@link #setHighVoltageSetpoint(double)} instead.
*/
@Deprecated(since = "4.11.0")
default StandbyAutomaton setHighVoltageSetPoint(float highVoltageSetpoint) {
return setHighVoltageSetpoint(highVoltageSetpoint);
}

/**
* Get the high voltage threshold (in kV). Above this value, the static var compensator controls voltage at high voltage setpoint.
*/
double getHighVoltageThreshold();

/**
* Set the high voltage threshold (in kV). Above this value, the static var compensator controls voltage at high voltage setpoint.
*/
StandbyAutomaton setHighVoltageThreshold(double highVoltageThreshold);

/**
* Get the voltage setpoint (in kV) used when the low voltage threshold is reached.
*/
double getLowVoltageSetpoint();

/**
* @deprecated Use {@link #getLowVoltageSetpoint()} instead.
*/
@Deprecated(since = "4.11.0")
default float getLowVoltageSetPoint() {
return (float) getLowVoltageSetpoint();
}

/**
* Set the voltage setpoint (in kV) used when the low voltage threshold is reached.
*/
StandbyAutomaton setLowVoltageSetpoint(double lowVoltageSetpoint);

/**
* @deprecated Use {@link #setLowVoltageSetpoint(double)} instead.
*/
@Deprecated(since = "4.11.0")
default StandbyAutomaton setLowVoltageSetPoint(float lowVoltageSetpoint) {
return setLowVoltageSetpoint(lowVoltageSetpoint);
}

/**
* Get the low voltage threshold (in kV). Under this value, the static var compensator controls voltage at low voltage setpoint.
*/
double getLowVoltageThreshold();

/**
* Set the low voltage threshold (in kV). Under this value, the static var compensator controls voltage at low voltage setpoint.
*/
StandbyAutomaton setLowVoltageThreshold(double lowVoltageThreshold);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/**
* Copyright (c) 2022, 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.iidm.network.extensions;

import com.powsybl.commons.extensions.ExtensionAdder;
import com.powsybl.iidm.network.StaticVarCompensator;

/**
* @author Jérémy Labous <jlabous at silicom.fr>
*/
public interface StandbyAutomatonAdder extends ExtensionAdder<StaticVarCompensator, StandbyAutomaton> {

@Override
default Class<StandbyAutomaton> getExtensionClass() {
return StandbyAutomaton.class;
}

/**
* Define the status of the automaton. Use true if in service, false otherwise.
*/
StandbyAutomatonAdder withStandbyStatus(boolean standby);

/**
* Define the fix part of the susceptance (in S) used when the static var compensator is in stand by. Should be between the mininal
* and the maximal susceptance of the static var compensator.
*/
StandbyAutomatonAdder withB0(double b0);

/**
* Define the voltage setpoint (in kV) used when the high voltage threshold is reached.
*/
StandbyAutomatonAdder withHighVoltageSetpoint(double highVoltageSetpoint);

/**
* @deprecated Use {@link #withHighVoltageSetpoint(double)} instead.
*/
@Deprecated(since = "4.11.0")
default StandbyAutomatonAdder withHighVoltageSetPoint(float highVoltageSetpoint) {
return withHighVoltageSetpoint(highVoltageSetpoint);
}

/**
* Define the high voltage threshold (in kV). Above this value, the static var compensator controls voltage at high voltage setpoint.
*/
StandbyAutomatonAdder withHighVoltageThreshold(double highVoltageThreshold);

/**
* Define the voltage setpoint (in kV) used when the low voltage threshold is reached.
*/
StandbyAutomatonAdder withLowVoltageSetpoint(double lowVoltageSetpoint);

/**
* @deprecated Use {@link #withLowVoltageSetpoint(double)} instead.
*/
@Deprecated(since = "4.11.0")
default StandbyAutomatonAdder withLowVoltageSetPoint(float lowVoltageSetpoint) {
return withHighVoltageSetpoint(lowVoltageSetpoint);
}

/**
* Define the low voltage threshold (in kV). Under this value, the static var compensator controls voltage at low voltage setpoint.
*/
StandbyAutomatonAdder withLowVoltageThreshold(double lowVoltageThreshold);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/**
* Copyright (c) 2022, 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.iidm.network.impl.extensions;

import com.powsybl.commons.extensions.AbstractExtensionAdder;
import com.powsybl.iidm.network.StaticVarCompensator;
import com.powsybl.iidm.network.extensions.StandbyAutomaton;
import com.powsybl.iidm.network.extensions.StandbyAutomatonAdder;

/**
* @author Jérémy Labous <jlabous at silicom.fr>
*/
public class StandbyAutomatonAdderImpl extends AbstractExtensionAdder<StaticVarCompensator, StandbyAutomaton>
implements StandbyAutomatonAdder {

private double b0;

private boolean standby;

private double lowVoltageSetpoint;

private double highVoltageSetpoint;

private double lowVoltageThreshold;

private double highVoltageThreshold;

public StandbyAutomatonAdderImpl(StaticVarCompensator svc) {
super(svc);
}

@Override
protected StandbyAutomaton createExtension(StaticVarCompensator staticVarCompensator) {
return new StandbyAutomatonImpl(staticVarCompensator, b0, standby,
lowVoltageSetpoint, highVoltageSetpoint, lowVoltageThreshold, highVoltageThreshold);
}

@Override
public StandbyAutomatonAdderImpl withStandbyStatus(boolean standby) {
this.standby = standby;
return this;
}

@Override
public StandbyAutomatonAdderImpl withB0(double b0) {
this.b0 = b0;
return this;
}

@Override
public StandbyAutomatonAdderImpl withHighVoltageSetpoint(double highVoltageSetpoint) {
this.highVoltageSetpoint = highVoltageSetpoint;
return this;
}

@Override
public StandbyAutomatonAdderImpl withHighVoltageThreshold(double highVoltageThreshold) {
this.highVoltageThreshold = highVoltageThreshold;
return this;
}

@Override
public StandbyAutomatonAdderImpl withLowVoltageSetpoint(double lowVoltageSetpoint) {
this.lowVoltageSetpoint = lowVoltageSetpoint;
return this;
}

@Override
public StandbyAutomatonAdderImpl withLowVoltageThreshold(double lowVoltageThreshold) {
this.lowVoltageThreshold = lowVoltageThreshold;
return this;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* Copyright (c) 2022, 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.iidm.network.impl.extensions;

import com.google.auto.service.AutoService;
import com.powsybl.commons.extensions.ExtensionAdderProvider;
import com.powsybl.iidm.network.StaticVarCompensator;
import com.powsybl.iidm.network.extensions.StandbyAutomaton;

/**
* @author Jérémy Labous <jlabous at silicom.fr>
*/
@AutoService(ExtensionAdderProvider.class)
public class StandbyAutomatonAdderImplProvider
implements ExtensionAdderProvider<StaticVarCompensator, StandbyAutomaton, StandbyAutomatonAdderImpl> {

@Override
public String getImplementationName() {
return "Default";
}

@Override
public String getExtensionName() {
return StandbyAutomaton.NAME;
}

@Override
public Class<StandbyAutomatonAdderImpl> getAdderClass() {
return StandbyAutomatonAdderImpl.class;
}

@Override
public StandbyAutomatonAdderImpl newAdder(StaticVarCompensator extendable) {
return new StandbyAutomatonAdderImpl(extendable);
}
}
Loading