Skip to content
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- Added `enable` and `disable` solver events that put a branch in or out of service.
- `verify()` returns `Model::ConfigurationChecks` listing every configuration problem instead of an error count.
- Added `Model::ParameterReader`
- Removed legacy PhasorDynamics component constructors in favor of constructors taking model data.

## v0.2

Expand Down
11 changes: 1 addition & 10 deletions GridKit/Model/PhasorDynamics/Branch/Branch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,6 @@ namespace GridKit
using MonitorT = Model::VariableMonitor<Branch, BranchData>;

public:
Branch(BusT* bus1, BusT* bus2);
Branch(BusT* bus1,
BusT* bus2,
RealT R,
RealT X,
RealT G,
RealT B,
RealT tap = 1.0,
RealT phase = 0.0);
Branch(BusT* bus1, BusT* bus2, const ModelDataT& data);
virtual ~Branch();

Expand Down Expand Up @@ -192,7 +183,7 @@ namespace GridKit
BusT* bus1_;
BusT* bus2_;
RealT R_{0.0};
RealT X_{0.0};
RealT X_{0.01};
Comment thread
lukelowry marked this conversation as resolved.
Resolved
RealT G_{0.0};
RealT B_{0.0};
RealT Gmag_{0.0};
Expand Down
51 changes: 1 addition & 50 deletions GridKit/Model/PhasorDynamics/Branch/BranchImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,60 +26,11 @@ namespace GridKit
* Model size:
* - Number of equations = 0
* - Number of internal variables = 0
*/
template <typename scalar_type, typename index_type>
Branch<scalar_type, index_type>::Branch(BusT* bus1, BusT* bus2)
: bus1_(bus1),
bus2_(bus2),
R_(0.0),
X_(0.01),
G_(0.0),
B_(0.0),
tap_(1.0),
phase_(0.0),
bus1_id_(0),
bus2_id_(0)
{
size_ = 0;
setDerivedParams();
}

/**
* @brief Construct a new Branch
*
* @param bus1 - pointer to bus-1
* @param bus2 - pointer to bus-2
* @param R - line series resistance
* @param X - line series reactance
* @param G - total line shunt conductance
* @param B - total line shunt susceptance
* @param tap - off-nominal tap magnitude on bus1 side
* @param phase - phase shift angle in radians
* @param data - branch parameters and monitored-variable selections
*/
template <typename scalar_type, typename index_type>
Branch<scalar_type, index_type>::Branch(BusT* bus1,
BusT* bus2,
RealT R,
RealT X,
RealT G,
RealT B,
RealT tap,
RealT phase)
: bus1_(bus1),
bus2_(bus2),
R_(R),
X_(X),
G_(G),
B_(B),
tap_(tap),
phase_(phase),
bus1_id_(0),
bus2_id_(0)
{
size_ = 0;
setDerivedParams();
}

template <typename scalar_type, typename index_type>
Branch<scalar_type, index_type>::Branch(BusT* bus1, BusT* bus2, const ModelDataT& data)
: bus1_(bus1),
Expand Down
2 changes: 1 addition & 1 deletion GridKit/Model/PhasorDynamics/Branch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Figure 1: Branch model.
Symbol | Units | JSON | Description | Typical Value | Note
-----------------|--------|---------|-----------------------------------------|---------------|-----
$R$ | [p.u.] | `R` | Branch series resistance | |
$X$ | [p.u.] | `X` | Branch series reactance | |
$X$ | [p.u.] | `X` | Branch series reactance | 0.01 | Default when omitted
$G$ | [p.u.] | `G` | Total line shunt conductance | 0.0 |
$B$ | [p.u.] | `B` | Total line shunt susceptance | 0.0 |
$G_\mathrm{mag}$ | [p.u.] | `Gmag` | Magnetizing shunt conductance at bus 1 | 0.0 |
Expand Down
1 change: 0 additions & 1 deletion GridKit/Model/PhasorDynamics/Controller/REECB/Reecb.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ namespace GridKit
static constexpr RealT INITIALIZATION_TOLERANCE =
static_cast<RealT>(100.0) * std::numeric_limits<RealT>::epsilon();

Reecb(BusT* bus);
Reecb(BusT* bus, const ModelDataT& data);
~Reecb();

Expand Down
13 changes: 0 additions & 13 deletions GridKit/Model/PhasorDynamics/Controller/REECB/ReecbImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,6 @@ namespace GridKit
RealT vref{};
};

/**
* @brief Construct an unconfigured REECB controller
*
* @param[in] bus Terminal bus measured by the controller.
*/
template <typename scalar_type, typename index_type>
Reecb<scalar_type, index_type>::Reecb(BusT* bus)
: bus_(bus)
{
size_ = static_cast<IdxT>(Utilities::enum_size<ReecbInternalVariables>());
setDerivedParameters();
}

