diff --git a/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationModeVectoRunDataFactory.cs b/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationModeVectoRunDataFactory.cs index 1317611771704e7030d4dba399c39600faccf62c..d224aa59a62094aff47cbe6a756309a2b2e8abe4 100644 --- a/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationModeVectoRunDataFactory.cs +++ b/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationModeVectoRunDataFactory.cs @@ -228,6 +228,7 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl mission.MissionType.GetNonEMSMissionType(), _engineData.WHTCRural, _engineData.WHTCUrban, _engineData.WHTCMotorway) * _engineData.ColdHotCorrectionFactor * _engineData.CorrectionFactorRegPer; + simulationRunData.EngineData.NCVCorrectionFactor = DeclarationData.FuelData.Lookup(_engineData.FuelType).HeatingValueCorrection; simulationRunData.EngineData.ADASCorrectionFactor = DeclarationData.ADASBenefits.Lookup( _segment.VehicleClass, adasCombination, mission.MissionType, loading.Key); simulationRunData.VehicleData.VehicleClass = _segment.VehicleClass; diff --git a/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationVTPModeVectoRunDataFactory.cs b/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationVTPModeVectoRunDataFactory.cs index 60ef0fe048703b10157c42da9050031ef3f6cff3..a77fec3a3782bde402e53400074bddcf3fb82779 100644 --- a/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationVTPModeVectoRunDataFactory.cs +++ b/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationVTPModeVectoRunDataFactory.cs @@ -191,7 +191,7 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl vtpRunData.Mission = new Mission() { MissionType = MissionType.VerificationTest }; - var ncvStd = DeclarationData.FuelData.Lookup(JobInputData.Vehicle.EngineInputData.FuelType).LowerHeatingValue; + var ncvStd = DeclarationData.FuelData.Lookup(JobInputData.Vehicle.EngineInputData.FuelType).LowerHeatingValueVecto; var ncvCorrection = ncvStd / JobInputData.NetCalorificValueTestFuel; var mileageCorrection = GetMileagecorrectionFactor(JobInputData.Mileage); vtpRunData.VTPData = new VTPData() { diff --git a/VectoCore/VectoCore/Models/Declaration/FuelData.cs b/VectoCore/VectoCore/Models/Declaration/FuelData.cs index 72b8b922a82aa6af8858ebbaf062f19fa1e2cad0..0299272460b1df8b371fe9dc0bc680d997947dd2 100644 --- a/VectoCore/VectoCore/Models/Declaration/FuelData.cs +++ b/VectoCore/VectoCore/Models/Declaration/FuelData.cs @@ -73,7 +73,8 @@ namespace TUGraz.VectoCore.Models.Declaration r.Field<string>(0).ParseEnum<FuelType>(), string.IsNullOrWhiteSpace(density) ? null : density.ToDouble(0).SI<KilogramPerCubicMeter>(), r.ParseDouble("co2perfuelweight"), - r.ParseDouble("lowerheatingvalue").SI(Unit.SI.Kilo.Joule.Per.Kilo.Gramm).Cast<JoulePerKilogramm>() + r.ParseDouble("ncv_stdvecto").SI(Unit.SI.Kilo.Joule.Per.Kilo.Gramm).Cast<JoulePerKilogramm>(), + r.ParseDouble("ncv_stdengine").SI(Unit.SI.Kilo.Joule.Per.Kilo.Gramm).Cast<JoulePerKilogramm>() ); }) .ToDictionary(e => e.FuelType); @@ -81,21 +82,28 @@ namespace TUGraz.VectoCore.Models.Declaration public struct Entry { - public Entry(FuelType type, KilogramPerCubicMeter density, double weight, JoulePerKilogramm heatingValue) : this() + public Entry(FuelType type, KilogramPerCubicMeter density, double weight, JoulePerKilogramm heatingValueVecto, JoulePerKilogramm heatingValueAnnex) : this() { FuelType = type; FuelDensity = density; CO2PerFuelWeight = weight; - LowerHeatingValue = heatingValue; + LowerHeatingValueVecto = heatingValueVecto; + LowerHeatingValueVectoEngine = heatingValueAnnex; } - public FuelType FuelType { get; private set; } - public KilogramPerCubicMeter FuelDensity { get; private set; } + public FuelType FuelType { get; } - public double CO2PerFuelWeight { get; private set; } + public KilogramPerCubicMeter FuelDensity { get; } + + public double CO2PerFuelWeight { get; } + + public JoulePerKilogramm LowerHeatingValueVecto { get; } + + public JoulePerKilogramm LowerHeatingValueVectoEngine { get; } + + public double HeatingValueCorrection { get { return LowerHeatingValueVectoEngine / LowerHeatingValueVecto; } } - public JoulePerKilogramm LowerHeatingValue { get; private set; } } } } \ No newline at end of file diff --git a/VectoCore/VectoCore/Models/Simulation/Data/ModalResultField.cs b/VectoCore/VectoCore/Models/Simulation/Data/ModalResultField.cs index c43a27a3de5383b50c2dc155e48db54cb0732dca..eb11c00f9765d350200c6495516214dca198c8ad 100644 --- a/VectoCore/VectoCore/Models/Simulation/Data/ModalResultField.cs +++ b/VectoCore/VectoCore/Models/Simulation/Data/ModalResultField.cs @@ -109,9 +109,9 @@ namespace TUGraz.VectoCore.Models.Simulation.Data [ModalResultField(typeof(SI), name: "FC-Map", caption: "FC-Map [g/h]", outputFactor: 3600 * 1000)] FCMap, /// <summary> - /// [g/h] Fuel consumption after Auxiliary-Start/Stop Correction. (Based on FC.) + /// [g/h] Fuel consumption after correction for different NCV in VECTO Engine and VECTO sim. (Based on FC.) /// </summary> - [ModalResultField(typeof(SI), name: "FC-AUXc", caption: "FC-AUXc [g/h]", outputFactor: 3600 * 1000)] FCAUXc, + [ModalResultField(typeof(SI), name: "FC-NCVc", caption: "FC-NCVc [g/h]", outputFactor: 3600 * 1000)] FCNCVc, /// <summary> /// [g/h] Fuel consumption after WHTC Correction. (Based on FC-AUXc.) @@ -126,7 +126,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Data /// <summary> /// [g/h] Fuel consumption after correction for ADAS technologies. (Based on FC-AAUXc.) /// </summary> - [ModalResultField(typeof(SI), name: "FC-ADAS", caption: "FC-Final [g/h]", outputFactor: 3600 * 1000)] FCADAS, + [ModalResultField(typeof(SI), name: "FC-ADAS", caption: "FC-ADAS [g/h]", outputFactor: 3600 * 1000)] FCADAS, /// <summary> /// [g/h] Fuel consumption after WHTC Correction. (Based on FC-ADAS.) diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/CombustionEngineData.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/CombustionEngineData.cs index 48d923edb725e46014f6e3ad5ea1145dd86cbd3c..fc3ab6426a4b420fd83669ccf4c3d3b5b97ed181 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/CombustionEngineData.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/CombustionEngineData.cs @@ -82,6 +82,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data public NewtonMeter MaxTorqueDeclared { get; internal set; } public FuelType FuelType { get; internal set; } + public double NCVCorrectionFactor { get; set; } public CombustionEngineData() { @@ -91,6 +92,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data CorrectionFactorRegPer = 1; FuelConsumptionCorrectionFactor = 1; ADASCorrectionFactor = 1; + NCVCorrectionFactor = 1; } public CombustionEngineData Copy() @@ -113,7 +115,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data RatedSpeedDeclared = RatedSpeedDeclared, MaxTorqueDeclared = MaxTorqueDeclared, FuelType = FuelType, - ADASCorrectionFactor = ADASCorrectionFactor + ADASCorrectionFactor = ADASCorrectionFactor, + NCVCorrectionFactor = NCVCorrectionFactor }; } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs index 181f3e9db906772975d9dd7e7691b2763f8b18e7..71894fc589448444dc7cdc2bfe7f5284bdb638fe 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs @@ -396,9 +396,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl } var fc = result.Value; - var fcAux = fc; // TODO: wird fcNCVcorr + var fcNCVcorr = fc * ModelData.NCVCorrectionFactor; // TODO: wird fcNCVcorr - var fcWHTC = fcAux * WHTCCorrectionFactor; + var fcWHTC = fcNCVcorr * WHTCCorrectionFactor; var fcAAUX = fcWHTC; var advancedAux = EngineAux as BusAuxiliariesAdapter; if (advancedAux != null) { @@ -409,7 +409,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var fcFinal = fcADAS; container[ModalResultField.FCMap] = fc; - container[ModalResultField.FCAUXc] = fcAux; + container[ModalResultField.FCNCVc] = fcNCVcorr; container[ModalResultField.FCWHTCc] = fcWHTC; container[ModalResultField.FCAAUX] = fcAAUX; container[ModalResultField.FCADAS] = fcADAS; diff --git a/VectoCore/VectoCore/OutputData/IModalDataContainer.cs b/VectoCore/VectoCore/OutputData/IModalDataContainer.cs index ac165881f5d78b8ac9079ac8a58642b3634f86a8..f01c7e6ea512d87950b492e7de06f93386d069d0 100644 --- a/VectoCore/VectoCore/OutputData/IModalDataContainer.cs +++ b/VectoCore/VectoCore/OutputData/IModalDataContainer.cs @@ -344,13 +344,18 @@ namespace TUGraz.VectoCore.OutputData return data.TimeIntegral<Kilogram>(ModalResultField.FCWHTCc) / data.Duration(); } - public static KilogramPerMeter FuelConsumptionAuxStartStop(this IModalDataContainer data) + public static KilogramPerMeter FuelConsumptionNCVCorrected(this IModalDataContainer data) { var distance = data.Distance(); if (distance == null || distance.IsEqual(0)) { return null; } - return data.TimeIntegral<Kilogram>(ModalResultField.FCAUXc) / distance; + return data.TimeIntegral<Kilogram>(ModalResultField.FCNCVc) / distance; + } + + public static KilogramPerSecond FuelConsumptionNCVCorrectedPerSecond(this IModalDataContainer data) + { + return data.TimeIntegral<Kilogram>(ModalResultField.FCNCVc) / data.Duration(); } public static KilogramPerSecond FuelConsumptionAAUXPerSecond(this IModalDataContainer data) @@ -381,10 +386,7 @@ namespace TUGraz.VectoCore.OutputData return data.TimeIntegral<Kilogram>(ModalResultField.FCADAS) / distance; } - public static KilogramPerSecond FuelConsumptionAuxStartStopPerSecond(this IModalDataContainer data) - { - return data.TimeIntegral<Kilogram>(ModalResultField.FCAUXc) / data.Duration(); - } + public static KilogramPerSecond FuelConsumptionFinalPerSecond(this IModalDataContainer data) { @@ -426,7 +428,7 @@ namespace TUGraz.VectoCore.OutputData if (distance == null || distance.IsEqual(0)) { return null; } - return data.TimeIntegral<Kilogram>(ModalResultField.FCFinal) * data.FuelData.LowerHeatingValue / distance; + return data.TimeIntegral<Kilogram>(ModalResultField.FCFinal) * data.FuelData.LowerHeatingValueVecto / distance; } public static Kilogram TotalFuelConsumption(this IModalDataContainer data) diff --git a/VectoCore/VectoCore/OutputData/ModFilter/ActualModalDataFilter.cs b/VectoCore/VectoCore/OutputData/ModFilter/ActualModalDataFilter.cs index a3535a2aa9c58a30c5b7898f4b5168d1c03827de..93eb69fa22b9ebc5b94780736917f8299091b214 100644 --- a/VectoCore/VectoCore/OutputData/ModFilter/ActualModalDataFilter.cs +++ b/VectoCore/VectoCore/OutputData/ModFilter/ActualModalDataFilter.cs @@ -127,7 +127,7 @@ namespace TUGraz.VectoCore.OutputData.ModFilter SetConstantValues(current, start, end, ModalResultField.FCMap, - ModalResultField.FCAUXc, + ModalResultField.FCNCVc, ModalResultField.FCAAUX, ModalResultField.FCWHTCc, ModalResultField.FCFinal); diff --git a/VectoCore/VectoCore/OutputData/ModalDataContainer.cs b/VectoCore/VectoCore/OutputData/ModalDataContainer.cs index 32cbcca1ecb8df933c57f23663f1220b0a39f909..35966613d479ed84bd4746696d092493437ca516 100644 --- a/VectoCore/VectoCore/OutputData/ModalDataContainer.cs +++ b/VectoCore/VectoCore/OutputData/ModalDataContainer.cs @@ -239,7 +239,7 @@ namespace TUGraz.VectoCore.OutputData .Concat(Auxiliaries.Values.Select(c => c.ColumnName)) .Concat( new[] { - ModalResultField.FCMap, ModalResultField.FCAUXc, ModalResultField.FCWHTCc, + ModalResultField.FCMap, ModalResultField.FCNCVc, ModalResultField.FCWHTCc, ModalResultField.FCAAUX, ModalResultField.FCADAS, ModalResultField.FCFinal }.Select(x => x.GetName())); #if TRACE diff --git a/VectoCore/VectoCore/OutputData/SummaryDataContainer.cs b/VectoCore/VectoCore/OutputData/SummaryDataContainer.cs index ab1ac1673bb63207c5f46ba95141fae687f7d5ce..3d6f3a82acaa201842bd5270194311d773e00592 100644 --- a/VectoCore/VectoCore/OutputData/SummaryDataContainer.cs +++ b/VectoCore/VectoCore/OutputData/SummaryDataContainer.cs @@ -120,8 +120,8 @@ namespace TUGraz.VectoCore.OutputData public const string FCMAP_H = "FC-Map [g/h]"; public const string FCMAP_KM = "FC-Map [g/km]"; - public const string FCAUXC_H = "FC-AUXc [g/h]"; - public const string FCAUXC_KM = "FC-AUXc [g/km]"; + public const string FCNCVC_H = "FC-NCVc [g/h]"; + public const string FCNCVC_KM = "FC-NCVc [g/km]"; public const string FCWHTCC_H = "FC-WHTCc [g/h]"; public const string FCWHTCC_KM = "FC-WHTCc [g/km]"; public const string FCAAUX_H = "FC-AAUX [g/h]"; @@ -271,7 +271,7 @@ namespace TUGraz.VectoCore.OutputData TIME, DISTANCE, SPEED, ALTITUDE_DELTA, FCMAP_H, FCMAP_KM, - FCAUXC_H, FCAUXC_KM, + FCNCVC_H, FCNCVC_KM, FCWHTCC_H, FCWHTCC_KM, FCAAUX_H, FCAAUX_KM, FCADAS_H, FCADAS_KM, @@ -398,9 +398,9 @@ namespace TUGraz.VectoCore.OutputData row[FCMAP_KM] = fcMapPerMeter.ConvertToGrammPerKiloMeter(); } - row[FCAUXC_H] = modData.FuelConsumptionAuxStartStopPerSecond().ConvertToGrammPerHour(); - var fuelConsumptionAuxStartStopCorrected = modData.FuelConsumptionAuxStartStop(); - row[FCAUXC_KM] = fuelConsumptionAuxStartStopCorrected.ConvertToGrammPerKiloMeter(); + row[FCNCVC_H] = modData.FuelConsumptionNCVCorrectedPerSecond().ConvertToGrammPerHour(); + var fuelConsumptionAuxStartStopCorrected = modData.FuelConsumptionNCVCorrected(); + row[FCNCVC_KM] = fuelConsumptionAuxStartStopCorrected.ConvertToGrammPerKiloMeter(); row[FCWHTCC_H] = modData.FuelConsumptionWHTCPerSecond().ConvertToGrammPerHour(); var fuelConsumptionWHTCCorrected = modData.FuelConsumptionWHTC(); diff --git a/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReport.cs b/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReport.cs index 295efdb0915b69add340bfc3fd31d9d0ee02d069..cb5ab10f5ab4c147b306fec09fde821a77133cc1 100644 --- a/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReport.cs +++ b/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReport.cs @@ -130,7 +130,7 @@ namespace TUGraz.VectoCore.OutputData.XML FuelConsumptionTotal = data.TimeIntegral<Kilogram>(ModalResultField.FCFinal); CO2Total = FuelConsumptionTotal * data.FuelData.CO2PerFuelWeight; - EnergyConsumptionTotal = FuelConsumptionTotal * data.FuelData.LowerHeatingValue; + EnergyConsumptionTotal = FuelConsumptionTotal * data.FuelData.LowerHeatingValueVecto; } } diff --git a/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs b/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs index d597fdc14e7e1a5f6150283bcdbeb83681fa8a76..e61b8b6779f262fe3365a74482d6aac40bf49f37 100644 --- a/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs +++ b/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs @@ -2054,5 +2054,17 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration Assert.AreEqual(expectedCorrectionFactor, factor, 1e-6, "group: {0}, adas: {1}, mission: {2}, payload: {3}, expectedBenefit: {4}, actualBenefit: {5}", group, adasConfig, mission, loading, expectedBenefit, (factor - 1) * 100.0); } + + [TestCase("Diesel CI", 1.0), + TestCase("Ethanol CI", 1.0), + TestCase("Ethanol PI", 1.0), + TestCase("NG PI", 1.0)] + public void TestNCVCorrection(string fuelTypeStr, double expectedCorrectionFactor) + { + var fuelType = fuelTypeStr.ParseEnum<FuelType>(); + var cf = DeclarationData.FuelData.Lookup(fuelType).HeatingValueCorrection; + + Assert.AreEqual(expectedCorrectionFactor, cf, 1e-6); + } } } \ No newline at end of file diff --git a/VectoCore/VectoCoreTest/Models/SimulationComponent/ClutchTest.cs b/VectoCore/VectoCoreTest/Models/SimulationComponent/ClutchTest.cs index b507b6549f8d1dbdc653fc482fb8bdbed7473ed4..16d323bccb257a4aabfce750bf22ccc48f6b3041 100644 --- a/VectoCore/VectoCoreTest/Models/SimulationComponent/ClutchTest.cs +++ b/VectoCore/VectoCoreTest/Models/SimulationComponent/ClutchTest.cs @@ -196,7 +196,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent container[ModalResultField.Tq_drag] = 0.SI<NewtonMeter>(); container[ModalResultField.FCMap] = 0.SI<KilogramPerSecond>(); - container[ModalResultField.FCAUXc] = 0.SI<KilogramPerSecond>(); + container[ModalResultField.FCNCVc] = 0.SI<KilogramPerSecond>(); container[ModalResultField.FCWHTCc] = 0.SI<KilogramPerSecond>(); container[ModalResultField.FCAAUX] = 0.SI<KilogramPerSecond>(); container[ModalResultField.FCFinal] = 0.SI<KilogramPerSecond>();