-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
310 additions
and
35 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
50 changes: 50 additions & 0 deletions
50
power_grid_model_c/power_grid_model/include/power_grid_model/component/asym_line.hpp
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,50 @@ | ||
#pragma once | ||
|
||
#include "branch.hpp" | ||
|
||
#include "../auxiliary/input.hpp" | ||
#include "../auxiliary/output.hpp" | ||
#include "../auxiliary/update.hpp" | ||
#include "../calculation_parameters.hpp" | ||
#include "../common/common.hpp" | ||
#include "../common/three_phase_tensor.hpp" | ||
|
||
namespace power_grid_model { | ||
|
||
class AsymLine : public Branch { | ||
public: | ||
using InputType = AsymLineInput; | ||
using UpdateType = BranchUpdate; | ||
static constexpr char const* name = "asym_line"; | ||
|
||
explicit AsymLine(AsymLineInput const& asym_line_input, double system_frequency, double u1, double u2) | ||
: Branch{asym_line_input}, i_n_{asym_line_input.i_n}, base_i_{base_power_3p / u1 / sqrt3} { | ||
if (cabs(u1 - u2) > numerical_tolerance) { | ||
throw ConflictVoltage{id(), from_node(), to_node(), u1, u2}; | ||
} | ||
double const base_y = base_i_ / (u1 / sqrt3); | ||
|
||
} | ||
|
||
// override getter | ||
double base_i_from() const override { return base_i_; } | ||
double base_i_to() const override { return base_i_; } | ||
double loading(double /* max_s */, double max_i) const override { return max_i / i_n_; }; | ||
double phase_shift() const override { return 0.0; } | ||
bool is_param_mutable() const override { return false; } | ||
|
||
private: | ||
double i_n_; | ||
double base_i_; | ||
DoubleComplex y1_series_; | ||
DoubleComplex y1_shunt_; | ||
DoubleComplex y0_series_; | ||
DoubleComplex y0_shunt_; | ||
|
||
BranchCalcParam<symmetric_t> sym_calc_param() const override { | ||
return calc_param_y_sym(y1_series_, y1_shunt_, 1.0); | ||
} | ||
BranchCalcParam<asymmetric_t> asym_calc_param() const override { | ||
return calc_param_y_asym(y1_series_, y1_shunt_, y0_series_, y0_shunt_, 1.0); | ||
} | ||
} |
Oops, something went wrong.