/**
* @brief Construct REECB from model data
*
Expand Down
1 change: 0 additions & 1 deletion GridKit/Model/PhasorDynamics/Controller/REPCA/Repca.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ namespace GridKit
public:
static constexpr RealT INITIALIZATION_TOLERANCE = static_cast<RealT>(1.0e-12);

Repca(BusT* bus);
Repca(BusT* bus, const ModelDataT& data);
~Repca();

Expand Down
17 changes: 0 additions & 17 deletions GridKit/Model/PhasorDynamics/Controller/REPCA/RepcaImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,6 @@ namespace GridKit
/// Logger used for REPCA diagnostics.
using Log = ::GridKit::Utilities::Logger;

/**
* @brief Construct REPCA with its documented parameter defaults
*
* The regulated bus is retained, the model is sized, and every
* parameter keeps its documented default. No monitor or signal
* connection is created.
*
* @param[in] bus Regulated bus measured by the controller.
*/
template <typename scalar_type, typename index_type>
Repca<scalar_type, index_type>::Repca(BusT* bus)
: bus_(bus)
{
size_ = static_cast<IdxT>(Utilities::enum_size<RepcaInternalVariables>());
setDerivedParameters();
}

/**
* @brief Construct REPCA from model data
*
Expand Down
1 change: 0 additions & 1 deletion GridKit/Model/PhasorDynamics/Converter/REGCA/Regca.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ namespace GridKit
using ExternalVariablesT = RegcaExternalVariables;

public:
Regca(BusT* bus);
Regca(BusT* bus, const ModelDataT& data);
~Regca();

Expand Down
12 changes: 0 additions & 12 deletions GridKit/Model/PhasorDynamics/Converter/REGCA/RegcaImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,6 @@ namespace GridKit
{
using Log = ::GridKit::Utilities::Logger;

/**
* @brief Construct a sized but unconfigured REGCA converter.
*
* @param[in] bus Terminal bus the converter injects into.
*/
template <typename scalar_type, typename index_type>
Regca<scalar_type, index_type>::Regca(BusT* bus)
: bus_(bus)
{
size_ = static_cast<IdxT>(Utilities::enum_size<RegcaInternalVariables>());
}

/**
* @brief Construct a REGCA converter from model data.
*
Expand Down
1 change: 0 additions & 1 deletion GridKit/Model/PhasorDynamics/Exciter/ESDC1A/Esdc1a.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ namespace GridKit
using ExternalVariablesT = Esdc1aExternalVariables;

public:
Esdc1a(BusT* bus);
Esdc1a(BusT* bus, const ModelDataT& data);
~Esdc1a();

Expand Down
17 changes: 0 additions & 17 deletions GridKit/Model/PhasorDynamics/Exciter/ESDC1A/Esdc1aImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,6 @@ namespace GridKit
/// Logger used for ESDC1A diagnostics.
using Log = ::GridKit::Utilities::Logger;

/**
* @brief Construct an ESDC1A exciter without parameters
*
* The model is sized but left unconfigured. Every parameter keeps its
* documented default, and no monitor is created. verify() rejects the
* model until an `efd` output node is assigned.
*
* @param[in] bus Terminal bus the exciter measures.
*/
template <typename scalar_type, typename index_type>
Esdc1a<scalar_type, index_type>::Esdc1a(BusT* bus)
: bus_(bus)
{
size_ = static_cast<IdxT>(Utilities::enum_size<Esdc1aInternalVariables>());
setDerivedParameters();
}

/**
* @brief Construct an ESDC1A exciter from model data
*
Expand Down
1 change: 0 additions & 1 deletion GridKit/Model/PhasorDynamics/Exciter/IEEET1/Ieeet1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ namespace GridKit
using MonitorT = Model::VariableMonitor<Ieeet1, Ieeet1Data>;

public:
Ieeet1(BusT* bus);
Ieeet1(BusT* bus, const ModelDataT& data);
~Ieeet1();

Expand Down
9 changes: 0 additions & 9 deletions GridKit/Model/PhasorDynamics/Exciter/IEEET1/Ieeet1Impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,6 @@ namespace GridKit
{
using Log = ::GridKit::Utilities::Logger;

/**
* @brief Constructor for IEEET1 Exciter
*/
template <typename scalar_type, typename index_type>
Ieeet1<scalar_type, index_type>::Ieeet1(BusT* bus)
: Ieeet1(bus, ModelDataT{})
{
}

