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

Feature/wsieg1 #184

Merged
merged 5 commits into from
Jan 23, 2024
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 python/src/example/input_39bus_step005_v33_itr.xml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
-ksp_type preonly
-pc_type lu
-pc_factor_mat_ordering_type amd
-pc_factor_shift_type NONZERO
</PETScOptions>
</LinearSolver>
<LinearMatrixSolver>
Expand Down
30 changes: 30 additions & 0 deletions src/applications/data_sets/dyr/kundur-twoarea_wsieg1.dyr
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
1 'GENROU' 1 8.0000 0.30000E-01 0.40000 0.50000E-01
6.5000 0.0000 1.80000 1.70000 0.30000
0.55000 0.2500 0.20000 0.0000 0.0000 /
1 'SEXS' 1 0.1000 10.000 200.00 0.00000
0.0000 3.0000 /
1 'TGOV1' 1 0.0400 2.0000 1.0000 0.0000
3.0000 15.000 0.40000 /
2 'GENROU' 1 8.0000 0.30000E-01 0.40000 0.50000E-01
6.5000 0.0000 1.80000 1.70000 0.30000
0.55000 0.2500 0.20000 0.0000 0.0000 /
2 'SEXS' 1 0.1000 10.000 200.00 0.00000
0.0000 3.0000 /
2 'TGOV1' 1 0.0400 2.0000 1.0000 0.0000
3.0000 15.000 0.40000 /
3 'GENROU' 1 8.0000 0.30000E-01 0.40000 0.50000E-01
6.1750 0.0000 1.80000 1.70000 0.30000
0.55000 0.2500 0.20000 0.0000 0.0000 /
3 'SEXS' 1 0.1000 10.000 200.00 0.00000
0.0000 3.0000 /
3 'TGOV1' 1 0.0400 2.0000 1.0000 0.0000
3.0000 15.000 0.40000 /
4 'GENROU' 1 8.0000 0.30000E-01 0.40000 0.50000E-01
6.1750 0.0000 1.80000 1.70000 0.30000
0.55000 0.2500 0.20000 0.0000 0.0000 /
4 'SEXS' 1 0.1000 10.000 200.00 0.00000
0.0000 3.0000 /
4 'WSIEG1' 1 0 0 25.0000 0.10000 0.10000 0.300000 1.50000 -3.30000 51.01000 0.00000 0.3 0.3
0.00000 4.00000 0.20000 0.00000 0.30000 0.50000 0.00000 0.10000 0.00000 0.00000
0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
0.00000 0.00000 0.00000 0 /
140 changes: 140 additions & 0 deletions src/applications/data_sets/input/ds/input_kundur_two_area_wsieg1.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
<?xml version="1.0" encoding="utf-8"?>
<Configuration>
<Powerflow>
<networkConfiguration_v33> kundur-twoarea_v33.raw </networkConfiguration_v33>
<maxIteration>20</maxIteration>
<tolerance>1.0e-8</tolerance>
<qLimit>True</qLimit>
<LinearSolver>
<SolutionTolerance>1.0E-11 </SolutionTolerance>
<PETScOptions>
<!-- -ksp_view -->
-ksp_type richardson
-pc_type lu
-pc_factor_mat_solver_type superlu_dist
-ksp_max_it 1
</PETScOptions>
</LinearSolver>
<!--
If UseNewton is true a NewtonRaphsonSolver is
used. Otherwise, a PETSc-based NonlinearSolver is
used. Configuration parameters for both are included here.
-->
<UseNonLinear>false</UseNonLinear>
<UseNewton>false</UseNewton>
<NewtonRaphsonSolver>
<SolutionTolerance>1.0E-05</SolutionTolerance>
<FunctionTolerance>1.0E-05</FunctionTolerance>
<MaxIterations>20</MaxIterations>
<LinearSolver>
<SolutionTolerance>1.0E-08</SolutionTolerance>
<MaxIterations>50</MaxIterations>
<PETScOptions>
-ksp_type bicg
-pc_type bjacobi
-sub_pc_type ilu -sub_pc_factor_levels 5 -sub_ksp_type preonly
<!-- -ksp_monitor
-ksp_view -->
</PETScOptions>
</LinearSolver>
</NewtonRaphsonSolver>
<NonlinearSolver>
<SolutionTolerance>1.0E-05</SolutionTolerance>
<FunctionTolerance>1.0E-05</FunctionTolerance>
<MaxIterations>50</MaxIterations>
<PETScOptions>
-ksp_type bicg
-pc_type bjacobi
-sub_pc_type ilu -sub_pc_factor_levels 5 -sub_ksp_type preonly
<!-- -snes_view
-snes_monitor
-ksp_monitor
-ksp_view -->
</PETScOptions>
</NonlinearSolver>
</Powerflow>
<Dynamic_simulation>

