Skip to content

Commit

Permalink
Updated simulation settings to avoid artefacts and ensure proper veri…
Browse files Browse the repository at this point in the history
…fication
  • Loading branch information
casella committed Jun 30, 2018
1 parent 44d6c4a commit d4f2e6c
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 39 deletions.
31 changes: 17 additions & 14 deletions ScalableTestSuite/Power/ConceptualPowerSystem.mo
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ package ConceptualPowerSystem
"One generator with 5% step reduction from equilibrium"
extends OneGeneratorConstantLoad(
P_load=cat(1, {P_nom*0.95}, P_nom*ones(N - 1)));
annotation (experiment(StopTime=500, Tolerance=1e-006),
annotation (experiment(StopTime=500, Tolerance=1e-7, Interval = 0.05),
__Dymola_experimentSetupOutput(equidistant=false),
Documentation(info="<html>
<p>Test case with a single generator. At time = 0, the load is reduced by 5&percnt;. Primary frequency control limits the frequency deviation to about 0.2 Hz, then the secondary frequency controller brings the frequency back to 50 Hz.</p>
Expand All @@ -223,7 +223,7 @@ package ConceptualPowerSystem
model TwoGeneratorsStepLoad "First load disconnects"
extends TwoGeneratorsConstantLoad(
P_load=cat(1, {0.0}, P_nom*ones(N - 1)));
annotation (experiment(StopTime=200, Tolerance=1e-006),
annotation (experiment(StopTime=200, Tolerance=1e-7, Interval = 0.05),
__Dymola_experimentSetupOutput(equidistant=false),
Documentation(info="<html>
<p><span style=\"font-family: MS Shell Dlg 2;\">Test case with a two generator connected by a transmission line. At time = 0 the load attached to the first generator is reduced by 50&percnt;. Fast electro-mechanical oscillations are triggered, along with slower thermal transients, until eventually the whole system re-settles at equilibrium in about 200 s.</span></p>
Expand All @@ -232,79 +232,82 @@ package ConceptualPowerSystem

model TenGeneratorsStepLoad
extends TwoGeneratorsStepLoad(N = 10);
annotation (experiment(StopTime=200, Tolerance=1e-006),
annotation (experiment(StopTime=200, Tolerance=1e-7, Interval = 0.05),
__Dymola_experimentSetupOutput(equidistant=false),
Documentation(info="<html>
<p><span style=\"font-family: MS Shell Dlg 2;\">Test case with ten generators connected in a linear fashion by transmission lines with the same impedance. At time = 0 the load attached to the first generator is reduced by 50&percnt;. Fast electro-mechanical oscillations are triggered, along with slower thermal transients, until eventually the whole system re-settles at equilibrium in about 200 s.</span></p>
</html>"));
end TenGeneratorsStepLoad;



end Verification;

package ScaledExperiments
model PowerSystemStepLoad_N_2_M_4
extends Verification.TwoGeneratorsStepLoad(N = 2, M = 4);
annotation (experiment(StopTime=200, Tolerance=1e-006),
annotation (experiment(StopTime=200, Tolerance=1e-7, Interval = 0.05),
__Dymola_experimentSetupOutput(equidistant=false));
end PowerSystemStepLoad_N_2_M_4;

model PowerSystemStepLoad_N_4_M_4
extends Verification.TwoGeneratorsStepLoad(N = 4, M = 4);
annotation (experiment(StopTime=200, Tolerance=1e-006),
annotation (experiment(StopTime=200, Tolerance=1e-7, Interval = 0.05),
__Dymola_experimentSetupOutput(equidistant=false));
end PowerSystemStepLoad_N_4_M_4;

model PowerSystemStepLoad_N_8_M_4
extends Verification.TwoGeneratorsStepLoad(N = 8, M = 4);
annotation (experiment(StopTime=200, Tolerance=1e-006),
annotation (experiment(StopTime=200, Tolerance=1e-7, Interval = 0.05),
__Dymola_experimentSetupOutput(equidistant=false));
end PowerSystemStepLoad_N_8_M_4;

model PowerSystemStepLoad_N_16_M_4
extends Verification.TwoGeneratorsStepLoad(N = 16, M = 4);
annotation (experiment(StopTime=200, Tolerance=1e-006),
annotation (experiment(StopTime=200, Tolerance=1e-7, Interval = 0.05),
__Dymola_experimentSetupOutput(equidistant=false));
end PowerSystemStepLoad_N_16_M_4;

model PowerSystemStepLoad_N_32_M_4
extends Verification.TwoGeneratorsStepLoad(N = 32, M = 4);
annotation (experiment(StopTime=200, Tolerance=1e-006),
annotation (experiment(StopTime=200, Tolerance=1e-7, Interval = 0.05),
__Dymola_experimentSetupOutput(equidistant=false));
end PowerSystemStepLoad_N_32_M_4;

model PowerSystemStepLoad_N_64_M_4
extends Verification.TwoGeneratorsStepLoad(N = 64, M = 4);
annotation (experiment(StopTime=200, Tolerance=1e-006),
annotation (experiment(StopTime=200, Tolerance=1e-7, Interval = 0.05),
__Dymola_experimentSetupOutput(equidistant=false));
end PowerSystemStepLoad_N_64_M_4;

model PowerSystemStepLoad_N_4_M_8
extends Verification.TwoGeneratorsStepLoad(N = 4, M = 8);
annotation (experiment(StopTime=200, Tolerance=1e-006),
annotation (experiment(StopTime=200, Tolerance=1e-7, Interval = 0.05),
__Dymola_experimentSetupOutput(equidistant=false));
end PowerSystemStepLoad_N_4_M_8;


model PowerSystemStepLoad_N_8_M_8
extends Verification.TwoGeneratorsStepLoad(N = 8, M = 8);
annotation (experiment(StopTime=200, Tolerance=1e-006),
annotation (experiment(StopTime=200, Tolerance=1e-7, Interval = 0.05),
__Dymola_experimentSetupOutput(equidistant=false));
end PowerSystemStepLoad_N_8_M_8;

model PowerSystemStepLoad_N_4_M_16
extends Verification.TwoGeneratorsStepLoad(N=4, M = 16);
annotation (experiment(StopTime=200, Tolerance=1e-006),
annotation (experiment(StopTime=200, Tolerance=1e-7, Interval = 0.05),
__Dymola_experimentSetupOutput(equidistant=false));
end PowerSystemStepLoad_N_4_M_16;

model PowerSystemStepLoad_N_64_M_8
extends Verification.TwoGeneratorsStepLoad(N = 64, M = 8);
annotation (experiment(StopTime=200, Tolerance=1e-006),
annotation (experiment(StopTime=200, Tolerance=1e-7, Interval = 0.05),
__Dymola_experimentSetupOutput(equidistant=false));
end PowerSystemStepLoad_N_64_M_8;

model PowerSystemStepLoad_N_64_M_16
extends Verification.TwoGeneratorsStepLoad(N=64, M=16);
annotation (experiment(StopTime=200, Tolerance=1e-006),
annotation (experiment(StopTime=200, Tolerance=1e-7, Interval = 0.05),
__Dymola_experimentSetupOutput(equidistant=false));
end PowerSystemStepLoad_N_64_M_16;

Expand Down
16 changes: 8 additions & 8 deletions ScalableTestSuite/Thermal/DistrictHeating.mo
Original file line number Diff line number Diff line change
Expand Up @@ -165,49 +165,49 @@ package DistrictHeating
extends Modelica.Icons.ExamplesPackage;
model HeatingSystem_N_5
extends Models.HeatingSystem(N = 5);
annotation(experiment(StopTime = 864000, Tolerance = 1e-4),
annotation(experiment(StopTime = 432000, Interval = 20, Tolerance = 1e-5),
__OpenModelica_simulationFlags(s = "ida"));
end HeatingSystem_N_5;

model HeatingSystem_N_10
extends Models.HeatingSystem(N = 10);
annotation(experiment(StopTime = 864000, Tolerance = 1e-4),
annotation(experiment(StopTime = 432000, Interval = 20, Tolerance = 1e-5),
__OpenModelica_simulationFlags(s = "ida"));
end HeatingSystem_N_10;

model HeatingSystem_N_20
extends Models.HeatingSystem(N = 20);
annotation(experiment(StopTime = 864000, Tolerance = 1e-4),
annotation(experiment(StopTime = 432000, Interval = 20, Tolerance = 1e-5),
__OpenModelica_simulationFlags(s = "ida"));
end HeatingSystem_N_20;

model HeatingSystem_N_40
extends Models.HeatingSystem(N = 40);
annotation(experiment(StopTime = 864000, Tolerance = 1e-4),
annotation(experiment(StopTime = 432000, Interval = 20, Tolerance = 1e-5),
__OpenModelica_simulationFlags(s = "ida"));
end HeatingSystem_N_40;

model HeatingSystem_N_80
extends Models.HeatingSystem(N = 80);
annotation(experiment(StopTime = 864000, Tolerance = 1e-4),
annotation(experiment(StopTime = 432000, Interval = 20, Tolerance = 1e-5),
__OpenModelica_simulationFlags(s = "ida"));
end HeatingSystem_N_80;

model HeatingSystem_N_160
extends Models.HeatingSystem(N = 160);
annotation(experiment(StopTime = 864000, Tolerance = 1e-4),
annotation(experiment(StopTime = 432000, Interval = 20, Tolerance = 1e-5),
__OpenModelica_simulationFlags(s = "ida"));
end HeatingSystem_N_160;

model HeatingSystem_N_320
extends Models.HeatingSystem(N = 320);
annotation(experiment(StopTime = 864000, Tolerance = 1e-4),
annotation(experiment(StopTime = 432000, Interval = 20, Tolerance = 1e-5),
__OpenModelica_simulationFlags(s = "ida"));
end HeatingSystem_N_320;

model HeatingSystem_N_640
extends Models.HeatingSystem(N = 640);
annotation(experiment(StopTime = 864000, Tolerance = 1e-4),
annotation(experiment(StopTime = 432000, Interval = 20, Tolerance = 1e-5),
__OpenModelica_simulationFlags(s = "ida"));
end HeatingSystem_N_640;

Expand Down
34 changes: 17 additions & 17 deletions ScalableTestSuite/Thermal/HeatExchanger.mo
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ Energy balance at the each wall segment is modified in terms of temperature vari
Qcountercur_ss = UA * dTeogCountercur;
Qcountercur_fluidA = countercur.QtotA;
Qcountercur_fluidB = countercur.QtotB;
annotation(experiment(StartTime = 0, StopTime = 20, Tolerance = 1e-6, Interval = 0.04), Documentation(info = "<html><p>Temperature distributions of the heat exchangers in cocurrent and countercurrent mode are given. T_H and T_c represent the temperature of the hot fluid and the cold fluid, respectively. </p><img src=\"modelica://ScalableTestSuite/Resources/Images/HeatExchanger/tempdistributions.png\"/><p>∆T represents the temperature difference between hot and cold fluids along the heat exchangers. And, x is a point along the channels of the heat exchanger. In the countercurrent mode, ∆T does not vary along the channels as much as the ∆T in the cocurrent mode. Moreover, in cocurrent mode, ∆T is very large at the inlet of the channels and getting smaller progressively. Countercurrent heat exchanger can be evaluated as more efficient with respect to cocurrent heat exchanger since countercurrent mode requires smaller heat transfer area to provide the same heat transfer rate.
annotation(experiment(StartTime = 0, StopTime = 20, Tolerance = 1e-7, Interval = 0.04), Documentation(info = "<html><p>Temperature distributions of the heat exchangers in cocurrent and countercurrent mode are given. T_H and T_c represent the temperature of the hot fluid and the cold fluid, respectively. </p><img src=\"modelica://ScalableTestSuite/Resources/Images/HeatExchanger/tempdistributions.png\"/><p>∆T represents the temperature difference between hot and cold fluids along the heat exchangers. And, x is a point along the channels of the heat exchanger. In the countercurrent mode, ∆T does not vary along the channels as much as the ∆T in the cocurrent mode. Moreover, in cocurrent mode, ∆T is very large at the inlet of the channels and getting smaller progressively. Countercurrent heat exchanger can be evaluated as more efficient with respect to cocurrent heat exchanger since countercurrent mode requires smaller heat transfer area to provide the same heat transfer rate.
</p><p>At the steady state, the total flow rates of Q_A and Q_B is equal to a steady state rate equation and it is used for the verification of the models.
Steady state heat rate equation for a heat exchanger is written as follows: </p><p>Q=UA∆Teog</p>
where U is the average overall heat transfer coefficient, A is the area of the heat transfer surface and ∆Teog is the average temperature driving force. UA is described as: <p>UA=Lω(γ_A γ_B)/(γ_A+γ_B )</p><p>where L is the length, ω is the perimeter of the channels, γ_A and γ_B are the heat transfer coefficients of fluid A and B respectively.</p>∆Teog is written as:<p><img src=\"modelica://ScalableTestSuite/Resources/Images/HeatExchanger/Teog.png\"/></p>where ∆T_L is the temperature difference of the fluids A and B at the outlet of the channels and ∆T_o is the temperature difference of the fluids A and B at the inlet of the channels.
Expand Down Expand Up @@ -374,97 +374,97 @@ where U is the average overall heat transfer coefficient, A is the area of the h
package ScaledExperiments
model CounterCurrentHeatExchangerEquations_N_10
extends Models.CounterCurrentHeatExchangerEquations(L = 10, N = 10, wB = 1, areaA = 5e-5, areaB = 5e-5, rhoA = 1000, rhoB = 1000, cpA = 4200, cpB = 4200, cpW = 2000, gammaA = 4000, gammaB = 10000, omega = 0.1);
annotation(experiment(StopTime = 20, Tolerance = 1e-6),
annotation(experiment(StopTime = 20, Tolerance = 1e-7),
__OpenModelica_simulationFlags(s = "ida"));
end CounterCurrentHeatExchangerEquations_N_10;

model CounterCurrentHeatExchangerEquations_N_20
extends CounterCurrentHeatExchangerEquations_N_10(N = 20);
annotation(experiment(StopTime = 20, Tolerance = 1e-6),
annotation(experiment(StopTime = 20, Tolerance = 1e-7),
__OpenModelica_simulationFlags(s = "ida"));
end CounterCurrentHeatExchangerEquations_N_20;

model CounterCurrentHeatExchangerEquations_N_40
extends CounterCurrentHeatExchangerEquations_N_10(N = 40);
annotation(experiment(StopTime = 20, Tolerance = 1e-6),
annotation(experiment(StopTime = 20, Tolerance = 1e-7),
__OpenModelica_simulationFlags(s = "ida"));
end CounterCurrentHeatExchangerEquations_N_40;

model CounterCurrentHeatExchangerEquations_N_80
extends CounterCurrentHeatExchangerEquations_N_10(N = 80);
annotation(experiment(StopTime = 20, Tolerance = 1e-6),
annotation(experiment(StopTime = 20, Tolerance = 1e-7),
__OpenModelica_simulationFlags(s = "ida"));
end CounterCurrentHeatExchangerEquations_N_80;

model CounterCurrentHeatExchangerEquations_N_160
extends CounterCurrentHeatExchangerEquations_N_10(N = 160);
annotation(experiment(StopTime = 20, Tolerance = 1e-6),
annotation(experiment(StopTime = 20, Tolerance = 1e-7),
__OpenModelica_simulationFlags(s = "ida"));
end CounterCurrentHeatExchangerEquations_N_160;

model CounterCurrentHeatExchangerEquations_N_320
extends CounterCurrentHeatExchangerEquations_N_10(N = 320);
annotation(experiment(StopTime = 20, Tolerance = 1e-6),
annotation(experiment(StopTime = 20, Tolerance = 1e-7),
__OpenModelica_simulationFlags(s = "ida"));
end CounterCurrentHeatExchangerEquations_N_320;

model CounterCurrentHeatExchangerEquations_N_640
extends CounterCurrentHeatExchangerEquations_N_10(N = 640);
annotation(experiment(StopTime = 20, Tolerance = 1e-6),
annotation(experiment(StopTime = 20, Tolerance = 1e-7),
__OpenModelica_simulationFlags(s = "ida"));
end CounterCurrentHeatExchangerEquations_N_640;

model CounterCurrentHeatExchangerEquations_N_1280
extends CounterCurrentHeatExchangerEquations_N_10(N = 1280);
annotation(experiment(StopTime = 20, Tolerance = 1e-6),
annotation(experiment(StopTime = 20, Tolerance = 1e-7),
__OpenModelica_simulationFlags(s = "ida"));
end CounterCurrentHeatExchangerEquations_N_1280;

model CocurrentHeatExchangerEquations_N_10
extends Models.CocurrentHeatExchangerEquations(L = 10, N = 10, wB = 1, areaA = 5e-5, areaB = 5e-5, rhoA = 1000, rhoB = 1000, cpA = 4200, cpB = 4200, cpW = 2000, gammaA = 4000, gammaB = 10000, omega = 0.1);
annotation(experiment(StopTime = 20, Tolerance = 1e-6),
annotation(experiment(StopTime = 20, Tolerance = 1e-7),
__OpenModelica_simulationFlags(s = "ida"));
end CocurrentHeatExchangerEquations_N_10;

model CocurrentHeatExchangerEquations_N_20
extends CocurrentHeatExchangerEquations_N_10(N = 20);
annotation(experiment(StopTime = 20, Tolerance = 1e-6),
annotation(experiment(StopTime = 20, Tolerance = 1e-7),
__OpenModelica_simulationFlags(s = "ida"));
end CocurrentHeatExchangerEquations_N_20;

model CocurrentHeatExchangerEquations_N_40
extends CocurrentHeatExchangerEquations_N_10(N = 40);
annotation(experiment(StopTime = 20, Tolerance = 1e-6),
annotation(experiment(StopTime = 20, Tolerance = 1e-7),
__OpenModelica_simulationFlags(s = "ida"));
end CocurrentHeatExchangerEquations_N_40;

model CocurrentHeatExchangerEquations_N_80
extends CocurrentHeatExchangerEquations_N_10(N = 80);
annotation(experiment(StopTime = 20, Tolerance = 1e-6),
annotation(experiment(StopTime = 20, Tolerance = 1e-7),
__OpenModelica_simulationFlags(s = "ida"));
end CocurrentHeatExchangerEquations_N_80;

model CocurrentHeatExchangerEquations_N_160
extends CocurrentHeatExchangerEquations_N_10(N = 160);
annotation(experiment(StopTime = 20, Tolerance = 1e-6),
annotation(experiment(StopTime = 20, Tolerance = 1e-7),
__OpenModelica_simulationFlags(s = "ida"));
end CocurrentHeatExchangerEquations_N_160;

model CocurrentHeatExchangerEquations_N_320
extends CocurrentHeatExchangerEquations_N_10(N = 320);
annotation(experiment(StopTime = 20, Tolerance = 1e-6),
annotation(experiment(StopTime = 20, Tolerance = 1e-7),
__OpenModelica_simulationFlags(s = "ida"));
end CocurrentHeatExchangerEquations_N_320;

model CocurrentHeatExchangerEquations_N_640
extends CocurrentHeatExchangerEquations_N_10(N = 640);
annotation(experiment(StopTime = 20, Tolerance = 1e-6),
annotation(experiment(StopTime = 20, Tolerance = 1e-7),
__OpenModelica_simulationFlags(s = "ida"));
end CocurrentHeatExchangerEquations_N_640;

model CocurrentHeatExchangerEquations_N_1280
extends CocurrentHeatExchangerEquations_N_10(N = 1280);
annotation(experiment(StopTime = 20, Tolerance = 1e-6),
annotation(experiment(StopTime = 20, Tolerance = 1e-7),
__OpenModelica_simulationFlags(s = "ida"));
end CocurrentHeatExchangerEquations_N_1280;

Expand Down

0 comments on commit d4f2e6c

Please sign in to comment.