/**
* @brief Constructor for IEEET1 Exciter
*
Expand Down
1 change: 0 additions & 1 deletion GridKit/Model/PhasorDynamics/Exciter/SEXS-PTI/SexsPti.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ namespace GridKit
using MonitorT = Model::VariableMonitor<SexsPti, SexsPtiData>;

public:
SexsPti(BusT* bus);
SexsPti(BusT* bus, const ModelDataT& data);
~SexsPti();

Expand Down
7 changes: 0 additions & 7 deletions GridKit/Model/PhasorDynamics/Exciter/SEXS-PTI/SexsPtiImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ namespace GridKit
{
using Log = ::GridKit::Utilities::Logger;

template <typename scalar_type, typename index_type>
SexsPti<scalar_type, index_type>::SexsPti(BusT* bus)
: bus_(bus)
{
size_ = 3;
}

template <typename scalar_type, typename index_type>
SexsPti<scalar_type, index_type>::SexsPti(BusT* bus, const ModelDataT& data)
: bus_(bus),
Expand Down
3 changes: 1 addition & 2 deletions GridKit/Model/PhasorDynamics/Governor/GASTPTI/GastPti.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ namespace GridKit
using SignalNodeSetT = SignalNodeSet<ScalarT, IdxT>;

public:
GastPti();
explicit GastPti(const ModelDataT& data);
GastPti(const ModelDataT& data);
~GastPti();

int setGridKitComponentID(IdxT component_id) override final;
Expand Down
10 changes: 0 additions & 10 deletions GridKit/Model/PhasorDynamics/Governor/GASTPTI/GastPtiImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,6 @@ namespace GridKit
/// Logger used for GASTPTI diagnostics.
using Log = ::GridKit::Utilities::Logger;

/**
* @brief Construct an unconfigured GASTPTI governor
*/
template <typename scalar_type, typename index_type>
GastPti<scalar_type, index_type>::GastPti()
{
size_ = static_cast<IdxT>(Utilities::enum_size<GastPtiInternalVariables>());
setDerivedParameters();
}

/**
* @brief Construct a GASTPTI governor from model data
*
Expand Down
3 changes: 1 addition & 2 deletions GridKit/Model/PhasorDynamics/Governor/HYGOV/Hygov.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ namespace GridKit
using ExternalVariablesT = HygovExternalVariables;

public:
Hygov();
explicit Hygov(const ModelDataT& data);
Hygov(const ModelDataT& data);
~Hygov();

int setGridKitComponentID(IdxT component_id) override final;
Expand Down
9 changes: 0 additions & 9 deletions GridKit/Model/PhasorDynamics/Governor/HYGOV/HygovImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,6 @@ namespace GridKit
{
using Log = ::GridKit::Utilities::Logger;

/**
* @brief Construct an unconfigured HYGOV governor
*/
template <typename scalar_type, typename index_type>
Hygov<scalar_type, index_type>::Hygov()
{
size_ = static_cast<IdxT>(Utilities::enum_size<HygovInternalVariables>());
}

/**
* @brief Construct a HYGOV governor from model data
*
Expand Down
4 changes: 1 addition & 3 deletions GridKit/Model/PhasorDynamics/Governor/Tgov1/Tgov1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ namespace GridKit
using SignalPortsT = SignalPorts<ScalarT, ModelDataT>;

public:
Tgov1();
Tgov1(SignalNodeT*, SignalNodeT*);
Tgov1(const ModelDataT&);
Tgov1(const ModelDataT& data);
~Tgov1() = default;

int setGridKitComponentID(IdxT) override final;
Expand Down
37 changes: 0 additions & 37 deletions GridKit/Model/PhasorDynamics/Governor/Tgov1/Tgov1Impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,43 +25,6 @@ namespace GridKit
{
using Log = ::GridKit::Utilities::Logger;

/**
* @brief Constructs a Tgov1 governor model without setting its parameters
*
*/
template <typename scalar_type, typename index_type>
Tgov1<scalar_type, index_type>::Tgov1()
: Trate_(100.0)
{
size_ = 3;
setDerivedParams();
}

/**
* @brief Constructs a Tgov1 governor model from its parameters
*
* @param pmech $P_m$ internal variable signal node
* @param omega $\omega$ external variable signal node
*/
template <typename scalar_type, typename index_type>
Tgov1<scalar_type, index_type>::Tgov1(SignalNodeT* pmech, SignalNodeT* omega)
: Trate_(100.0),
R_(0.05),
Pvmin_(0),
Pvmax_(1),
T1_(HALF<RealT>),
T2_(2.5),
T3_(7.5),
Dt_(0)
{
ports_.out.template port<Tgov1SignalOutputs::pmech>().connect(pmech);
ports_.in.template port<Tgov1SignalInputs::speed>().connect(omega);

// 3 internal variables
size_ = 3;
setDerivedParams();
}

/**
* @brief Constructs a Tgov1 governor model from its parameters
*
Expand Down
2 changes: 0 additions & 2 deletions GridKit/Model/PhasorDynamics/Load/LoadZ/LoadZ.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ namespace GridKit
using MonitorT = Model::VariableMonitor<LoadZ, LoadZData>;

public:
LoadZ(BusT* bus);
LoadZ(BusT* bus, RealT R, RealT X);
LoadZ(BusT* bus, const ModelDataT& data);
virtual ~LoadZ();

Expand Down
Loading
Loading