diff --git a/VECTO/Input Files/VectoJob.vb b/VECTO/Input Files/VectoJob.vb index 53ef93e5e9ab4cd03fec7539b95b3bc0a92227f0..339c0269969c3f37aacb7af53a5b61d3f5509904 100644 --- a/VECTO/Input Files/VectoJob.vb +++ b/VECTO/Input Files/VectoJob.vb @@ -129,7 +129,7 @@ Public Class VectoJob Public Function SaveFile() As Boolean Dim validationResults As IList(Of ValidationResult) = - Validate(If(Cfg.DeclMode, ExecutionMode.Declaration, ExecutionMode.Engineering), JobType, IEngineeringJobInputData_Vehicle.Components.ElectricMachines.Entries.FirstOrDefault()?.Position, Nothing, False) + Validate(If(Cfg.DeclMode, ExecutionMode.Declaration, ExecutionMode.Engineering), JobType, IEngineeringJobInputData_Vehicle?.Components.ElectricMachines.Entries.FirstOrDefault()?.Position, Nothing, False) If validationResults.Count > 0 Then Dim messages As IEnumerable(Of String) = diff --git a/VectoCommon/VectoCommon/Models/HybridStrategyResponse.cs b/VectoCommon/VectoCommon/Models/HybridStrategyResponse.cs index 644ea8cf6d04394a6380ec7f4421f0e58d38ca04..31645d5c81d8555ce5d44921c4b6ded8df891754 100644 --- a/VectoCommon/VectoCommon/Models/HybridStrategyResponse.cs +++ b/VectoCommon/VectoCommon/Models/HybridStrategyResponse.cs @@ -120,6 +120,16 @@ namespace TUGraz.VectoCommon.Models { retVal.Add("engine speed below downshift"); break; case HybridConfigurationIgnoreReason.NoResponseAvailable: return "no response available"; + + case HybridConfigurationIgnoreReason.BatteryBelowMinSoC: + retVal.Add("battery below MinSoC"); + break; + case HybridConfigurationIgnoreReason.BatteryAboveMaxSoc: + retVal.Add("battery above MaxSoC"); + break; + case HybridConfigurationIgnoreReason.BatterySoCTooLow: + retVal.Add("battery SoC too low"); + break; default: throw new ArgumentOutOfRangeException(nameof(x), x, null); } } diff --git a/VectoCore/VectoCore/Configuration/Constants.cs b/VectoCore/VectoCore/Configuration/Constants.cs index 02604d29985509944fca2d24ff761a5e45fc8247..74afa8c092ecbcad600ac59d90c444c088b849c9 100644 --- a/VectoCore/VectoCore/Configuration/Constants.cs +++ b/VectoCore/VectoCore/Configuration/Constants.cs @@ -237,7 +237,7 @@ namespace TUGraz.VectoCore.Configuration public const string GearshiftDataFile = ".vtcu"; - public const string BatteryFile = ".vbat"; + public const string BatteryFile = ".vreess"; public const string ElectricMotorFile = ".vem"; diff --git a/VectoCore/VectoCore/InputData/Reader/Impl/EngineOnlyVectoRunDataFactory.cs b/VectoCore/VectoCore/InputData/Reader/Impl/EngineOnlyVectoRunDataFactory.cs index 09028add78e9a06ec8bbb6d0bdb81b6a96ba2a11..d09d57d396d3aa6e0aa9b1ae116adecf92e037e3 100644 --- a/VectoCore/VectoCore/InputData/Reader/Impl/EngineOnlyVectoRunDataFactory.cs +++ b/VectoCore/VectoCore/InputData/Reader/Impl/EngineOnlyVectoRunDataFactory.cs @@ -61,6 +61,7 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl DrivingCycleDataReader.ReadFromDataTable(cycle.CycleData, cycle.Name, false), cycle.Name), ExecutionMode = ExecutionMode.Engineering, SimulationType = SimulationType.EngineOnly, + JobType = VectoSimulationJobType.EngineOnlySimulation, ElectricMachinesData = new List<Tuple<PowertrainPosition, ElectricMotorData>>() }; yield return simulationRunData; diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs index 84e64e1c6b65d07ae559b5f7f92a0ba75d5b0b79..ac29f2c7e56956b66560ac739aaa3dc34ce5ec20 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs @@ -68,7 +68,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl internal readonly CombustionEngineData ModelData; - protected IAuxPort EngineAux; + protected internal IAuxPort EngineAux; public CombustionEngine(IVehicleContainer container, CombustionEngineData modelData, bool pt1Disabled = false) : base(container) diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs index 3cc4a8d819fde1bb95b907b338d94caa61f7880c..9ac3583b321c89f04f896cf89b1b85fd6c206ec7 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs @@ -388,7 +388,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var inAngularVelocity = outAngularVelocity * ModelData.Gears[Gear].Ratio; - if (dryRun) { + if (dryRun) { var dryRunResponse = NextComponent.Request(absTime, dt, inTorque, inAngularVelocity, true); dryRunResponse.Gearbox.PowerRequest = outTorque * (PreviousState.OutAngularVelocity + outAngularVelocity) / 2.0; diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/PEVAMTShiftStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/PEVAMTShiftStrategy.cs index db9567d3a69ffe3aca79fdb7262b429816e0c2b5..98469d1461e9b971d7273b006a963a2443a91414 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/PEVAMTShiftStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/PEVAMTShiftStrategy.cs @@ -220,10 +220,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl protected virtual uint CheckEarlyUpshift(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity, uint currentGear, IResponse response1) { - var minFcGear = currentGear; - var minFc = double.MaxValue; - IResponse minFCResponse = null; - var fcCurrent = double.NaN; + //var minFcGear = currentGear; + //var minFc = double.MaxValue; + //IResponse minFCResponse = null; + //var fcCurrent = double.NaN; //var fcUpshiftPossible = true; @@ -243,6 +243,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var totalTransmissionRatio = DataBus.ElectricMotorInfo(PowertrainPosition.BatteryElectricB2).ElectricMotorSpeed / DataBus.VehicleInfo.VehicleSpeed; //var totalTransmissionRatio = outAngularVelocity / DataBus.VehicleSpeed; + var results = new List<Tuple<uint, double>>(); + for (var i = 1; i <= shiftStrategyParameters.AllowedGearRangeFC; i++) { var tryNextGear = (uint)(currentGear + i); @@ -282,26 +284,36 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl //var reserve = 1 - response.EngineTorqueDemandTotal / response.EngineStationaryFullLoadTorque; - if (double.IsNaN(fcCurrent)) { - //var responseCurrent = RequestDryRunWithGear(absTime, dt, DataBus.VehicleSpeed, DataBus.DriverAcceleration, currentGear); - var responseCurrent = RequestDryRunWithGear(absTime, dt, outTorque, outAngularVelocity, currentGear); - fcCurrent = GetFCRating(responseCurrent); - } + //if (double.IsNaN(fcCurrent)) { + // //var responseCurrent = RequestDryRunWithGear(absTime, dt, DataBus.VehicleSpeed, DataBus.DriverAcceleration, currentGear); + // var responseCurrent = RequestDryRunWithGear(absTime, dt, outTorque, outAngularVelocity, currentGear); + // fcCurrent = GetFCRating(responseCurrent); + //} var fcNext = GetFCRating(response); + results.Add(Tuple.Create(tryNextGear, fcNext)); - if (reserve < ModelData.TorqueReserve || - !fcNext.IsSmaller(fcCurrent * shiftStrategyParameters.RatingFactorCurrentGear) || !fcNext.IsSmaller(minFc)) { - continue; - } + //if (reserve < ModelData.TorqueReserve || + // !fcNext.IsGreater(fcCurrent * shiftStrategyParameters.RatingFactorCurrentGear) || !fcNext.IsSmaller(minFc)) { + // continue; + //} - minFcGear = tryNextGear; - minFc = fcNext; - minFCResponse = response; + //minFcGear = tryNextGear; + //minFc = fcNext; + //minFCResponse = response; } - if (currentGear != minFcGear) { - return minFcGear; + if (results.Count == 0) { + return currentGear; + } + + var responseCurrent = RequestDryRunWithGear(absTime, dt, outTorque, outAngularVelocity, currentGear); + var fcCurrent = GetFCRating(responseCurrent); + + var minFc = results.MinBy(x => x.Item2); + + if (minFc.Item2.IsGreater(fcCurrent * shiftStrategyParameters.RatingFactorCurrentGear)) { + return minFc.Item1; } return currentGear; @@ -320,7 +332,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ? VectoMath.Max(-ModelData.Gears[currentGear].MaxTorque, response.ElectricMotor.MaxDriveTorque) : response.ElectricMotor.MaxDriveTorque; - var tqCurrent = (response.ElectricMotor.PowerRequest / response.ElectricMotor.AngularVelocity).LimitTo(maxDriveTorque, maxGenTorque); + var tqCurrent = (response.ElectricMotor.ElectricMotorPowerMech / response.ElectricMotor.AngularVelocity).LimitTo(maxDriveTorque, maxGenTorque); var engineSpeed = response.ElectricMotor.AngularVelocity; @@ -431,9 +443,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl protected virtual uint CheckEarlyDownshift(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity, uint currentGear, IResponse response1) { - var minFcGear = currentGear; - var minFc = double.MaxValue; - var fcCurrent = double.NaN; + //var minFcGear = currentGear; + //var minFc = double.MaxValue * Math.Sign(outTorque.Value()) ; + //var fcCurrent = double.NaN; var estimatedVelocityPostShift = VelocityDropData.Interpolate(DataBus.VehicleInfo.VehicleSpeed, DataBus.DrivingCycleInfo.RoadGradient ?? 0.SI<Radian>()); if (!estimatedVelocityPostShift.IsGreater(DeclarationData.GearboxTCU.MIN_SPEED_AFTER_TRACTION_INTERRUPTION)) { @@ -445,6 +457,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl // return currentGear; //} + var results = new List<Tuple<uint, double>>(); for (var i = 1; i <= shiftStrategyParameters.AllowedGearRangeFC; i++) { var tryNextGear = (uint)(currentGear - i); @@ -463,24 +476,38 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl continue; } - if (double.IsNaN(fcCurrent)) { - var responseCurrent = RequestDryRunWithGear(absTime, dt, outTorque, outAngularVelocity, currentGear); + //if (double.IsNaN(fcCurrent)) { + // var responseCurrent = RequestDryRunWithGear(absTime, dt, outTorque, outAngularVelocity, currentGear); - //var responseCurrent = RequestDryRunWithGear(absTime, dt, DataBus.VehicleSpeed, DataBus.DriverAcceleration, currentGear); - fcCurrent = GetFCRating(responseCurrent); - } + // //var responseCurrent = RequestDryRunWithGear(absTime, dt, DataBus.VehicleSpeed, DataBus.DriverAcceleration, currentGear); + // fcCurrent = GetFCRating(responseCurrent); + //} var fcNext = GetFCRating(response); + results.Add(Tuple.Create(tryNextGear,fcNext)); - if (!fcNext.IsSmaller(fcCurrent * shiftStrategyParameters.RatingFactorCurrentGear) || - !fcNext.IsSmaller(minFc)) { - continue; - } + //if (!fcNext.IsGreater(fcCurrent * shiftStrategyParameters.RatingFactorCurrentGear) || + // !fcNext.IsGreater(minFc)) { + // continue; + //} - minFcGear = tryNextGear; - minFc = fcNext; + //minFcGear = tryNextGear; + //minFc = fcNext; } - return minFcGear; + if (results.Count == 0) { + return currentGear; + } + + var responseCurrent = RequestDryRunWithGear(absTime, dt, outTorque, outAngularVelocity, currentGear); + var fcCurrent = GetFCRating(responseCurrent); + + var minFc = results.MinBy(x => x.Item2); + + if (minFc.Item2.IsGreater(fcCurrent * shiftStrategyParameters.RatingFactorCurrentGear)) { + return minFc.Item1; + } + + return currentGear; } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/SuperCap.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/SuperCap.cs index 5333051013efed6c42ed0a09a99bc390cf0b4d71..ab26393427fde4811816a5f9bdb222ce3daf94f5 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/SuperCap.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/SuperCap.cs @@ -37,7 +37,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl public WattSecond StoredEnergy { - get { return PreviousState.Charge * InternalVoltage; } + // E = 1/2 C * U^2 = 1/2 Q^2/C + get { return PreviousState.Charge * InternalVoltage / 2.0; } } public Watt MaxChargePower(Second dt) @@ -191,7 +192,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl container[ModalResultField.P_reess_charge_max] = CurrentState.MaxChargePower; container[ModalResultField.P_reess_discharge_max] = CurrentState.MaxDischargePower; - container[ModalResultField.E_RESS] = CurrentState.Charge * internalVoltage * ModelData.Capacity; + container[ModalResultField.E_RESS] = CurrentState.Charge * CurrentState.Charge / ModelData.Capacity / 2.0; } protected override void DoCommitSimulationStep(Second time, Second simulationInterval) diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Vehicle.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Vehicle.cs index 0015d22e7b97ae90b97f764d90cc7df1209895cc..41e65280e586493b3d71cc78815e93a780589f46 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Vehicle.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Vehicle.cs @@ -83,8 +83,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var pos = positions.First(); if (pos.IsBatteryElectric()) { - var maxEMSpeed = model.ElectricMachinesData.Find(x => x.Item1 == pos).Item2.FullLoadCurve - .FullLoadEntries.Max(x => x.MotorSpeed); // DataBus.ElectricMotorInfo(pos).MaxSpeed; + var maxEMSpeed = model.ElectricMachinesData.Find(x => x.Item1 == pos).Item2.FullLoadCurve.MaxSpeed; var ratio = 1.0; if (pos == PowertrainPosition.BatteryElectricB3) { ratio = model.AxleGearData.AxleGear.Ratio; diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs index 1e782411b0737750a260e18a019039a5d22b8867..d385888f124364ee8a107ba0d569b3000f0deb92 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs @@ -1261,6 +1261,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies (DataBus.EngineInfo as CombustionEngine).PreviousState.EngineTorqueOut; TestPowertrain.CombustionEngine.PreviousState.DynamicFullLoadTorque = (DataBus.EngineInfo as CombustionEngine).PreviousState.DynamicFullLoadTorque; + (TestPowertrain.CombustionEngine.EngineAux as EngineAuxiliary).PreviousState.AngularSpeed = + ((DataBus.EngineInfo as CombustionEngine).EngineAux as EngineAuxiliary).PreviousState.AngularSpeed; TestPowertrain.Gearbox.PreviousState.InAngularVelocity = (DataBus.GearboxInfo as Gearbox).PreviousState.InAngularVelocity; diff --git a/VectoCore/VectoCore/OutputData/FileIO/JSONFileWriter.cs b/VectoCore/VectoCore/OutputData/FileIO/JSONFileWriter.cs index cf29b8d26a692ebc6c1f923365e8e34eadf27440..7a3eaa8668be4577b34aa09c5df69f97f6c7bcf4 100644 --- a/VectoCore/VectoCore/OutputData/FileIO/JSONFileWriter.cs +++ b/VectoCore/VectoCore/OutputData/FileIO/JSONFileWriter.cs @@ -762,13 +762,13 @@ public class JSONFileWriter : IOutputFileWriter "GearboxFile", GetRelativePath(input.JobInputData.Vehicle.Components.GearboxInputData.DataSource.SourceFile, basePath)); + body.Add("TCU", GetRelativePath(input.DriverInputData.GearshiftInputData.Source, basePath)); } body.Add("Padd_electric", input.JobInputData.Vehicle.Components.AuxiliaryInputData.ElectricAuxPower.Value()); - //if (!job.SavedInDeclarationMode) - // { - body.Add("TCU", GetRelativePath(input.DriverInputData.GearshiftInputData.Source, basePath)); - //} + //if (!job.SavedInDeclarationMode) + // { + //} //body.Add("ShiftStrategy", input.JobInputData.ShiftStrategy); diff --git a/VectoCore/VectoCore/OutputData/SummaryDataContainer.cs b/VectoCore/VectoCore/OutputData/SummaryDataContainer.cs index aabcfd8380b4c038cf444ed131f902b2299593a1..5cb0ad09a98de7cb8547349f50eea7f967b4e8b3 100644 --- a/VectoCore/VectoCore/OutputData/SummaryDataContainer.cs +++ b/VectoCore/VectoCore/OutputData/SummaryDataContainer.cs @@ -164,7 +164,7 @@ namespace TUGraz.VectoCore.OutputData Tuple.Create(Fields.TCU_MODEL, typeof(string)), Tuple.Create(Fields.ADAS_TECHNOLOGY_COMBINATION, typeof(string)), Tuple.Create(Fields.PTO_TECHNOLOGY, typeof(string)), - + Tuple.Create(Fields.REESS_CAPACITY, typeof(string)), //Tuple.Create(PTO_OTHER_ELEMENTS, typeof(string)), }.Select(x => new DataColumn(x.Item1, x.Item2)).ToArray()); @@ -333,7 +333,7 @@ namespace TUGraz.VectoCore.OutputData row[Fields.ElectricEnergyConsumptionPerKm] = (-modData.TimeIntegral<WattSecond>(ModalResultField.P_reess_terminal) / modData.Distance).Cast<JoulePerMeter>().ConvertToKiloWattHourPerKiloMeter(); } - } + } if (runData.Mission?.MissionType == MissionType.VerificationTest) { var fuelsWhtc = runData.EngineData.Fuels.Select( @@ -736,40 +736,61 @@ namespace TUGraz.VectoCore.OutputData col.SetOrdinal(Table.Columns[Fields.E_GRAD].Ordinal + 1); } row[colName] = entry.Item2; - } + } } - if (runData.BatteryData != null) { - foreach (var field in new[] { Fields.BatteryStartSoC, Fields.BatteryEndSoC }) { + if (runData.BatteryData != null || runData.SuperCapData != null) { + foreach (var field in new[] { Fields.REESS_StartSoC, Fields.REESS_EndSoC }) { if (Table.Columns.Contains(field)) { continue; } + var col = Table.Columns.Add(field, typeof(double)); col.SetOrdinal(Table.Columns[Fields.P_WHEEL].Ordinal); } - foreach (var field in new[] { Fields.BatteryDeltaSoC, Fields.E_BAT_LOSS, Fields.E_Batt_T_chg, Fields.E_Batt_T_dischg, Fields.E_Batt_int_chg, Fields.E_Batt_int_dischg}) { + foreach (var field in new[] { + Fields.REESS_DeltaSoC, Fields.E_REESS_LOSS, Fields.E_REESS_T_chg, Fields.E_REESS_T_dischg, + Fields.E_REESS_int_chg, Fields.E_REESS_int_dischg + }) { if (Table.Columns.Contains(field)) { continue; } + var col = Table.Columns.Add(field, typeof(ConvertedSI)); col.SetOrdinal(Table.Columns[Fields.P_WHEEL].Ordinal); - } - - row[Fields.BatteryStartSoC] = runData.BatteryData.InitialSoC * 100; // modData.BatteryStartSoC(); - row[Fields.BatteryEndSoC] = modData.BatteryEndSoC(); + } + row[Fields.E_REESS_LOSS] = modData.BatteryLoss().ConvertToKiloWattHour(); + row[Fields.E_REESS_T_chg] = modData.WorkBatteryChargeTerminal().ConvertToKiloWattHour(); + row[Fields.E_REESS_T_dischg] = modData.WorkBatteryDischargeTerminal().ConvertToKiloWattHour(); + row[Fields.E_REESS_int_chg] = modData.WorkBatteryChargeInternal().ConvertToKiloWattHour(); + row[Fields.E_REESS_int_dischg] = modData.WorkBatteryDischargeInternal().ConvertToKiloWattHour(); + } + + if (runData.BatteryData != null) { + row[Fields.REESS_StartSoC] = runData.BatteryData.InitialSoC * 100; + row[Fields.REESS_EndSoC] = modData.BatteryEndSoC(); var cellVoltage = runData.BatteryData.SOCMap.Lookup(runData.BatteryData.InitialSoC); - row[Fields.BatteryDeltaSoC] = + row[Fields.REESS_DeltaSoC] = (modData.BatteryEnergyEnd() - (runData.BatteryData.InitialSoC * runData.BatteryData.Capacity * cellVoltage).Cast<WattSecond>()).ConvertToKiloWattHour(); - row[Fields.E_BAT_LOSS] = modData.BatteryLoss().ConvertToKiloWattHour(); - row[Fields.E_Batt_T_chg] = modData.WorkBatteryChargeTerminal().ConvertToKiloWattHour(); - row[Fields.E_Batt_T_dischg] = modData.WorkBatteryDischargeTerminal().ConvertToKiloWattHour(); - row[Fields.E_Batt_int_chg] = modData.WorkBatteryChargeInternal().ConvertToKiloWattHour(); - row[Fields.E_Batt_int_dischg] = modData.WorkBatteryDischargeInternal().ConvertToKiloWattHour(); + } - } + if (runData.SuperCapData != null) { + row[Fields.REESS_StartSoC] = runData.SuperCapData.InitialSoC * 100; + row[Fields.REESS_EndSoC] = modData.BatteryEndSoC(); + var initialCharge = runData.SuperCapData.Capacity * + ((runData.SuperCapData.MaxVoltage - runData.SuperCapData.MinVoltage) * + runData.SuperCapData.InitialSoC + + runData.SuperCapData.MinVoltage); + row[Fields.REESS_DeltaSoC] = + (modData.BatteryEnergyEnd() - + (initialCharge * initialCharge / runData.SuperCapData.Capacity / 2.0).Cast<WattSecond>()).ConvertToKiloWattHour(); + + + } + } private void WriteFullPowertrain(VectoRunData runData, DataRow row) { @@ -830,6 +851,17 @@ namespace TUGraz.VectoCore.OutputData row[Fields.R_DYN] = (ConvertedSI)data.DynamicTyreRadius; row[Fields.ADAS_TECHNOLOGY_COMBINATION] = data.ADAS != null ? DeclarationData.ADASCombinations.Lookup(data.ADAS, gbxType).ID : ""; + + var cap = ""; + if (runData.BatteryData?.Capacity != null) { + cap = $"{runData.BatteryData.Capacity.AsAmpHour} Ah"; + } + + if (runData.SuperCapData?.Capacity != null) { + cap = $"{runData.SuperCapData.Capacity} F"; + } + + row[Fields.REESS_CAPACITY] = cap; } private static void WriteAirdragData(AirdragData data, DataRow row) @@ -895,7 +927,7 @@ namespace TUGraz.VectoCore.OutputData if (data == null) { return; } - row[Fields.AXLE_MANUFACTURER] = data.Manufacturer; + row[Fields.AXLE_MANUFACTURER] = data.Manufacturer; row[Fields.AXLE_MODEL] = data.ModelName; row[Fields.AXLE_RATIO] = (ConvertedSI)data.AxleGear.Ratio.SI<Scalar>(); row[Fields.AXLEGEAR_CERTIFICATION_METHOD] = data.CertificationMethod.GetName(); @@ -975,7 +1007,7 @@ namespace TUGraz.VectoCore.OutputData if (data == null) { return; } - row[Fields.GEARBOX_MANUFACTURER] = data.Manufacturer; + row[Fields.GEARBOX_MANUFACTURER] = data.Manufacturer; row[Fields.GEARBOX_MODEL] = data.ModelName; row[Fields.GEARBOX_TYPE] = data.Type; row[Fields.GEARBOX_CERTIFICATION_NUMBER] = data.CertificationMethod == CertificationMethod.StandardValues @@ -1140,7 +1172,7 @@ namespace TUGraz.VectoCore.OutputData public const string ElectricEnergyConsumptionPerKm = "EC_el_final [kWh/km]"; - public const string CO2_KM = "CO2 [g/km]"; + public const string CO2_KM = "CO2 [g/km]"; public const string CO2_TKM = "CO2 [g/tkm]"; public const string CO2_M3KM = "CO2 [g/m³km]"; public const string CO2_PKM = "CO2 [g/Pkm]"; @@ -1277,14 +1309,16 @@ namespace TUGraz.VectoCore.OutputData public const string E_EM_OFF_Loss_Format = "E_EM_{0}_off_loss [kWh]"; - public const string BatteryStartSoC = "Battery Start SoC [%]"; - public const string BatteryEndSoC = "Battery end SoC [%]"; - public const string BatteryDeltaSoC = "Battery Delta SoC [kWh]"; - public const string E_BAT_LOSS = "E_Batt_loss [kWh]"; - public const string E_Batt_T_chg = "E_Batt_T_chg [kWh]"; - public const string E_Batt_T_dischg = "E_Batt_T_dischg [kWh]"; - public const string E_Batt_int_chg = "E_Batt_int_chg [kWh]"; - public const string E_Batt_int_dischg = "E_Batt_int_dischg [kWh]"; - } - } + public const string REESS_StartSoC = "REESS Start SoC [%]"; + public const string REESS_EndSoC = "REESS End SoC [%]"; + public const string REESS_DeltaSoC = "REESS Delta SoC [kWh]"; + public const string REESS_CAPACITY = "REESS Capacity"; + + public const string E_REESS_LOSS = "E_REESS_loss [kWh]"; + public const string E_REESS_T_chg = "E_REESS_T_chg [kWh]"; + public const string E_REESS_T_dischg = "E_REESS_T_dischg [kWh]"; + public const string E_REESS_int_chg = "E_REESS_int_chg [kWh]"; + public const string E_REESS_int_dischg = "E_REESS_int_dischg [kWh]"; + } + } } diff --git a/VectoCore/VectoCoreTest/Models/Simulation/LossMapRangeValidationTest.cs b/VectoCore/VectoCoreTest/Models/Simulation/LossMapRangeValidationTest.cs index 1538311656459f1e92864ca971cb916ebe92f3fe..c1d2a329f756ad0c06cded6520a28a78f1c859a0 100644 --- a/VectoCore/VectoCoreTest/Models/Simulation/LossMapRangeValidationTest.cs +++ b/VectoCore/VectoCoreTest/Models/Simulation/LossMapRangeValidationTest.cs @@ -36,6 +36,7 @@ using System.ComponentModel.DataAnnotations; using System.IO; using System.Linq; using TUGraz.VectoCommon.Exceptions; +using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.InputData.FileIO.JSON; @@ -180,9 +181,14 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation var runData = new VectoRunData { EngineData = engineData, AxleGearData = axleGearData, - Cycle = new DrivingCycleData { Entries = new List<DrivingCycleData.DrivingCycleEntry>() } + Cycle = new DrivingCycleData { Entries = new List<DrivingCycleData.DrivingCycleEntry>() }, + JobType = VectoSimulationJobType.EngineOnlySimulation }; - var result = VectoRunData.ValidateRunData(runData, new ValidationContext(runData)); + var context = new ValidationContext(runData); + context.ServiceContainer.AddService(typeof(VectoValidationModeServiceContainer), + new VectoValidationModeServiceContainer(ExecutionMode.Declaration, VectoSimulationJobType.EngineOnlySimulation, PowertrainPosition.HybridPositionNotSet, GearboxType.AMT, false)); + + var result = VectoRunData.ValidateRunData(runData, context); Assert.IsTrue(ValidationResult.Success == result); Assert.IsFalse(runData.IsValid()); }