<iterativeNetworkInterface> false </iterativeNetworkInterface>
<iterativeNetworkInterfaceDebugPrint> false </iterativeNetworkInterfaceDebugPrint>

<generatorParameters> kundur-twoarea_wsieg1.dyr </generatorParameters>

<simulationTime>20.0</simulationTime>
<timeStep>0.002 </timeStep>
<Events>
<faultEvent>
<beginFault> 10.0</beginFault>
<endFault> 10.1</endFault>
<faultBranch>8 9</faultBranch>
<timeStep> 0.002</timeStep>
</faultEvent>
</Events>

<reportNonExistingElements> false </reportNonExistingElements>

<observations>
<observation>
<type> bus </type>
<busID> 6 </busID>
</observation>
<observation>
<type> bus </type>
<busID> 10 </busID>
</observation>
<observation>
<type> generator </type>
<busID> 1 </busID>
<generatorID> 1 </generatorID>
</observation>
<observation>
<type> generator </type>
<busID> 4 </busID>
<generatorID> 1 </generatorID>
</observation>
</observations>

<generatorWatch>
<generator>
<busID> 4 </busID>
<generatorID> 1 </generatorID>
</generator>
</generatorWatch>
<generatorWatchFrequency> 1 </generatorWatchFrequency>
<generatorWatchFileName> kundur_two_area_detail.csv </generatorWatchFileName>
<suppressWatchFiles> false </suppressWatchFiles>
<LinearSolver>
<SolutionTolerance>1.0E-12 </SolutionTolerance>
<ForceSerial>true</ForceSerial>
<InitialGuessZero>true</InitialGuessZero>
<SerialMatrixConstant>true</SerialMatrixConstant>
<PETScOptions>
<!--
-ksp_type richardson
-->
-ksp_type richardson
-pc_type lu
-pc_factor_mat_solver_type superlu_dist
-ksp_max_it 1
</PETScOptions>
</LinearSolver>
<LinearMatrixSolver>
<!--
These options are used if SuperLU was built into PETSc
-->
<Ordering>nd</Ordering>
<Package>superlu_dist</Package>
<Iterations>1</Iterations>
<Fill>5</Fill>
<!--<PETScOptions>
These options are used for the LinearSolver if SuperLU is not available
-ksp_atol 1.0e-18
-ksp_rtol 1.0e-10
-ksp_monitor
-ksp_max_it 200
-ksp_view
</PETScOptions>
-->
</LinearMatrixSolver>
</Dynamic_simulation>
</Configuration>
6 changes: 6 additions & 0 deletions src/applications/modules/dynamic_simulation_full_y/cblock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,4 +360,10 @@ void Integrator::setparams(double T)
setylimits(-1000.0,1000.0);
}

void Integrator::setparams(double T,double xmin,double xmax)
{
setparams(T);
setxlimits(xmin,xmax);
}


2 changes: 2 additions & 0 deletions src/applications/modules/dynamic_simulation_full_y/cblock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,8 @@ class Integrator: public Cblock
T Integrator time constant
**/
void setparams(double T);

void setparams(double T, double xmin, double xmax);
};


Expand Down
20 changes: 19 additions & 1 deletion src/applications/modules/dynamic_simulation_full_y/dblock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,24 @@ double PiecewiseSlope::getoutput(double u)

return yout;
}


double PiecewiseSlope::init_given_y(double yout)
{
int i;
double u;

if(p_increasing && yout <= p_y[0]) u = p_u[0];
if(p_increasing && yout >= p_y[p_n]) u = p_u[p_n];
if(!p_increasing && yout >= p_y[0]) u = p_u[0];
if(!p_increasing && yout <= p_y[p_n]) u = p_u[p_n];

for (i=0; i<p_n; i++) {
if (p_y[i] <= yout && yout <= p_y[i+1]) {
u = p_u[i] + (p_u[i+1] - p_u[i]) / (p_y[i+1] - p_y[i]) * (yout - p_y[i]);
}
}

return u;
}


2 changes: 2 additions & 0 deletions src/applications/modules/dynamic_simulation_full_y/dblock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,8 @@ class PiecewiseSlope
**/
void setparams(int, double *, double *);

double init_given_y(double yout);

private:
Slope p_slopes[4];
double p_u[5]; // Input points for slope calculations
Expand Down
Loading