diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs index 193083b5fbe80c998718dc0d2d141f3f6ca65d50..d2857c0f6f44bfa4eb33a28f66c5c9211e11e5fc 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs @@ -178,7 +178,9 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter // powersplit transmission: torque converter already contains ratio and losses gearData.TorqueConverterRatio = 1; gearData.TorqueConverterGearLossMap = TransmissionLossMapReader.Create(1, 1, string.Format("TCGear {0}", i + 1)); - gearData.TorqueConverterShiftPolygon = gearbox.TorqueConverter.ShiftPolygon == null ? null : ShiftPolygonReader.Create(gearbox.TorqueConverter.ShiftPolygon); + gearData.TorqueConverterShiftPolygon = gearbox.TorqueConverter.ShiftPolygon == null + ? null + : ShiftPolygonReader.Create(gearbox.TorqueConverter.ShiftPolygon); } } if (gearbox.Type == GearboxType.ATSerial) { @@ -186,14 +188,18 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter // torqueconverter is active in first gear - duplicate ratio and lossmap for torque converter mode gearData.TorqueConverterRatio = gearData.Ratio; gearData.TorqueConverterGearLossMap = gearData.LossMap; - gearData.TorqueConverterShiftPolygon = gearbox.TorqueConverter.ShiftPolygon == null ? null : ShiftPolygonReader.Create(gearbox.TorqueConverter.ShiftPolygon); + gearData.TorqueConverterShiftPolygon = gearbox.TorqueConverter.ShiftPolygon == null + ? null + : ShiftPolygonReader.Create(gearbox.TorqueConverter.ShiftPolygon); } if (i == 1 && gearDifferenceRatio >= DeclarationData.Gearbox.TorqueConverterSecondGearThreshold) { // ratio between first and second gear is above threshold, torqueconverter is active in second gear as well // -> duplicate ratio and lossmap for torque converter mode, remove locked transmission for previous gear gearData.TorqueConverterRatio = gearData.Ratio; gearData.TorqueConverterGearLossMap = gearData.LossMap; - gearData.TorqueConverterShiftPolygon = gearbox.TorqueConverter.ShiftPolygon == null ? null : ShiftPolygonReader.Create(gearbox.TorqueConverter.ShiftPolygon); + gearData.TorqueConverterShiftPolygon = gearbox.TorqueConverter.ShiftPolygon == null + ? null + : ShiftPolygonReader.Create(gearbox.TorqueConverter.ShiftPolygon); // NOTE: the lower gear in 'gears' dictionary has index i !! gears[i].Ratio = double.NaN; gears[i].LossMap = null; @@ -326,8 +332,9 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter TransmissionType = pto.PTOTransmissionType, LossMap = PTOIdleLossMapReader.Create(pto.PTOLossMap), }; - if (pto.PTOCycle != null) + if (pto.PTOCycle != null) { ptoData.PTOCycle = DrivingCycleDataReader.ReadFromDataTable(pto.PTOCycle, CycleType.PTO, "PTO", false); + } return ptoData; } diff --git a/VectoCore/VectoCore/Models/Simulation/Data/ModalResult.cs b/VectoCore/VectoCore/Models/Simulation/Data/ModalResult.cs index 6eb1209f8030f558dd2bf3d5c085faf11856b50f..61d079f9ecf799f502912d33a8a823c85903d31f 100644 --- a/VectoCore/VectoCore/Models/Simulation/Data/ModalResult.cs +++ b/VectoCore/VectoCore/Models/Simulation/Data/ModalResult.cs @@ -308,6 +308,8 @@ namespace TUGraz.VectoCore.Models.Simulation.Data [ModalResultField(typeof(SI), caption: "P_eng_fcmap [kW]", outputFactor: 1e-3)] P_eng_fcmap, + [ModalResultField(typeof(SI), caption: "P_eng_full_stat [kW]", outputFactor: 1e-3)] P_eng_full_stat, + /// <summary> /// [kW] Power demand of Auxiliary with ID xxx. See also Aux Dialog and Driving Cycle. /// </summary> diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs index d8e4174e5e03903da4204ca1faffd13448e68714..2aadd1a4255694a7f9cec33fd0cd4e1c7c240181 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs @@ -353,6 +353,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl container[ModalResultField.T_eng_fcmap] = CurrentState.EngineTorque; container[ModalResultField.P_eng_full] = CurrentState.DynamicFullLoadTorque * avgEngineSpeed; + container[ModalResultField.P_eng_full_stat] = CurrentState.StationaryFullLoadTorque * avgEngineSpeed; container[ModalResultField.P_eng_drag] = CurrentState.FullDragTorque * avgEngineSpeed; container[ModalResultField.Tq_full] = CurrentState.DynamicFullLoadTorque; container[ModalResultField.Tq_drag] = CurrentState.FullDragTorque; @@ -436,12 +437,16 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var tStarPrev = pt1 * Math.Log(1.0 / (1 - powerRatio), Math.E).SI<Second>(); var tStar = tStarPrev + PreviousState.dt; dynFullPowerCalculated = stationaryFullLoadPower * (1 - Math.Exp((-tStar / pt1).Value())); + dynFullPowerCalculated = VectoMath.Max(PreviousState.EnginePower, dynFullPowerCalculated); } // new check in vecto 3.x (according to Martin Rexeis) if (dynFullPowerCalculated < StationaryIdleFullLoadPower) { dynFullPowerCalculated = StationaryIdleFullLoadPower; } + if (dynFullPowerCalculated > stationaryFullLoadPower) { + dynFullPowerCalculated = stationaryFullLoadPower; + } return dynFullPowerCalculated; } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/EngineOnlyCombustionEngine.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/EngineOnlyCombustionEngine.cs index f2f1dd9621e1412e961b0749431519229c6681e4..7c1f26b6f3de45b69c550f6be15c1ce07e8dad72 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/EngineOnlyCombustionEngine.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/EngineOnlyCombustionEngine.cs @@ -71,7 +71,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl CurrentState.EngineTorque = totalTorqueDemand; CurrentState.FullDragTorque = ModelData.FullLoadCurve.DragLoadStationaryTorque(avgEngineSpeed); - var dynamicFullLoadPower = ComputeFullLoadPower(angularVelocity, dt); + var dynamicFullLoadPower = ComputeFullLoadPower(avgEngineSpeed, dt); CurrentState.DynamicFullLoadTorque = dynamicFullLoadPower / avgEngineSpeed; ValidatePowerDemand(totalTorqueDemand); diff --git a/VectoCore/VectoCore/OutputData/ModalDataContainer.cs b/VectoCore/VectoCore/OutputData/ModalDataContainer.cs index d39c65fdac819c1f899015e02fb46ddb08276eb4..3b37f42b1696925df9fc52e85a5fc13ef49ebba3 100644 --- a/VectoCore/VectoCore/OutputData/ModalDataContainer.cs +++ b/VectoCore/VectoCore/OutputData/ModalDataContainer.cs @@ -129,6 +129,7 @@ namespace TUGraz.VectoCore.OutputData ModalResultField.Tq_drag, ModalResultField.P_eng_fcmap, ModalResultField.P_eng_full, + ModalResultField.P_eng_full_stat, ModalResultField.P_eng_drag, ModalResultField.P_eng_inertia, ModalResultField.P_eng_out, @@ -322,8 +323,9 @@ namespace TUGraz.VectoCore.OutputData var currentDt = row.Field<Second>((int)ModalResultField.simulationInterval); - if (row.Field<Meter>((int)ModalResultField.dist).IsSmaller(distance, 1e-3)) + if (row.Field<Meter>((int)ModalResultField.dist).IsSmaller(distance, 1e-3)) { LogManager.GetLogger(typeof(ModalData1HzFilter).FullName).Error("1Hz-Filter: distance must always be increasing."); + } // if a remainder and currentDt would exceed 1 second: take remainder and take current row to fill up to 1 second. if (remainingDt > 0 && remainingDt + currentDt >= 1) { @@ -333,8 +335,9 @@ namespace TUGraz.VectoCore.OutputData gearsList[gear] = gearsList.GetValueOrZero(gear) + dt; var a = (MeterPerSquareSecond)row[(int)ModalResultField.acc]; var ds = dt * v + a / 2 * dt * dt; - if (ds.IsSmaller(0)) + if (ds.IsSmaller(0)) { throw new VectoSimulationException("1Hz-Filter: simulation distance must not be negative."); + } absTime += dt; v += dt * a; distance += ds; @@ -365,8 +368,9 @@ namespace TUGraz.VectoCore.OutputData currentDt = currentDt - 1.SI<Second>(); var a = (MeterPerSquareSecond)row[(int)ModalResultField.acc]; var ds = v * dt + a / 2 * dt * dt; - if (ds.IsSmaller(0)) + if (ds.IsSmaller(0)) { throw new VectoSimulationException("1Hz-Filter: simulation distance must not be negative."); + } absTime += dt; v += a * dt; distance += ds; @@ -390,8 +394,9 @@ namespace TUGraz.VectoCore.OutputData gearsList[gear] = gearsList.GetValueOrZero(gear) + dt; var a = (MeterPerSquareSecond)row[(int)ModalResultField.acc]; var ds = v * dt + a / 2 * dt * dt; - if (ds.IsSmaller(0)) + if (ds.IsSmaller(0)) { throw new VectoSimulationException("1Hz-Filter: simulation distance must not be negative."); + } absTime += dt; v += a * dt; distance += ds; @@ -414,8 +419,9 @@ namespace TUGraz.VectoCore.OutputData var dt = remainingDt; var a = (MeterPerSquareSecond)last[(int)ModalResultField.acc]; var ds = v * dt + a / 2 * dt * dt; - if (ds.IsSmaller(0)) + if (ds.IsSmaller(0)) { throw new VectoSimulationException("1Hz-Filter: simulation distance must not be negative."); + } v += a * dt; distance += ds;