Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit a9e4c8ef authored by Michael KRISPER's avatar Michael KRISPER
Browse files

Merge branch 'develop' into feature/VECTO-81-model-driving-cycles

* develop:
  update repository

Conflicts:
	VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs
	VectoCoreTest/Models/SimulationComponent/CombustionEngineTest.cs
parents 48ffc3b9 f4c30b47
No related branches found
No related tags found
No related merge requests found
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using TUGraz.VectoCore.Exceptions;
using TUGraz.VectoCore.Models.Connector.Ports;
using TUGraz.VectoCore.Models.Simulation;
......@@ -104,14 +103,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
_previousState.EngineSpeed = _data.IdleSpeed;
}
public ITnOutPort OutShaft()
{
return this;
}
public override void CommitSimulationStep(IModalDataWriter writer)
{
writer[ModalResultField.PaEng] = _currentState.EnginePowerLoss;
......@@ -125,13 +121,13 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
_currentState.AbsTime = absTime;
var requestedPower = VectoMath.ConvertRpmTorqueToPower(engineSpeed, torque);
var enginePowerLoss = InertiaPowerLoss(torque, engineSpeed);
var requestedEnginePower = requestedPower + enginePowerLoss;
_currentState.EnginePowerLoss = InertiaPowerLoss(torque, engineSpeed);
var requestedEnginePower = requestedPower + _currentState.EnginePowerLoss;
if (engineSpeed < _data.IdleSpeed - EngineIdleSpeedStopThreshold)
{
_currentState.OperationMode = EngineOperationMode.Stopped;
_currentState.EnginePowerLoss = enginePowerLoss;
//_currentState.EnginePowerLoss = enginePowerLoss;
}
var currentGear = Cockpit.Gear();
......@@ -146,12 +142,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
UpdateEngineState(requestedEnginePower, maxEnginePower, minEnginePower);
}
protected void ValidatePowerDemand(double requestedEnginePower, double maxEnginePower, double minEnginePower)
{
if (minEnginePower >= 0 && requestedEnginePower < 0)
......
......@@ -25,8 +25,8 @@ namespace TUGraz.VectoCore.Tests.Integration.EngineOnlyCycle
gearbox.InShaft().Connect(engine.OutShaft());
var absTime = new TimeSpan(days: 0, hours: 0, minutes: 0, seconds: 0);
var dt = new TimeSpan(days: 0, hours: 0, minutes: 0, seconds: 1);
var absTime = new TimeSpan();
var dt = TimeSpan.FromSeconds(1);
gearbox.Request(absTime, dt, VectoMath.ConvertPowerToTorque(2329.973, 644.4445), 644.4445);
......
......@@ -46,7 +46,6 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
var gearbox = new EngineOnlyGearbox(vehicle);
var port = engine.OutShaft();
var absTime = new TimeSpan(seconds: 0, minutes: 0, hours: 0);
......@@ -85,7 +84,10 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
engine.CommitSimulationStep(dataWriter);
//todo: test with correct output values, add other fields to test
Assert.AreEqual(2.906175, dataWriter[ModalResultField.PaEng]);
//Assert.AreEqual(dataWriter[ModalResultField.FC], 13000);
//Assert.AreEqual(dataWriter[ModalResultField.FCAUXc], 14000);
//Assert.AreEqual(dataWriter[ModalResultField.FCWHTCc], 15000);
Assert.AreEqual(1152.40304, Double.Parse(dataWriter[ModalResultField.PaEng].ToString()), 0.001);
}
[DataSource("Microsoft.VisualStudio.TestTools.DataSource.CSV", "|DataDirectory|\\TestData\\EngineTests.csv", "EngineTests#csv", DataAccessMethod.Sequential)]
......
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