Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ACS
Public
Power System Simulation and Optimization
DPsim
DPsim
Commits
60ba1062
Commit
60ba1062
authored
Oct 19, 2020
by
Markus Mirz
Browse files
refactor initializeFromPowerflow
parent
d91bfa78
Changes
132
Hide whitespace changes
Inline
Side-by-side
Source/DAESolver.cpp
View file @
60ba1062
...
...
@@ -100,7 +100,7 @@ void DAESolver::initialize(Real t0) {
for
(
IdentifiedObject
::
Ptr
comp
:
mComponents
)
{
auto
emtComp
=
std
::
dynamic_pointer_cast
<
SimPowerComp
<
Complex
>
>
(
comp
);
if
(
emtComp
)
{
emtComp
->
initializeFrom
Powerflow
(
mSystem
.
mSystemFrequency
);
// Set initial values of all components
emtComp
->
initializeFrom
NodesAndTerminals
(
mSystem
.
mSystemFrequency
);
// Set initial values of all components
}
auto
daeComp
=
std
::
dynamic_pointer_cast
<
DAEInterface
>
(
comp
);
...
...
Source/DiakopticsSolver.cpp
View file @
60ba1062
...
...
@@ -97,7 +97,7 @@ void DiakopticsSolver<VarType>::initSubnets(const std::vector<SystemTopology>& s
}
}
tComp
->
mnaTearSetIdx
(
idx
);
comp
->
initializeFrom
Powerflow
(
mSystemFrequency
);
comp
->
initializeFrom
NodesAndTerminals
(
mSystemFrequency
);
tComp
->
mnaTearInitialize
(
2
*
PI
*
mSystemFrequency
,
mTimeStep
);
for
(
auto
gndComp
:
tComp
->
mnaTearGroundComponents
())
{
...
...
@@ -248,7 +248,7 @@ void DiakopticsSolver<VarType>::initComponents() {
for
(
auto
comp
:
mSubnets
[
net
].
components
)
{
auto
pComp
=
std
::
dynamic_pointer_cast
<
SimPowerComp
<
VarType
>>
(
comp
);
if
(
!
pComp
)
continue
;
pComp
->
initializeFrom
Powerflow
(
mSystem
.
mSystemFrequency
);
pComp
->
initializeFrom
NodesAndTerminals
(
mSystem
.
mSystemFrequency
);
}
// Initialize MNA specific parts of components.
...
...
Source/MNASolver.cpp
View file @
60ba1062
...
...
@@ -101,7 +101,7 @@ void MnaSolver<Real>::initializeComponents() {
auto
pComp
=
std
::
dynamic_pointer_cast
<
SimPowerComp
<
Real
>>
(
comp
);
if
(
!
pComp
)
continue
;
pComp
->
checkForUnconnectedTerminals
();
pComp
->
initializeFrom
Powerflow
(
mSystem
.
mSystemFrequency
);
pComp
->
initializeFrom
NodesAndTerminals
(
mSystem
.
mSystemFrequency
);
}
// Initialize signal components.
...
...
@@ -129,7 +129,7 @@ void MnaSolver<Complex>::initializeComponents() {
auto
pComp
=
std
::
dynamic_pointer_cast
<
SimPowerComp
<
Complex
>>
(
comp
);
if
(
!
pComp
)
continue
;
pComp
->
checkForUnconnectedTerminals
();
pComp
->
initializeFrom
Powerflow
(
mSystem
.
mSystemFrequency
);
pComp
->
initializeFrom
NodesAndTerminals
(
mSystem
.
mSystemFrequency
);
}
// Initialize signal components.
...
...
Source/PFSolver.cpp
View file @
60ba1062
...
...
@@ -64,7 +64,7 @@ void PFSolver::assignMatrixNodeIndices() {
mSystem
.
mNodes
[
idx
]
->
setMatrixNodeIndex
(
0
,
matrixNodeIndexIdx
);
mSLog
->
info
(
"Node {}: MatrixNodeIndex {}"
,
mSystem
.
mNodes
[
idx
]
->
uid
(),
mSystem
.
mNodes
[
idx
]
->
matrixNodeIndex
());
matrixNodeIndexIdx
++
;
}
}
mSLog
->
info
(
"Number of simulation nodes: {:d}"
,
matrixNodeIndexIdx
);
}
...
...
@@ -78,7 +78,7 @@ void PFSolver::initializeComponents(){
auto
pComp
=
std
::
dynamic_pointer_cast
<
SimPowerComp
<
Complex
>>
(
comp
);
if
(
!
pComp
)
continue
;
if
(
mPowerFlowInit
)
pComp
->
initializeFrom
Powerflow
(
mSystem
.
mSystemFrequency
);
pComp
->
initializeFrom
NodesAndTerminals
(
mSystem
.
mSystemFrequency
);
}
mSLog
->
info
(
"-- Calculate per unit parameters for all components"
);
...
...
models/Include/cps/DP/DP_Ph1_AvVoltageSourceInverterDQ.h
View file @
60ba1062
...
...
@@ -95,7 +95,7 @@ namespace Ph1 {
// #### General ####
/// Initializes component from power flow data
void
initializeFrom
Powerflow
(
Real
frequency
);
void
initializeFrom
NodesAndTerminals
(
Real
frequency
);
/// Setter for general parameters of inverter
void
setParameters
(
Real
sysOmega
,
Real
sysVoltNom
,
Real
Pref
,
Real
Qref
);
/// Setter for parameters of control loops
...
...
models/Include/cps/DP/DP_Ph1_Capacitor.h
View file @
60ba1062
...
...
@@ -45,7 +45,7 @@ namespace Ph1 {
// #### General ####
/// Initializes component from power flow data
void
initializeFrom
Powerflow
(
Real
frequency
);
void
initializeFrom
NodesAndTerminals
(
Real
frequency
);
///
void
initialize
(
Matrix
frequencies
);
...
...
models/Include/cps/DP/DP_Ph1_ControlledVoltageSource.h
View file @
60ba1062
...
...
@@ -32,7 +32,7 @@ namespace CPS {
SimPowerComp
<
Complex
>::
Ptr
clone
(
String
name
);
// #### General ####
/// Initializes component from power flow data
void
initializeFrom
Powerflow
(
Real
frequency
)
{
}
void
initializeFrom
NodesAndTerminals
(
Real
frequency
)
{
}
// #### MNA section ####
/// Initializes internal variables of the component
...
...
models/Include/cps/DP/DP_Ph1_CurrentSource.h
View file @
60ba1062
...
...
@@ -43,7 +43,7 @@ namespace Ph1 {
// #### General ####
/// Initializes component from power flow data
void
initializeFrom
Powerflow
(
Real
frequency
);
void
initializeFrom
NodesAndTerminals
(
Real
frequency
);
// #### MNA section ####
///
...
...
models/Include/cps/DP/DP_Ph1_Inductor.h
View file @
60ba1062
...
...
@@ -49,7 +49,7 @@ namespace Ph1 {
/// Initializes state variables considering the number of frequencies
void
initialize
(
Matrix
frequencies
);
/// Initializes states from power flow data
void
initializeFrom
Powerflow
(
Real
frequency
);
void
initializeFrom
NodesAndTerminals
(
Real
frequency
);
// #### MNA section ####
/// Initializes MNA specific variables
...
...
models/Include/cps/DP/DP_Ph1_Inverter.h
View file @
60ba1062
...
...
@@ -123,7 +123,7 @@ namespace Ph1 {
// #### General ####
///
void
initializeFrom
Powerflow
(
Real
frequency
);
void
initializeFrom
NodesAndTerminals
(
Real
frequency
);
///
void
initialize
(
Matrix
frequencies
);
///
...
...
models/Include/cps/DP/DP_Ph1_NetworkInjection.h
View file @
60ba1062
...
...
@@ -49,7 +49,7 @@ namespace Ph1 {
// #### General ####
/// Initializes component from power flow data
void
initializeFrom
Powerflow
(
Real
frequency
);
void
initializeFrom
NodesAndTerminals
(
Real
frequency
);
///
void
setSourceValue
(
Complex
voltage
);
///
...
...
models/Include/cps/DP/DP_Ph1_PQLoadCS.h
View file @
60ba1062
...
...
@@ -53,7 +53,7 @@ namespace Ph1 {
// #### General ####
/// Initializes component from power flow data
void
initializeFrom
Powerflow
(
Real
frequency
);
void
initializeFrom
NodesAndTerminals
(
Real
frequency
);
// #### MNA section ####
/// Initializes internal variables of the component
...
...
models/Include/cps/DP/DP_Ph1_PiLine.h
View file @
60ba1062
...
...
@@ -53,7 +53,7 @@ namespace Ph1 {
// #### General ####
/// Initializes component from power flow data
void
initializeFrom
Powerflow
(
Real
frequency
);
void
initializeFrom
NodesAndTerminals
(
Real
frequency
);
// #### MNA section ####
/// Initializes internal variables of the component
...
...
models/Include/cps/DP/DP_Ph1_RXLoad.h
View file @
60ba1062
...
...
@@ -63,7 +63,7 @@ namespace Ph1 {
// #### General ####
/// Initialize component from power flow data
void
initializeFrom
Powerflow
(
Real
frequency
);
void
initializeFrom
NodesAndTerminals
(
Real
frequency
);
/// Set model specific parameters
void
setParameters
(
Real
activePower
,
Real
ReactivePower
,
Real
volt
);
...
...
models/Include/cps/DP/DP_Ph1_RXLoadSwitch.h
View file @
60ba1062
...
...
@@ -37,7 +37,7 @@ namespace Ph1 {
// #### General ####
/// Initializes component from power flow data
void
initializeFrom
Powerflow
(
Real
frequency
);
void
initializeFrom
NodesAndTerminals
(
Real
frequency
);
/// Sets model specific parameters
void
setParameters
(
Real
activePower
,
Real
reactivePower
,
Real
nomVolt
,
Real
openResistance
,
Real
closedResistance
,
Bool
closed
=
false
);
...
...
models/Include/cps/DP/DP_Ph1_ResIndSeries.h
View file @
60ba1062
...
...
@@ -50,7 +50,7 @@ namespace Ph1 {
/// Initializes state variables considering the number of frequencies
void
initialize
(
Matrix
frequencies
);
/// Initializes states from power flow data
void
initializeFrom
Powerflow
(
Real
frequency
);
void
initializeFrom
NodesAndTerminals
(
Real
frequency
);
// #### MNA section ####
/// Initializes MNA specific variables
...
...
models/Include/cps/DP/DP_Ph1_Resistor.h
View file @
60ba1062
...
...
@@ -34,7 +34,7 @@ namespace Ph1 {
// #### General ####
/// Initializes component from power flow data
void
initializeFrom
Powerflow
(
Real
frequency
);
void
initializeFrom
NodesAndTerminals
(
Real
frequency
);
// #### MNA section ####
void
mnaInitialize
(
Real
omega
,
Real
timeStep
,
Attribute
<
Matrix
>::
Ptr
leftVector
);
...
...
models/Include/cps/DP/DP_Ph1_RxLine.h
View file @
60ba1062
...
...
@@ -46,7 +46,7 @@ namespace Ph1 {
// #### General ####
/// Initializes component from power flow data
void
initializeFrom
Powerflow
(
Real
frequency
);
void
initializeFrom
NodesAndTerminals
(
Real
frequency
);
// #### MNA section ####
/// Initializes internal variables of the component
...
...
models/Include/cps/DP/DP_Ph1_SVC.h
View file @
60ba1062
...
...
@@ -76,7 +76,7 @@ namespace Ph1 {
// #### General ####
/// Initializes states from power flow data
void
initializeFrom
Powerflow
(
Real
frequency
);
void
initializeFrom
NodesAndTerminals
(
Real
frequency
);
// #### MNA section ####
/// Initializes MNA specific variables
...
...
models/Include/cps/DP/DP_Ph1_Switch.h
View file @
60ba1062
...
...
@@ -38,7 +38,7 @@ namespace Ph1 {
// #### General ####
/// Initializes component from power flow data
void
initializeFrom
Powerflow
(
Real
frequency
);
void
initializeFrom
NodesAndTerminals
(
Real
frequency
);
// #### General MNA section ####
void
mnaInitialize
(
Real
omega
,
Real
timeStep
,
Attribute
<
Matrix
>::
Ptr
leftVector
);
...
...
Prev
1
2
3
4
5
…
7
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment