From 51396cd4ed931a5248d6c4659f88480dfd777efe Mon Sep 17 00:00:00 2001 From: Markus Quaritsch <markus.quaritsch@tugraz.at> Date: Mon, 18 May 2020 16:32:45 +0200 Subject: [PATCH] handle cases where to torque converter operating point can be found. allow setting tc operating point to a fixed value and then adapt remaining requiest to match this opreating point. remove unused parameter in aux interface --- VectoCommon/VectoCommon/Models/IResponse.cs | 1 + .../Models/Connector/Ports/Impl/Response.cs | 5 +- .../Models/Simulation/DataBus/IDataBus.cs | 3 +- .../Models/Simulation/DataBus/IEngineInfo.cs | 5 + .../Models/Simulation/DataBus/IGearboxInfo.cs | 7 + .../Simulation/Impl/VehicleContainer.cs | 13 ++ .../Models/SimulationComponent/IAuxPort.cs | 3 +- .../SimulationComponent/Impl/ATGearbox.cs | 3 + .../Impl/BusAuxiliariesAdapter.cs | 20 +- .../Impl/CombustionEngine.cs | 17 +- .../Models/SimulationComponent/Impl/Driver.cs | 203 +++++++++++++++++- .../Impl/EngineAuxiliary.cs | 4 +- .../Impl/EngineOnlyCombustionEngine.cs | 3 +- .../Impl/TorqueConverter.cs | 28 ++- .../Impl/VTPCombustionEngine.cs | 3 +- .../BusAuxiliaries/AuxDemandTest.cs | 12 +- .../BusAuxiliaries/BusAdapterTest.cs | 12 +- .../Models/Simulation/AuxTests.cs | 14 +- .../Models/SimulationComponent/ClutchTest.cs | 10 + VectoCore/VectoCoreTest/Utils/MockPorts.cs | 10 + .../Utils/MockVehicleContainer.cs | 16 ++ 21 files changed, 334 insertions(+), 58 deletions(-) diff --git a/VectoCommon/VectoCommon/Models/IResponse.cs b/VectoCommon/VectoCommon/Models/IResponse.cs index 7147210f83..15c927f90a 100644 --- a/VectoCommon/VectoCommon/Models/IResponse.cs +++ b/VectoCommon/VectoCommon/Models/IResponse.cs @@ -63,5 +63,6 @@ namespace TUGraz.VectoCommon.Models NewtonMeter EngineDynamicFullLoadTorque { get; set; } MeterPerSecond VehicleSpeed { get; set; } NewtonMeter CardanTorque { get; set; } + PerSecond GearboxInputSpeed { get; set; } } } \ No newline at end of file diff --git a/VectoCore/VectoCore/Models/Connector/Ports/Impl/Response.cs b/VectoCore/VectoCore/Models/Connector/Ports/Impl/Response.cs index c2abc75a5e..682ee9a1c4 100644 --- a/VectoCore/VectoCore/Models/Connector/Ports/Impl/Response.cs +++ b/VectoCore/VectoCore/Models/Connector/Ports/Impl/Response.cs @@ -71,9 +71,13 @@ namespace TUGraz.VectoCore.Models.Connector.Ports.Impl public NewtonMeter CardanTorque { get; set; } + public PerSecond GearboxInputSpeed { get; set; } + public TorqueConverterOperatingPoint TorqueConverterOperatingPoint { get; set; } + public NewtonMeter TorqueConverterTorqueDemand { get; set; } + public override string ToString() { var t = GetType(); @@ -132,7 +136,6 @@ namespace TUGraz.VectoCore.Models.Connector.Ports.Impl public class ResponseDryRun : AbstractResponse { - public Watt DeltaFullLoad { get; set; } public Watt DeltaDragLoad { get; set; } public PerSecond DeltaEngineSpeed { get; set; } diff --git a/VectoCore/VectoCore/Models/Simulation/DataBus/IDataBus.cs b/VectoCore/VectoCore/Models/Simulation/DataBus/IDataBus.cs index 7448e0f133..dfc5c0ae21 100644 --- a/VectoCore/VectoCore/Models/Simulation/DataBus/IDataBus.cs +++ b/VectoCore/VectoCore/Models/Simulation/DataBus/IDataBus.cs @@ -44,7 +44,8 @@ namespace TUGraz.VectoCore.Models.Simulation.DataBus ExecutionMode ExecutionMode { get; } Second AbsTime { get; set; } - + + ITorqueConverterControl TorqueConverter { get; } } } \ No newline at end of file diff --git a/VectoCore/VectoCore/Models/Simulation/DataBus/IEngineInfo.cs b/VectoCore/VectoCore/Models/Simulation/DataBus/IEngineInfo.cs index bf46097424..def5398f94 100644 --- a/VectoCore/VectoCore/Models/Simulation/DataBus/IEngineInfo.cs +++ b/VectoCore/VectoCore/Models/Simulation/DataBus/IEngineInfo.cs @@ -47,8 +47,13 @@ namespace TUGraz.VectoCore.Models.Simulation.DataBus Watt EngineStationaryFullPower(PerSecond angularSpeed); + Watt EngineDynamicFullLoadPower(PerSecond avgEngineSpeed, Second dt); + Watt EngineDragPower(PerSecond angularSpeed); + Watt EngineAuxDemand(PerSecond avgEngineSpeed, Second dt); + + PerSecond EngineIdleSpeed { get; } PerSecond EngineRatedSpeed { get; } diff --git a/VectoCore/VectoCore/Models/Simulation/DataBus/IGearboxInfo.cs b/VectoCore/VectoCore/Models/Simulation/DataBus/IGearboxInfo.cs index 696f0a9797..5ce86d919b 100644 --- a/VectoCore/VectoCore/Models/Simulation/DataBus/IGearboxInfo.cs +++ b/VectoCore/VectoCore/Models/Simulation/DataBus/IGearboxInfo.cs @@ -29,6 +29,7 @@ * Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology */ +using System; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Models.SimulationComponent; @@ -76,4 +77,10 @@ namespace TUGraz.VectoCore.Models.Simulation.DataBus { bool DisengageGearbox { set; } } + + public interface ITorqueConverterControl + { + Tuple<TorqueConverterOperatingPoint, NewtonMeter> CalculateOperatingPoint(PerSecond inSpeed, PerSecond outSpeed); + TorqueConverterOperatingPoint SetOperatingPoint { get; set; } + } } \ No newline at end of file diff --git a/VectoCore/VectoCore/Models/Simulation/Impl/VehicleContainer.cs b/VectoCore/VectoCore/Models/Simulation/Impl/VehicleContainer.cs index 30a650220c..85f68fbd9c 100644 --- a/VectoCore/VectoCore/Models/Simulation/Impl/VehicleContainer.cs +++ b/VectoCore/VectoCore/Models/Simulation/Impl/VehicleContainer.cs @@ -187,11 +187,21 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl return Engine.EngineStationaryFullPower(angularSpeed); } + public Watt EngineDynamicFullLoadPower(PerSecond avgEngineSpeed, Second dt) + { + return Engine.EngineDynamicFullLoadPower(avgEngineSpeed, dt); + } + public Watt EngineDragPower(PerSecond angularSpeed) { return Engine.EngineDragPower(angularSpeed); } + public Watt EngineAuxDemand(PerSecond avgEngineSpeed, Second dt) + { + return Engine.EngineAuxDemand(avgEngineSpeed, dt); + } + public PerSecond EngineIdleSpeed { get { return Engine.EngineIdleSpeed; } @@ -286,6 +296,8 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl public virtual Second AbsTime { get; set; } + public ITorqueConverterControl TorqueConverter { get; private set; } + public void AddComponent(VectoSimulationComponent component) { var commitPriority = 0; @@ -304,6 +316,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl commitPriority = 4; }) .If<IGearboxControl>(c => GearboxCtl = c) + .If<ITorqueConverterControl>(c => TorqueConverter = c) .If<IAxlegearInfo>(c => Axlegear = c) .If<IWheelsInfo>(c => Wheels = c) .If<IVehicleInfo>(c => { diff --git a/VectoCore/VectoCore/Models/SimulationComponent/IAuxPort.cs b/VectoCore/VectoCore/Models/SimulationComponent/IAuxPort.cs index 5a313f1fae..3574b14941 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/IAuxPort.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/IAuxPort.cs @@ -47,8 +47,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent { NewtonMeter Initialize(NewtonMeter torque, PerSecond angularSpeed); - NewtonMeter TorqueDemand(Second absTime, Second dt, NewtonMeter torquePowerTrain, NewtonMeter torqueEngine, - PerSecond angularSpeed, bool dryRun = false); + NewtonMeter TorqueDemand(Second absTime, Second dt, NewtonMeter torquePowerTrain, PerSecond angularSpeed, bool dryRun = false); Watt PowerDemandEngineOn(Second time, Second simulationInterval, PerSecond engineSpeed); diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATGearbox.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATGearbox.cs index 4edeb2ac9e..240cf62e8c 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATGearbox.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATGearbox.cs @@ -341,6 +341,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl if (response is ResponseGearShift) { //RequestAfterGearshift = false; } + response.GearboxInputSpeed = inAngularVelocity; + return response; } var retVal = NextComponent.Request(absTime, dt, inTorque, inAngularVelocity, dryRun); @@ -350,6 +352,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl retVal = new ResponseGearShift { Source = this }; //RequestAfterGearshift = false; } + retVal.GearboxInputSpeed = inAngularVelocity; return retVal; } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/BusAuxiliariesAdapter.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/BusAuxiliariesAdapter.cs index d4ca2148cf..6ccde68520 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/BusAuxiliariesAdapter.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/BusAuxiliariesAdapter.cs @@ -96,14 +96,12 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl if (AdditionalAux != null) { AdditionalAux.Initialize(torque, angularSpeed); } - PreviousState.PowerDemand = GetBusAuxPowerDemand(0.SI<Second>(), 1.SI<Second>(), torque, torque, angularSpeed); + PreviousState.PowerDemand = GetBusAuxPowerDemand(0.SI<Second>(), 1.SI<Second>(), torque, angularSpeed); return PreviousState.PowerDemand / angularSpeed; } - public NewtonMeter TorqueDemand( - Second absTime, Second dt, NewtonMeter torquePowerTrain, NewtonMeter torqueEngine, - PerSecond angularSpeed, bool dryRun = false) + public NewtonMeter TorqueDemand(Second absTime, Second dt, NewtonMeter torquePowerTrain, PerSecond angularSpeed, bool dryRun = false) { CurrentState.AngularSpeed = angularSpeed; CurrentState.dt = dt; @@ -113,7 +111,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl signals.EngineStopped = false; signals.VehicleStopped = false; - CurrentState.PowerDemand = GetBusAuxPowerDemand(absTime, dt, torquePowerTrain, torqueEngine, angularSpeed, dryRun); + CurrentState.PowerDemand = GetBusAuxPowerDemand(absTime, dt, torquePowerTrain, angularSpeed, dryRun); var avgAngularSpeed = (CurrentState.AngularSpeed + PreviousState.AngularSpeed) / 2.0; return CurrentState.PowerDemand / avgAngularSpeed; @@ -124,7 +122,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var signals = Auxiliaries.Signals; signals.EngineStopped = false; signals.VehicleStopped = false; - var retVal = GetBusAuxPowerDemand(time, simulationInterval, 0.SI<NewtonMeter>(), 0.SI<NewtonMeter>(), engineSpeed, true); + var retVal = GetBusAuxPowerDemand(time, simulationInterval, 0.SI<NewtonMeter>(), engineSpeed, true); if (!SmartElectricSystem) { return retVal; @@ -154,7 +152,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl signals.VehicleStopped = false; var busAuxPowerDemand = GetBusAuxPowerDemand( - absTime, dt, 0.SI<NewtonMeter>(), 0.SI<NewtonMeter>(), DataBus.EngineIdleSpeed); + absTime, dt, 0.SI<NewtonMeter>(), DataBus.EngineIdleSpeed); AdditionalAux = conventionalAux; CurrentState.PowerDemand = ((AdditionalAux?.PowerDemandEngineOn(absTime, dt, DataBus.EngineIdleSpeed) ?? 0.SI<Watt>()) + @@ -166,7 +164,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl signals.VehicleStopped = DataBus.VehicleStopped; busAuxPowerDemand = GetBusAuxPowerDemand( - absTime, dt, 0.SI<NewtonMeter>(), 0.SI<NewtonMeter>(), DataBus.EngineIdleSpeed); + absTime, dt, 0.SI<NewtonMeter>(), DataBus.EngineIdleSpeed); AdditionalAux = conventionalAux; return EngineStopStartUtilityFactor * (busAuxPowerDemand + AdditionalAux?.PowerDemandEngineOff(absTime, dt)); @@ -231,9 +229,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl CurrentState = new BusAuxState(); } - protected virtual Watt GetBusAuxPowerDemand( - Second absTime, Second dt, NewtonMeter torquePowerTrain, NewtonMeter torqueEngine, - PerSecond angularSpeed, bool dryRun = false) + protected virtual Watt GetBusAuxPowerDemand(Second absTime, Second dt, NewtonMeter torquePowerTrain, PerSecond angularSpeed, bool dryRun = false) { Auxiliaries.ResetCalculations(); @@ -248,7 +244,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl signals.PreExistingAuxPower = AdditionalAux != null - ? AdditionalAux.TorqueDemand(absTime, dt, torquePowerTrain, torqueEngine, angularSpeed, dryRun) * avgAngularSpeed + ? AdditionalAux.TorqueDemand(absTime, dt, torquePowerTrain, angularSpeed, dryRun) * avgAngularSpeed : 0.SI<Watt>(); var drivetrainPower = torquePowerTrain * avgAngularSpeed; diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs index 88a9cc41e2..3ea854218a 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs @@ -100,11 +100,25 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl return ModelData.FullLoadCurves[DataBus.Gear].FullLoadStationaryTorque(angularSpeed) * angularSpeed; } + public Watt EngineDynamicFullLoadPower(PerSecond avgEngineSpeed, Second dt) + { + return ComputeFullLoadPower( + avgEngineSpeed, ModelData.FullLoadCurves[DataBus.Gear].FullLoadStationaryTorque(avgEngineSpeed), dt, true); + } + public Watt EngineDragPower(PerSecond angularSpeed) { return ModelData.FullLoadCurves[DataBus.Gear].DragLoadStationaryPower(angularSpeed); } + public Watt EngineAuxDemand(PerSecond avgEngineSpeed, Second dt) + { + return EngineAux == null + ? 0.SI<Watt>() + : EngineAux.TorqueDemand( + 0.SI<Second>(), dt, 0.SI<NewtonMeter>(), avgEngineSpeed, true) * avgEngineSpeed; + } + public PerSecond EngineIdleSpeed { get { return ModelData.IdleSpeed; } @@ -194,8 +208,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var auxTorqueDemand = EngineAux == null ? 0.SI<NewtonMeter>() - : EngineAux.TorqueDemand(absTime, dt, torqueOut, - torqueOut + inertiaTorqueLoss, angularVelocity, dryRun); + : EngineAux.TorqueDemand(absTime, dt, torqueOut, angularVelocity, dryRun); // compute the torque the engine has to provide. powertrain + aux + its own inertia var totalTorqueDemand = torqueOut + auxTorqueDemand + inertiaTorqueLoss; diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs index 56ede55d48..d8d24b3db4 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs @@ -39,6 +39,8 @@ using TUGraz.VectoCore.Models.Connector.Ports.Impl; using TUGraz.VectoCore.Models.Simulation; using TUGraz.VectoCore.Models.Simulation.Data; using TUGraz.VectoCore.Models.Simulation.DataBus; +using TUGraz.VectoCore.Models.Simulation.Impl; +using TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox; using TUGraz.VectoCore.OutputData; using TUGraz.VectoCore.Utils; using DriverData = TUGraz.VectoCore.Models.SimulationComponent.Data.DriverData; @@ -421,16 +423,27 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl OperatingPoint searchedOperatingPoint; try { - searchedOperatingPoint = SearchOperatingPoint(absTime, requestedOperatingPoint.SimulationDistance, + searchedOperatingPoint = SearchOperatingPoint( + absTime, requestedOperatingPoint.SimulationDistance, gradient, requestedOperatingPoint.Acceleration, initialResponse, coastingOrRoll: true); } catch (VectoEngineSpeedTooLowException) { // in case of an exception during search the engine-speed got too low - gear disengaged --> try again with disengaged gear. - searchedOperatingPoint = SearchOperatingPoint(absTime, requestedOperatingPoint.SimulationDistance, + searchedOperatingPoint = SearchOperatingPoint( + absTime, requestedOperatingPoint.SimulationDistance, gradient, requestedOperatingPoint.Acceleration, initialResponse, coastingOrRoll: true); } + if (searchedOperatingPoint == null && DataBus.GearboxType.AutomaticTransmission()) { + // we end up here if no valid operating point for the engine and torque converter can be found. + // a likely reason is that the torque converter opereating point 'jumps' between two different operating points + // or that no valid operating point can be found by reverse calcualtion. This method is a kind of fal-back + // solution where a torque converter operating point is searched by forward calculation first and then the remaining + // powertrain is adjusted to this operating point. + searchedOperatingPoint = SetTCOperatingPointATGbxCoastOrRoll(absTime, gradient, requestedOperatingPoint, initialResponse as ResponseDryRun); + } + if (!ds.IsEqual(searchedOperatingPoint.SimulationDistance)) { // vehicle is at low speed, coasting would lead to stop before ds is reached: reduce simulated distance to stop distance. Log.Debug( @@ -495,6 +508,148 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl return response; } + // Fallback solution for calculating operating point with TC in semi-forward way. + private OperatingPoint SetTCOperatingPointATGbxCoastOrRoll(Second absTime, Radian gradient, OperatingPoint operatingPoint, ResponseDryRun dryRunResp) + { + var tc = DataBus.TorqueConverter; + if (tc == null) { + throw new VectoException("NO TorqueConverter Available!"); + } + + if (dryRunResp == null) { + throw new VectoException("dry-run response expected!"); + } + + + // first attempt: set TC to an input speed slightly above idle speed + // calculate TC opPt using n_in and n_out, estimate ICE max and drag torque. + // if ICE torque is within valid range, search an acceleration that results in the required + // out-torque at the torque converter + var engineSpeed = DataBus.EngineIdleSpeed * 1.01; + var tcOp = EstimateTCOpPoint(operatingPoint, dryRunResp, engineSpeed, tc); + + if (tcOp.Item1.Item2.IsBetween(tcOp.Item2, tcOp.Item3)) { + if (!dryRunResp.TorqueConverterOperatingPoint.OutTorque.IsEqual(tcOp.Item1.Item1.OutTorque)) { + tc.SetOperatingPoint = tcOp.Item1.Item1; + } + try { + var acceleration = SearchAccelerationFixedTC(absTime, gradient, operatingPoint, tcOp.Item1, dryRunResp); + return ComputeTimeInterval(acceleration, operatingPoint.SimulationDistance); + } catch (Exception e) { + Log.Error(e, "Failed to find acceleration for tc operating point! absTime: {0}", absTime); + throw; + } + } + + + // Attempt 2: search for an input speed (ICE speed) so that a valid operating point for + // the torque converter and the engine are found. Estimate max torque, drag torque. calculate delta + // based on over-/underload of torque and too high or too low engine speed + PerSecond nextICESpeed; + try { + nextICESpeed = SearchAlgorithm.Search( + engineSpeed, GetTCDelta(tcOp.Item1, tcOp.Item2, tcOp.Item3), engineSpeed * 0.1, + getYValue: tOp => { + var t = (Tuple<Tuple<TorqueConverterOperatingPoint, NewtonMeter>, NewtonMeter, NewtonMeter>)tOp; + return GetTCDelta(t.Item1, t.Item2, t.Item3); + }, + evaluateFunction: engSpeed => { return EstimateTCOpPoint(operatingPoint, dryRunResp, engSpeed, tc); }, + criterion: tOp => { + var t = (Tuple<Tuple<TorqueConverterOperatingPoint, NewtonMeter>, NewtonMeter, NewtonMeter>)tOp; + return GetTCDelta(t.Item1, t.Item2, t.Item3).Value(); + }); + } catch (Exception e) { + Log.Error(e, "Failed to find engine speed for valid torque converter operating point! absTime: {0}", absTime); + throw; + } + + // a suitable engine sped was found - search acceleration to match TC out-torque + try { + tcOp = EstimateTCOpPoint(operatingPoint, dryRunResp, nextICESpeed, tc); + tc.SetOperatingPoint = tcOp.Item1.Item1; + + var acceleration = SearchAccelerationFixedTC(absTime, gradient, operatingPoint, tcOp.Item1, dryRunResp); + + return ComputeTimeInterval(acceleration, operatingPoint.SimulationDistance); + } catch (Exception e) { + Log.Error(e, "Failed to find acceleration for tc operating point! absTime: {0}", absTime); + throw; + } + + //return null; + } + + // estimate a torque converter operating point via forward calculation for a certain engine speed. + // furthermore, estimates the max/min torque at ICE out-shaft including estimates for ICE inertia & aux torque + private Tuple<Tuple<TorqueConverterOperatingPoint, NewtonMeter>, NewtonMeter, NewtonMeter> EstimateTCOpPoint( + OperatingPoint operatingPoint, IResponse response, PerSecond engSpeed, ITorqueConverterControl tc) + { + var avgICDSpeed = (DataBus.EngineSpeed + engSpeed) / 2.0; + var drTq = (DataBus.EngineDragPower(avgICDSpeed)) / avgICDSpeed; + var maxTq = DataBus.EngineDynamicFullLoadPower(avgICDSpeed, operatingPoint.SimulationInterval) / + avgICDSpeed; + var inTq = Formulas.InertiaPower( + engSpeed, DataBus.EngineSpeed, + (DataBus as VehicleContainer)?.RunData.EngineData.Inertia ?? 0.SI<KilogramSquareMeter>(), + operatingPoint.SimulationInterval) / avgICDSpeed; + var auxTq = DataBus.EngineAuxDemand(avgICDSpeed, operatingPoint.SimulationInterval) / avgICDSpeed; + + return Tuple.Create( + tc.CalculateOperatingPoint(engSpeed, response.GearboxInputSpeed), drTq - inTq - auxTq, maxTq - inTq - auxTq); + } + + + // Search vehicle acceleration to match the torque converter out-torque for a fixed TC opPt + private MeterPerSquareSecond SearchAccelerationFixedTC( + Second absTime, Radian gradient, OperatingPoint operatingPoint, Tuple<TorqueConverterOperatingPoint, NewtonMeter> tcOp, ResponseDryRun dryRun) + { + var acceleration = SearchAlgorithm.Search( + operatingPoint.Acceleration, tcOp.Item1.OutTorque - dryRun.TorqueConverterTorqueDemand, + Constants.SimulationSettings.OperatingPointInitialSearchIntervalAccelerating, + getYValue: resp => { + var r = (ResponseDryRun)resp; + return tcOp.Item1.OutTorque - r.TorqueConverterTorqueDemand; + }, + evaluateFunction: + acc => { + var tmp = ComputeTimeInterval(acc, operatingPoint.SimulationDistance); + if (tmp.SimulationInterval.IsEqual(0.SI<Second>(), 1e-9.SI<Second>())) { + throw new VectoSearchAbortedException( + "next TimeInterval is 0. a: {0}, v: {1}, dt: {2}", acc, + DataBus.VehicleSpeed, tmp.SimulationInterval); + } + + DriverAcceleration = acc; + var tmpResponse = NextComponent.Request(absTime, tmp.SimulationInterval, acc, gradient, true); + tmpResponse.OperatingPoint = tmp; + return tmpResponse; + }, + criterion: resp => { + var r = (ResponseDryRun)resp; + + return (tcOp.Item1.OutTorque - r.TorqueConverterTorqueDemand).Value(); + } + ); + return acceleration; + } + + private NewtonMeter GetTCDelta(Tuple<TorqueConverterOperatingPoint, NewtonMeter> tqOp, NewtonMeter dragTorque, NewtonMeter maxTorque) + { + var deltaSpeed = VectoMath.Min(0.RPMtoRad(), tqOp.Item1.InAngularVelocity - DataBus.EngineIdleSpeed) + + VectoMath.Max(0.RPMtoRad(), tqOp.Item1.InAngularVelocity - DataBus.EngineRatedSpeed); + var tqDiff = 0.SI<NewtonMeter>(); + if (tqOp.Item2.IsSmaller(dragTorque)) { + tqDiff = tqOp.Item2 - dragTorque; + + } + + if (tqOp.Item2.IsGreater(maxTorque)) { + tqDiff = tqOp.Item2 - maxTorque; + } + return ((tqDiff.Value() * tqDiff.Value()) + (deltaSpeed.Value() * deltaSpeed.Value())).SI<NewtonMeter>(); + + } + public IResponse DrivingActionBrake(Second absTime, Meter ds, MeterPerSecond nextTargetSpeed, Radian gradient, IResponse previousResponse = null, Meter targetDistance = null, DrivingAction? overrideAction = null) { DrivingAction = overrideAction ?? DrivingAction.Brake; @@ -559,10 +714,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl } catch (VectoSearchAbortedException vsa) { Log.Warn("Search braking power aborted {0}", vsa); if (DataBus.GearboxType.AutomaticTransmission()) { - (DataBus as IGearboxControl).DisengageGearbox = true; - operatingPoint = SearchBrakingPower( - absTime, operatingPoint.SimulationDistance, gradient, - operatingPoint.Acceleration, response); + operatingPoint = SetTCOperatingPointATGbxBraking(absTime, gradient, operatingPoint, response); } } if (!ds.IsEqual(operatingPoint.SimulationDistance, 1E-15.SI<Meter>())) { @@ -666,6 +818,37 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl return retVal; } + private OperatingPoint SetTCOperatingPointATGbxBraking( + Second absTime, Radian gradient, OperatingPoint operatingPoint, IResponse response) + { + var tc = DataBus.TorqueConverter; + if (tc == null) { + throw new VectoException("NO TorqueConverter Available!"); + } + + var avgEngineSpeed = (DataBus.EngineSpeed + DataBus.EngineIdleSpeed) / 2.0; + var dragTorque = (DataBus.EngineDragPower(avgEngineSpeed)) / avgEngineSpeed; + var maxTorque = DataBus.EngineDynamicFullLoadPower(avgEngineSpeed, operatingPoint.SimulationInterval) / avgEngineSpeed; + var inertiaTq = Formulas.InertiaPower( + DataBus.EngineIdleSpeed, DataBus.EngineSpeed, + (DataBus as VehicleContainer)?.RunData.EngineData.Inertia ?? 0.SI<KilogramSquareMeter>(), + operatingPoint.SimulationInterval) / avgEngineSpeed; + var auxTqDemand = DataBus.EngineAuxDemand(avgEngineSpeed, operatingPoint.SimulationInterval) / avgEngineSpeed; + //var maxTorque = DataBus.e + var tcOp = tc.CalculateOperatingPoint(DataBus.EngineIdleSpeed * 1.01, response.GearboxInputSpeed); + + if (!tcOp.Item2.IsBetween(dragTorque - inertiaTq - auxTqDemand, maxTorque - inertiaTq - auxTqDemand)) { + + (DataBus as IGearboxControl).DisengageGearbox = true; + operatingPoint = SearchBrakingPower( + absTime, operatingPoint.SimulationDistance, gradient, + operatingPoint.Acceleration, response); + return operatingPoint; + } + + return null; + } + private OperatingPoint AdaptDecelerationToTargetDistance(Meter ds, MeterPerSecond nextTargetSpeed, Meter targetDistance, MeterPerSquareSecond acceleration) { @@ -843,6 +1026,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var delta = origDelta; try { + var nanCount = 0; retVal.Acceleration = SearchAlgorithm.Search(acceleration, delta, Constants.SimulationSettings.OperatingPointInitialSearchIntervalAccelerating, getYValue: response => { @@ -893,6 +1077,13 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl abortCriterion: (response, cnt) => { var r = (ResponseDryRun)response; + if (DataBus.GearboxType.AutomaticTransmission() && + r.DeltaDragLoad.Value().IsSmallerOrEqual(-double.MaxValue / 20)) { + nanCount++; + } + if (nanCount > 10) { + return true; + } return r != null && !actionRoll && !ds.IsEqual(r.OperatingPoint.SimulationDistance); }); return ComputeTimeInterval(retVal.Acceleration, retVal.SimulationDistance); diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/EngineAuxiliary.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/EngineAuxiliary.cs index 48717f6272..d70ba4e3c3 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/EngineAuxiliary.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/EngineAuxiliary.cs @@ -136,12 +136,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl /// <param name="absTime"></param> /// <param name="dt"></param> /// <param name="torquePowerTrain"></param> - /// <param name="torqueEngine"></param> /// <param name="angularSpeed"></param> /// <param name="dryRun"></param> /// <returns></returns> - public NewtonMeter TorqueDemand(Second absTime, Second dt, NewtonMeter torquePowerTrain, NewtonMeter torqueEngine, - PerSecond angularSpeed, bool dryRun = false) + public NewtonMeter TorqueDemand(Second absTime, Second dt, NewtonMeter torquePowerTrain, PerSecond angularSpeed, bool dryRun = false) { var avgAngularSpeed = PreviousState.AngularSpeed != null ? (angularSpeed + PreviousState.AngularSpeed) / 2.0 diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/EngineOnlyCombustionEngine.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/EngineOnlyCombustionEngine.cs index 77252b159d..86946b4051 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/EngineOnlyCombustionEngine.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/EngineOnlyCombustionEngine.cs @@ -61,8 +61,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var auxTorqueDemand = EngineAux == null ? 0.SI<NewtonMeter>() - : EngineAux.TorqueDemand(absTime, dt, CurrentState.EngineTorqueOut, - CurrentState.EngineTorqueOut + CurrentState.InertiaTorqueLoss, angularVelocity, dryRun); + : EngineAux.TorqueDemand(absTime, dt, CurrentState.EngineTorqueOut, angularVelocity, dryRun); var totalTorqueDemand = CurrentState.EngineTorqueOut + auxTorqueDemand + CurrentState.InertiaTorqueLoss; CurrentState.EngineTorque = totalTorqueDemand; diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/TorqueConverter.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/TorqueConverter.cs index 0dc24b6d7c..efb7e558e5 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/TorqueConverter.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/TorqueConverter.cs @@ -47,7 +47,7 @@ using TUGraz.VectoCore.OutputData; namespace TUGraz.VectoCore.Models.SimulationComponent.Impl { public class TorqueConverter : StatefulVectoSimulationComponent<TorqueConverter.TorqueConverterComponentState>, - ITnInPort, ITnOutPort + ITnInPort, ITnOutPort, ITorqueConverterControl { protected readonly IGearboxInfo Gearbox; protected readonly IShiftStrategy ShiftStrategy; @@ -105,7 +105,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var inTorque = CalculateAverageInTorque(operatingPoint); if (dryRun) { - return HandleDryRun(absTime, dt, outTorque, outAngularVelocity, inTorque, operatingPoint); + var retValD = HandleDryRun(absTime, dt, outTorque, outAngularVelocity, inTorque, operatingPoint); + retValD.TorqueConverterTorqueDemand = outTorque; + return retValD; } // normal request @@ -127,7 +129,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl CurrentState.IgnitionOn = DataBus.IgnitionOn; var retVal = NextComponent.Request(absTime, dt, inTorque, operatingPoint.InAngularVelocity); - + //retVal.TorqueConverterOperatingPoint = operatingPoint; // check if shift is required var ratio = Gearbox.GetGearData(Gearbox.Gear).TorqueConverterRatio; if (!Gearbox.DisengageGearbox && absTime > DataBus.LastShift && retVal is ResponseSuccess) { @@ -156,7 +158,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl return inTorque; } - private IResponse HandleDryRun( + private ResponseDryRun HandleDryRun( Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity, NewtonMeter inTorque, TorqueConverterOperatingPoint operatingPoint) { @@ -334,6 +336,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl NewtonMeter outTorque, PerSecond outAngularVelocity) { + if (SetOperatingPoint != null) { + return SetOperatingPoint; + } var operatingPointList = ModelData.FindOperatingPoint(outTorque, outAngularVelocity, DataBus.EngineIdleSpeed); if (operatingPointList.Count == 0) { Log.Debug("TorqueConverter: Failed to find torque converter operating point, fallback: creeping"); @@ -409,6 +414,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl protected override void DoCommitSimulationStep() { + SetOperatingPoint = null; AdvanceState(); } @@ -425,5 +431,19 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl public TorqueConverterOperatingPoint OperatingPoint; public bool IgnitionOn; } + + #region Implementation of ITorqueConverterControl + + public Tuple<TorqueConverterOperatingPoint, NewtonMeter> CalculateOperatingPoint(PerSecond inSpeed, PerSecond outSpeed) + { + var tcOps = ModelData.FindOperatingPoint(inSpeed, outSpeed); + + return Tuple.Create(tcOps, CalculateAverageInTorque(tcOps)); + } + + public TorqueConverterOperatingPoint SetOperatingPoint { get; set; } + + + #endregion } } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/VTPCombustionEngine.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/VTPCombustionEngine.cs index 2644fa0286..601940a451 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/VTPCombustionEngine.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/VTPCombustionEngine.cs @@ -96,8 +96,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl } var auxTorqueDemand = EngineAux == null ? 0.SI<NewtonMeter>() - : EngineAux.TorqueDemand(absTime, dt, torqueOut, - torqueOut + inertiaTorqueLoss, avgEngineSpeed, dryRun); + : EngineAux.TorqueDemand(absTime, dt, torqueOut, avgEngineSpeed, dryRun); // compute the torque the engine has to provide. powertrain + aux + its own inertia var totalTorqueDemand = torqueOut + auxTorqueDemand + inertiaTorqueLoss; diff --git a/VectoCore/VectoCoreTest/Integration/BusAuxiliaries/AuxDemandTest.cs b/VectoCore/VectoCoreTest/Integration/BusAuxiliaries/AuxDemandTest.cs index b48074fe15..d8a869a134 100644 --- a/VectoCore/VectoCoreTest/Integration/BusAuxiliaries/AuxDemandTest.cs +++ b/VectoCore/VectoCoreTest/Integration/BusAuxiliaries/AuxDemandTest.cs @@ -71,8 +71,7 @@ namespace TUGraz.VectoCore.Tests.Integration.BusAuxiliaries var engineSpeed = engineSpeedRpm.RPMtoRad(); busAux.Initialize(engineDrivelinePower / engineSpeed, engineSpeed); - var torque = busAux.TorqueDemand(0.SI<Second>(), 1.SI<Second>(), engineDrivelinePower / engineSpeed, - (internalPower * 1000).SI<Watt>() / engineSpeed, engineSpeed); + var torque = busAux.TorqueDemand(0.SI<Second>(), 1.SI<Second>(), engineDrivelinePower / engineSpeed, engineSpeed); Assert.AreEqual(expectedPowerDemand, (torque * engineSpeed).Value(), 1e-2); } @@ -94,8 +93,7 @@ namespace TUGraz.VectoCore.Tests.Integration.BusAuxiliaries var modalData = new MockModalDataContainer(); for (int i = 0; i < 10; i++) { - var torque = busAux.TorqueDemand(0.SI<Second>(), 1.SI<Second>(), engineDrivelinePower / engineSpeed, - (internalPower * 1000).SI<Watt>() / engineSpeed, engineSpeed); + var torque = busAux.TorqueDemand(0.SI<Second>(), 1.SI<Second>(), engineDrivelinePower / engineSpeed, engineSpeed); Assert.AreEqual(6087.03221, (torque * engineSpeed).Value(), 1e-3); busAux.DoWriteModalResults(0.SI<Second>(), 1.SI<Second>(), modalData); busAux.DoCommitSimulationStep(); @@ -107,8 +105,7 @@ namespace TUGraz.VectoCore.Tests.Integration.BusAuxiliaries internalPower = -20; for (int i = 0; i < 10; i++) { - var torque = busAux.TorqueDemand(0.SI<Second>(), 1.SI<Second>(), engineDrivelinePower / engineSpeed, - (internalPower * 1000).SI<Watt>() / engineSpeed, engineSpeed); + var torque = busAux.TorqueDemand(0.SI<Second>(), 1.SI<Second>(), engineDrivelinePower / engineSpeed, engineSpeed); Assert.AreEqual(8954.1429, (torque * engineSpeed).Value(), 1e-3); busAux.DoWriteModalResults(0.SI<Second>(), 1.SI<Second>(), modalData); busAux.DoCommitSimulationStep(); @@ -120,8 +117,7 @@ namespace TUGraz.VectoCore.Tests.Integration.BusAuxiliaries internalPower = 148; for (int i = 0; i < 10; i++) { - var torque = busAux.TorqueDemand(0.SI<Second>(), 1.SI<Second>(), engineDrivelinePower / engineSpeed, - (internalPower * 1000).SI<Watt>() / engineSpeed, engineSpeed); + var torque = busAux.TorqueDemand(0.SI<Second>(), 1.SI<Second>(), engineDrivelinePower / engineSpeed, engineSpeed); Assert.AreEqual(6087.03221, (torque * engineSpeed).Value(), 1e-3); busAux.DoWriteModalResults(0.SI<Second>(), 1.SI<Second>(), modalData); busAux.DoCommitSimulationStep(); diff --git a/VectoCore/VectoCoreTest/Integration/BusAuxiliaries/BusAdapterTest.cs b/VectoCore/VectoCoreTest/Integration/BusAuxiliaries/BusAdapterTest.cs index 5caa081141..44f9d40c8e 100644 --- a/VectoCore/VectoCoreTest/Integration/BusAuxiliaries/BusAdapterTest.cs +++ b/VectoCore/VectoCoreTest/Integration/BusAuxiliaries/BusAdapterTest.cs @@ -70,8 +70,7 @@ namespace TUGraz.VectoCore.Tests.Integration.BusAuxiliaries var engineSpeed = engineSpeedRpm.RPMtoRad(); busAux.Initialize(engineDrivelinePower / engineSpeed, engineSpeed); - var torque = busAux.TorqueDemand(0.SI<Second>(), 1.SI<Second>(), engineDrivelinePower / engineSpeed, - (internalPower * 1000).SI<Watt>() / engineSpeed, engineSpeed); + var torque = busAux.TorqueDemand(0.SI<Second>(), 1.SI<Second>(), engineDrivelinePower / engineSpeed, engineSpeed); Assert.AreEqual(expectedPowerDemand, (torque * engineSpeed).Value(), 1e-2); } @@ -103,8 +102,7 @@ namespace TUGraz.VectoCore.Tests.Integration.BusAuxiliaries var engineSpeed = engineSpeedRpm.RPMtoRad(); busAux.Initialize(engineDrivelinePower / engineSpeed, engineSpeed); - var torque = busAux.TorqueDemand(0.SI<Second>(), 1.SI<Second>(), engineDrivelinePower / engineSpeed, - (internalPower * 1000).SI<Watt>() / engineSpeed, engineSpeed); + var torque = busAux.TorqueDemand(0.SI<Second>(), 1.SI<Second>(), engineDrivelinePower / engineSpeed, engineSpeed); Assert.AreEqual(expectedPowerDemand, (torque * engineSpeed).Value(), 1e-2); } @@ -127,8 +125,7 @@ namespace TUGraz.VectoCore.Tests.Integration.BusAuxiliaries var engineSpeed = engineSpeedRpm.RPMtoRad(); busAux.Initialize(engineDrivelinePower / engineSpeed, engineSpeed); - var torque = busAux.TorqueDemand(0.SI<Second>(), 1.SI<Second>(), engineDrivelinePower / engineSpeed, - (internalPower * 1000).SI<Watt>() / engineSpeed, engineSpeed); + var torque = busAux.TorqueDemand(0.SI<Second>(), 1.SI<Second>(), engineDrivelinePower / engineSpeed, engineSpeed); Assert.AreEqual(expectedPowerDemand, (torque * engineSpeed).Value(), 1e-3); } @@ -156,8 +153,7 @@ namespace TUGraz.VectoCore.Tests.Integration.BusAuxiliaries var engineSpeed = engineSpeedRpm.RPMtoRad(); busAux.Initialize(engineDrivelinePower / engineSpeed, engineSpeed); - var torque = busAux.TorqueDemand(0.SI<Second>(), 1.SI<Second>(), engineDrivelinePower / engineSpeed, - (internalPower).SI<Watt>() / engineSpeed, engineSpeed); + var torque = busAux.TorqueDemand(0.SI<Second>(), 1.SI<Second>(), engineDrivelinePower / engineSpeed, engineSpeed); var row = table.NewRow(); row["engineSpeed"] = engineSpeed.Value() / Constants.RPMToRad; diff --git a/VectoCore/VectoCoreTest/Models/Simulation/AuxTests.cs b/VectoCore/VectoCoreTest/Models/Simulation/AuxTests.cs index 70101f15f5..f8142faa21 100644 --- a/VectoCore/VectoCoreTest/Models/Simulation/AuxTests.cs +++ b/VectoCore/VectoCoreTest/Models/Simulation/AuxTests.cs @@ -108,7 +108,7 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation aux.Initialize(torque, speed); for (var i = 0; i < 11; i++) { - aux.TorqueDemand(t, dt, torque, torque, speed); + aux.TorqueDemand(t, dt, torque, speed); modData[ModalResultField.dist] = i.SI<Meter>(); modData[ModalResultField.P_ice_out] = 0.SI<Watt>(); modData[ModalResultField.acc] = 0.SI<MeterPerSquareSecond>(); @@ -144,19 +144,19 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation var t = 0.SI<Second>(); aux.Initialize(torque, speed); - var auxDemand = aux.TorqueDemand(t, t, torque, torque, speed); + var auxDemand = aux.TorqueDemand(t, t, torque, speed); AssertHelper.AreRelativeEqual(constPower / speed, auxDemand); speed = 2358.RPMtoRad(); torque = 1500.SI<NewtonMeter>(); aux.Initialize(torque, speed); - auxDemand = aux.TorqueDemand(t, t, torque, torque, speed); + auxDemand = aux.TorqueDemand(t, t, torque, speed); AssertHelper.AreRelativeEqual(constPower / speed, auxDemand); speed = 1500.RPMtoRad(); torque = 1500.SI<NewtonMeter>(); aux.Initialize(torque, speed); - auxDemand = aux.TorqueDemand(t, t, torque, torque, speed); + auxDemand = aux.TorqueDemand(t, t, torque, speed); AssertHelper.AreRelativeEqual(constPower / speed, auxDemand); } @@ -182,7 +182,7 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation var expected = new[] { 6100, 3100, 2300, 4500, 6100 }; foreach (var e in expected) { aux.Initialize(torque, speed); - var auxDemand = aux.TorqueDemand(t, t, torque, torque, speed); + var auxDemand = aux.TorqueDemand(t, t, torque, speed); AssertHelper.AreRelativeEqual((e.SI<Watt>() / speed).Value(), auxDemand.Value()); cycle.CommitSimulationStep(t, t, null); @@ -246,7 +246,7 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation foreach (var e in expected) { aux.Initialize(torque, speed); - var auxDemand = aux.TorqueDemand(t, t, torque, torque, speed); + var auxDemand = aux.TorqueDemand(t, t, torque, speed); AssertHelper.AreRelativeEqual((e.SI<Watt>() / speed).Value(), auxDemand.Value()); @@ -307,7 +307,7 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation foreach (var e in expected) { aux.Initialize(torque, speed); - var auxDemand = aux.TorqueDemand(t, t, torque, torque, speed); + var auxDemand = aux.TorqueDemand(t, t, torque, speed); AssertHelper.AreRelativeEqual((e.SI<Watt>() / speed).Value(), auxDemand); diff --git a/VectoCore/VectoCoreTest/Models/SimulationComponent/ClutchTest.cs b/VectoCore/VectoCoreTest/Models/SimulationComponent/ClutchTest.cs index e6bd409937..9513779c45 100644 --- a/VectoCore/VectoCoreTest/Models/SimulationComponent/ClutchTest.cs +++ b/VectoCore/VectoCoreTest/Models/SimulationComponent/ClutchTest.cs @@ -171,11 +171,21 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent throw new System.NotImplementedException(); } + public Watt EngineDynamicFullLoadPower(PerSecond avgEngineSpeed, Second dt) + { + throw new System.NotImplementedException(); + } + public Watt EngineDragPower(PerSecond angularSpeed) { throw new System.NotImplementedException(); } + public Watt EngineAuxDemand(PerSecond avgEngineSpeed, Second dt) + { + throw new System.NotImplementedException(); + } + public PerSecond EngineIdleSpeed { get; set; } public PerSecond EngineRatedSpeed { get; set; } public PerSecond EngineN95hSpeed { get; set; } diff --git a/VectoCore/VectoCoreTest/Utils/MockPorts.cs b/VectoCore/VectoCoreTest/Utils/MockPorts.cs index df75503340..e954122cb7 100644 --- a/VectoCore/VectoCoreTest/Utils/MockPorts.cs +++ b/VectoCore/VectoCoreTest/Utils/MockPorts.cs @@ -112,11 +112,21 @@ namespace TUGraz.VectoCore.Tests.Utils return 2300.SI<NewtonMeter>() * angularSpeed; } + public Watt EngineDynamicFullLoadPower(PerSecond avgEngineSpeed, Second dt) + { + throw new NotImplementedException(); + } + public Watt EngineDragPower(PerSecond angularSpeed) { return -1000.SI<NewtonMeter>() * angularSpeed; } + public Watt EngineAuxDemand(PerSecond avgEngineSpeed, Second dt) + { + throw new NotImplementedException(); + } + public PerSecond EngineIdleSpeed { get { return 560.RPMtoRad(); } diff --git a/VectoCore/VectoCoreTest/Utils/MockVehicleContainer.cs b/VectoCore/VectoCoreTest/Utils/MockVehicleContainer.cs index 4567f706bb..b80c9df46e 100644 --- a/VectoCore/VectoCoreTest/Utils/MockVehicleContainer.cs +++ b/VectoCore/VectoCoreTest/Utils/MockVehicleContainer.cs @@ -53,6 +53,7 @@ namespace TUGraz.VectoCore.Tests.Utils public List<VectoSimulationComponent> Components = new List<VectoSimulationComponent>(); private Watt _axlegearLoss = 0.SI<Watt>(); private bool _clutchClosed = true; + private ITorqueConverterControl _torqueConverter; public IEngineInfo Engine { get; set; } @@ -80,6 +81,11 @@ namespace TUGraz.VectoCore.Tests.Utils public Second AbsTime { get; set; } + public ITorqueConverterControl TorqueConverter + { + get { return _torqueConverter; } + } + public Watt GearboxLoss() { throw new System.NotImplementedException(); @@ -100,11 +106,21 @@ namespace TUGraz.VectoCore.Tests.Utils return Engine.EngineStationaryFullPower(angularSpeed); } + public Watt EngineDynamicFullLoadPower(PerSecond avgEngineSpeed, Second dt) + { + throw new NotImplementedException(); + } + public Watt EngineDragPower(PerSecond angularSpeed) { return Engine.EngineStationaryFullPower(angularSpeed); } + public Watt EngineAuxDemand(PerSecond avgEngineSpeed, Second dt) + { + throw new NotImplementedException(); + } + public PerSecond EngineIdleSpeed { get { return Engine.EngineIdleSpeed; } -- GitLab