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
4ad8c31d
Commit
4ad8c31d
authored
Oct 16, 2020
by
Markus Mirz
Browse files
Solver: clean up
parent
e58afb5a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Include/dpsim/Solver.h
View file @
4ad8c31d
...
...
@@ -28,38 +28,36 @@ namespace DPsim {
/// Base class for more specific solvers such as MNA, ODE or IDA.
class
Solver
{
protected:
/// Name for
display
ing
/// Name for
logg
ing
String
mName
;
///
///
Logging level
CPS
::
Logger
::
Level
mLogLevel
;
///
///
Logger
CPS
::
Logger
::
Log
mSLog
;
/// Time step for fixed step solvers
Real
mTimeStep
;
///
///
Activates parallelized computation of frequencies
Bool
mFrequencyParallel
=
false
;
/// Switch to trigger steady-state initialization
// ####
steady state i
nitialization ####
// ####
I
nitialization ####
/// steady state initialization time limit
Real
mSteadStIniTimeLimit
=
10
;
/// steady state initialization accuracy limit
Real
mSteadStIniAccLimit
=
0.0001
;
/// Activates steady state initialization
Bool
mSteadyStateInit
=
false
;
/// Determines if solver is in initialization phase, which requires different behavior
Bool
mIsInInitialization
=
false
;
/// Activates powerflow initialization
/// If this is false, all voltages are initialized with zero
Bool
mPowerFlowInit
=
true
;
/// Determines if solver is in initialization phase, which requires different behavior
Bool
mIsInInitialization
=
false
;
public:
typedef
std
::
shared_ptr
<
Solver
>
Ptr
;
typedef
std
::
vector
<
Ptr
>
List
;
Solver
(
String
name
,
CPS
::
Logger
::
Level
logLevel
)
:
mName
(
name
),
mLogLevel
(
logLevel
)
{
mName
(
name
),
mLogLevel
(
logLevel
)
{
// Solver global logging
mSLog
=
CPS
::
Logger
::
get
(
name
+
"_Solver"
,
logLevel
);
...
...
@@ -67,13 +65,10 @@ namespace DPsim {
virtual
~
Solver
()
{
}
enum
class
Type
{
MNA
,
DAE
,
NRP
};
virtual
CPS
::
Task
::
List
getTasks
()
=
0
;
/// Log results
virtual
void
log
(
Real
time
)
{
};
// #### Solver settings ####
/// Solver types:
/// Modified Nodal Analysis, Differential Algebraic, Newton Raphson
enum
class
Type
{
MNA
,
DAE
,
NRP
};
///
void
setTimeStep
(
Real
timeStep
)
{
mTimeStep
=
timeStep
;
...
...
@@ -82,14 +77,12 @@ namespace DPsim {
void
doFrequencyParallelization
(
Bool
freqParallel
)
{
mFrequencyParallel
=
freqParallel
;
}
///
virtual
void
setSystem
(
CPS
::
SystemTopology
system
)
{}
// #### Initialization ####
///
virtual
void
initialize
()
{}
// #### steady state initialization ####
/// activate steady state initialization
void
doSteadyStateInit
(
Bool
f
)
{
mSteadyStateInit
=
f
;
}
/// set steady state initialization time limit
...
...
@@ -98,5 +91,11 @@ namespace DPsim {
void
setSteadStIniAccLimit
(
Real
v
)
{
mSteadStIniAccLimit
=
v
;
}
/// activate powerflow initialization
void
doPowerFlowInit
(
Bool
f
)
{
mPowerFlowInit
=
f
;
}
// #### Simulation ####
/// Get tasks for scheduler
virtual
CPS
::
Task
::
List
getTasks
()
=
0
;
/// Log results
virtual
void
log
(
Real
time
)
{
};
};
}
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