Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 0da7f1c5 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

adapt testcases due to removing mappting auxiliaries

parent 54099993
No related branches found
No related tags found
No related merge requests found
......@@ -527,7 +527,7 @@ namespace TUGraz.VectoCore.Tests.Integration.CompletedBus
var specificElectric =
relatedRun.VectoRunDataSpezificBody.BusAuxiliaries.ElectricalUserInputsConfig;
Assert.AreEqual(false, genericElectric.AlternatorType);
Assert.AreEqual(AlternatorType.Conventional, genericElectric.AlternatorType);
Assert.AreEqual(genericElectric.AlternatorType, specificElectric.AlternatorType);
Assert.AreEqual(null, genericElectric.MaxAlternatorPower);
......
......@@ -205,7 +205,7 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation
}
}
[TestCase] // todo: update expected values as no mapping aux is used
[TestCase]
public void AuxAllCombined()
{
var dataWriter = new MockModalDataContainer();
......@@ -230,21 +230,22 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation
var speed = 578.22461991.RPMtoRad(); // = 2358 (nAuxiliary) * ratio
var torque = 500.SI<NewtonMeter>();
var t = 0.SI<Second>();
// MQ 2021-03-03: updated expected values - mapping auxiliary is no longer supported
var expected = new[] {
1200 + 6100 + 72.9166666666667,
1200 + 6100, // + 72.9166666666667,
// = 1000 * 0.07 (nAuxiliary=2358 and psupply=0) / 0.98 (efficiency_supply)
1200 + 3100 + 677.083333333333,
1200 + 3100, // + 677.083333333333,
// = 1000 * 0.65 (nAuxiliary=2358 and psupply=0.38) / 0.98 (efficiency_supply)
1200 + 2300 + 822.916666666667,
1200 + 2300, // + 822.916666666667,
// = 1000 * 0.79 (nAuxiliary=2358 and psupply=0.49) / 0.98 (efficiency_supply)
1200 + 4500 + 1031.25, // = ...
1200 + 6100 + 1166.66666666667,
1200 + 6100 + 1656.25,
1200 + 6100 + 2072.91666666667,
1200 + 6100 + 2510.41666666667,
1200 + 6100 + 2979.16666666667,
1200 + 6100 + 3322.91666666667,
1200 + 6100 + 3656.25
1200 + 4500, // + 1031.25, // = ...
1200 + 6100, // + 1166.66666666667,
1200 + 6100, // + 1656.25,
1200 + 6100, // + 2072.91666666667,
1200 + 6100, // + 2510.41666666667,
1200 + 6100, // + 2979.16666666667,
1200 + 6100, // + 3322.91666666667,
1200 + 6100, // + 3656.25
};
foreach (var e in expected) {
......@@ -257,53 +258,6 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation
}
}
[TestCase] // TODO: remove?!
public void AuxMapping()
{
var dataWriter = new MockModalDataContainer();
var container = new VehicleContainer(ExecutionMode.Engineering, dataWriter);
var data = DrivingCycleDataReader.ReadFromFile(@"TestData\Cycles\Coach time based short.vdri",
CycleType.MeasuredSpeed, false);
// cycle ALT1 is set to values to equal the first few fixed points in the auxiliary file.
// ALT1.aux file: nAuxiliary speed 2358: 0, 0.38, 0.49, 0.64, ...
// ALT1 in cycle file: 0, 0.3724 (=0.38*0.96), 0.4802 (=0.49*0.96), 0.6272 (0.64*0.96), ...
var cycle = new MockDrivingCycle(container, data);
new MockTnOutPort();
var aux = new EngineAuxiliary(container);
var speed = 578.22461991.RPMtoRad(); // = 2358 (nAuxiliary) * ratio
var torque = 500.SI<NewtonMeter>();
var t = 0.SI<Second>();
var expected = new[] {
72.9166666666667,
// = 1000 * 0.07 (pmech from aux file at nAuxiliary=2358 and psupply=0) / 0.98 (efficiency_supply)
677.083333333333, // = 1000 * 0.65 (nAuxiliary=2358 and psupply=0.38) / 0.98
822.916666666667, // = 1000 * 0.79 (nAuxiliary=2358 and psupply=0.49) / 0.98
1031.25, // = ...
1166.66666666667,
1656.25,
2072.91666666667,
2510.41666666667,
2979.16666666667,
3322.91666666667,
3656.25
};
foreach (var e in expected) {
aux.Initialize(torque, speed);
var auxDemand = aux.TorqueDemand(t, t, torque, speed);
AssertHelper.AreRelativeEqual((e.SI<Watt>() / speed).Value(), auxDemand);
cycle.CommitSimulationStep(t, t, null);
}
}
[Category("LongRunning")]
[TestCase]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment