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

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

- update expected values in testcase

- more expanative error message when checking EM-Torque limitations
- corecting error message in EM-Powermap reader
parent 4c0ea2c6
No related branches found
No related tags found
No related merge requests found
......@@ -79,7 +79,7 @@ namespace TUGraz.VectoCore.InputData.Reader.ComponentData {
if (speeds.Count <= 2) {
throw new VectoException(
"Failed to generate electric power map - at least two speed entries > 0 are required!");
"Failed to generate electric power map - at least three speed entries > 0 are required!");
}
var lowerSpeed = speeds.First().RPMtoRad() / 2.0;
var upperSpeed = speeds.First().RPMtoRad() + (speeds[1] - speeds.First()).RPMtoRad() / 2.0;
......
......@@ -35,22 +35,21 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter.SimulationComponen
}
private void CheckTorqueLimitVoltageLevels(IElectricMachinesDeclarationInputData electricMachines, IDictionary<PowertrainPosition, IList<Tuple<Volt, TableData>>> torqueLimits)
private void CheckTorqueLimitVoltageLevels(IElectricMachinesDeclarationInputData electricMachines,
IDictionary<PowertrainPosition, IList<Tuple<Volt, TableData>>> torqueLimits)
{
if (torqueLimits == null) {
return;
}
foreach (var torqueLimit in torqueLimits.OrderBy(x => x.Key)) {
//E-machines at position
foreach(var eMachine in electricMachines.Entries.Where(e => e.Position == torqueLimit.Key).Select(e => e.ElectricMachine))
{
foreach(var eMachine in electricMachines.Entries.Where(e => e.Position == torqueLimit.Key).Select(x => x.ElectricMachine)) {
foreach (var torqueLimitVoltageLevel in torqueLimit.Value.Select(tl => tl.Item1)) {
if (eMachine.VoltageLevels.All(vl => vl.VoltageLevel != torqueLimitVoltageLevel)) {
throw new VectoException(
$"Voltage level {torqueLimitVoltageLevel} not found in {eMachine.ElectricMachineType} at position {torqueLimit.Key}");
$"EM Torque Limit: Voltage level {torqueLimitVoltageLevel} not found for EM at position {torqueLimit.Key}");
}
}
}
......
......@@ -856,10 +856,6 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
dcdc.Connect(elAux);
dcdc.Initialize();
}
......@@ -1127,7 +1123,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
private static void AddElectricAuxiliary(VectoRunData data, VehicleContainer container, ElectricSystem es)
{
var aux = new ElectricAuxiliary(container);
var aux = new HighVoltageElectricAuxiliary(container);
aux.AddConstant("P_aux_el", data.ElectricAuxDemand ?? 0.SI<Watt>());
es.Connect(aux);
}
......
......@@ -24,6 +24,7 @@
<ItemGroup>
<ProjectReference Include="..\..\VectoCommon\VectoCommon\VectoCommon.csproj" />
<ProjectReference Include="..\..\VectoCommon\VectoHashing\VectoHashing.csproj" />
<ProjectReference Include="..\VectoCore\VectoCore.csproj" />
</ItemGroup>
......
......@@ -367,7 +367,7 @@ namespace TUGraz.VectoCore.Tests.XML
Assert.AreEqual("aaaaa", eMachine.AppVersion);
Assert.AreEqual(ElectricMachineType.ASM, eMachine.ElectricMachineType);
Assert.AreEqual(CertificationMethod.Measured, eMachine.CertificationMethod);
Assert.AreEqual(1.SI<Watt>(), eMachine.R85RatedPower);
Assert.AreEqual(50000.SI<Watt>(), eMachine.R85RatedPower);
Assert.AreEqual(0.10.SI<KilogramSquareMeter>(), eMachine.Inertia);//RotationalInertia
//Assert.AreEqual(200.00.SI<NewtonMeter>(), eMachine.ContinuousTorque);
//Assert.AreEqual(2000.00.SI<PerSecond>(), eMachine.ContinuousTorqueSpeed);//TestSpeedContinuousTorque
......@@ -1333,7 +1333,7 @@ namespace TUGraz.VectoCore.Tests.XML
Assert.AreEqual("aaaaa", iepcData.AppVersion);
Assert.AreEqual(ElectricMachineType.ASM, iepcData.ElectricMachineType);
Assert.AreEqual(CertificationMethod.Measured, iepcData.CertificationMethod);
Assert.AreEqual(1.SI<Watt>(), iepcData.R85RatedPower);
Assert.AreEqual(50000.SI<Watt>(), iepcData.R85RatedPower);
Assert.AreEqual(0.10.SI<KilogramSquareMeter>(), iepcData.Inertia);//RotationalInertia
Assert.AreEqual(false, iepcData.DifferentialIncluded);
Assert.AreEqual(false, iepcData.DesignTypeWheelMotor);
......
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