diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs index 8a613bd43e79a90270a1cd3e3e2cd4bf25cf39ad..5d8334261c67ed9f9ca77d2bd98fc8272f9aab60 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs @@ -102,7 +102,8 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter var aerodynamicDragArea = data.AirDragArea + mission.DeltaCdA; retVal.CrossWindCorrectionCurve = - new CrosswindCorrectionCdxALookup(GetDeclarationAirResistanceCurve(retVal.VehicleCategory, aerodynamicDragArea), + new CrosswindCorrectionCdxALookup( + GetDeclarationAirResistanceCurve(mission.CrossWindCorrectionParameters, aerodynamicDragArea), CrossWindCorrectionMode.DeclarationModeCorrection); var axles = data.Axles; if (axles.Count < mission.AxleWeightDistribution.Length) { @@ -286,7 +287,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter } public static List<CrossWindCorrectionCurveReader.CrossWindCorrectionEntry> GetDeclarationAirResistanceCurve( - VehicleCategory vehicleCategory, SquareMeter aerodynamicDragAera) + string crosswindCorrectionParameters, SquareMeter aerodynamicDragAera) { const int startSpeed = 60; const int maxSpeed = 130; @@ -295,7 +296,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter const int maxAlpha = 180; const int alphaStep = 10; - var values = DeclarationData.AirDrag.Lookup(vehicleCategory); + var values = DeclarationData.AirDrag.Lookup(crosswindCorrectionParameters); var points = new List<CrossWindCorrectionCurveReader.CrossWindCorrectionEntry> { new CrossWindCorrectionCurveReader.CrossWindCorrectionEntry { Velocity = 0.SI<MeterPerSecond>(), diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs index 6e79022be5a3a6abe819a0edb41845a44ff863a4..d6f24bd9b69da9dc5c040422b6c9adea46975e05 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs @@ -78,8 +78,9 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter break; case CrossWindCorrectionMode.DeclarationModeCorrection: retVal.CrossWindCorrectionCurve = - new CrosswindCorrectionCdxALookup(DeclarationDataAdapter.GetDeclarationAirResistanceCurve(retVal.VehicleCategory, - data.AirDragArea), CrossWindCorrectionMode.DeclarationModeCorrection); + new CrosswindCorrectionCdxALookup( + DeclarationDataAdapter.GetDeclarationAirResistanceCurve(GetAirdragParameterSet(retVal.VehicleCategory), + data.AirDragArea), CrossWindCorrectionMode.DeclarationModeCorrection); break; default: throw new ArgumentOutOfRangeException(); @@ -98,6 +99,22 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter return retVal; } + private string GetAirdragParameterSet(VehicleCategory vehicleCategory, AxleConfiguration axles, int numAxles) + { + switch (vehicleCategory) { + case VehicleCategory.RigidTruck: + return (numAxles > axles.NumAxles()) ? "RigidTrailer" : "RigidSolo"; + case VehicleCategory.Tractor: + return "TractorSemitrailer"; + case VehicleCategory.CityBus: + case VehicleCategory.InterurbanBus: + case VehicleCategory.Coach: + return "CoachBus"; + default: + throw new ArgumentOutOfRangeException("vehicleCategory", vehicleCategory, null); + } + } + private void WarnEngineeringMode(string msg) { Log.Error("{0} is in Declaration Mode but is used for Engineering Mode!", msg); @@ -129,8 +146,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter //var gears = gearbox.Gears; if (gearbox.Gears.Count < 2) { - throw new VectoSimulationException( - "At least two Gear-Entries must be defined in Gearbox!"); + throw new VectoSimulationException("At least two Gear-Entries must be defined in Gearbox!"); } retVal.Inertia = gearbox.Inertia; @@ -222,10 +238,10 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter } } - if (retVal.Type.AutomaticTransmission()) { - retVal.PowershiftShiftTime = gearbox.PowershiftShiftTime; - retVal.PowershiftInertiaFactor = gearbox.PowerShiftInertiaFactor; - } + if (retVal.Type.AutomaticTransmission()) { + retVal.PowershiftShiftTime = gearbox.PowershiftShiftTime; + retVal.PowershiftInertiaFactor = gearbox.PowerShiftInertiaFactor; + } retVal.DownshiftAfterUpshiftDelay = gearbox.DownshiftAferUpshiftDelay; retVal.UpshiftAfterDownshiftDelay = gearbox.UpshiftAfterDownshiftDelay; diff --git a/VectoCore/VectoCore/Models/Declaration/AirDrag.cs b/VectoCore/VectoCore/Models/Declaration/AirDrag.cs index 76c3f9991ef32740efe040a7ab909918b6f8ede8..73ed9de890811c868cc7048b5b1f476ec6c8c554 100644 --- a/VectoCore/VectoCore/Models/Declaration/AirDrag.cs +++ b/VectoCore/VectoCore/Models/Declaration/AirDrag.cs @@ -56,22 +56,6 @@ namespace TUGraz.VectoCore.Models.Declaration row => new Entry(row.ParseDouble("a1"), row.ParseDouble("a2"), row.ParseDouble("a3"))); } - public Entry Lookup(VehicleCategory category) - { - switch (category) { - case VehicleCategory.CityBus: - case VehicleCategory.InterurbanBus: - case VehicleCategory.Coach: - return Lookup("CoachBus"); - case VehicleCategory.Tractor: - return Lookup("TractorSemitrailer"); - case VehicleCategory.RigidTruck: - return Lookup("RigidSolo"); - default: - throw new ArgumentOutOfRangeException("category", category, null); - } - } - public class Entry { public double A1; diff --git a/VectoCore/VectoCore/Models/Declaration/Mission.cs b/VectoCore/VectoCore/Models/Declaration/Mission.cs index a11fccce4fbaecfac7f4a7790de744efc5a3c9ed..307e7b7a71dcc896f52ef0d8a9e8577867a93b77 100644 --- a/VectoCore/VectoCore/Models/Declaration/Mission.cs +++ b/VectoCore/VectoCore/Models/Declaration/Mission.cs @@ -63,7 +63,7 @@ namespace TUGraz.VectoCore.Models.Declaration public class Mission { public MissionType MissionType; - public string CrossWindCorrection; + public string CrossWindCorrectionParameters; public double[] AxleWeightDistribution; public double[] TrailerAxleWeightDistribution; diff --git a/VectoCore/VectoCore/Resources/Declaration/SegmentTable.csv b/VectoCore/VectoCore/Resources/Declaration/SegmentTable.csv index 1918214449d52452225539695b45cff3b9ed18d0..95cdc676c548054b29577978c3c88caca1396de1 100644 --- a/VectoCore/VectoCore/Resources/Declaration/SegmentTable.csv +++ b/VectoCore/VectoCore/Resources/Declaration/SegmentTable.csv @@ -1,29 +1,29 @@ -Valid,Vehicle Category,Axle Conf.,GVW_Min,GVW_Max,HDV class,Body,Trailer,Semitrailer,.vacc file,Cross Wind Correction - Long haul,Cross Wind Correction - Other,Truck Axles - Long haul,Truck Axles - Other,Trailer Axles - Long haul,Trailer Axles - Other,Long haul,Regional delivery,Urban delivery,Municipal utility,Construction,Heavy Urban,Urban,Suburban,Interurban,Coach -# @@@quam below 7.5t is not considered by VECTO atm. @@@ 0 ,RigidTruck ,4x2 ,0 ,7.5 ,0 , , , ,Truck.vacc, ,RigidSolo , , , , ,- ,pc(R) ,pc(R) ,- ,- ,- ,- ,- ,- ,- -1 ,RigidTruck ,4x2 ,7.5 ,10 ,1 ,B1 , , ,Truck.vacc, ,RigidSolo , ,45/55 , , ,- ,pc(R) ,pc(R) ,- ,- ,- ,- ,- ,- ,- -1 ,Tractor ,4x2 ,7.5 ,10 ,1 ,B1 , , ,Truck.vacc, ,RigidSolo , ,45/55 , , ,- ,pc(R) ,pc(R) ,- ,- ,- ,- ,- ,- ,- -1 ,RigidTruck ,4x2 ,10 ,12 ,2 ,B2 ,T1 , ,Truck.vacc,RigidTrailer ,RigidSolo ,22.5/32.5 ,45/55 ,45/1 , ,pc(R) ,pc(R) ,pc(R) ,- ,- ,- ,- ,- ,- ,- -1 ,Tractor ,4x2 ,10 ,12 ,2 ,B2 ,T1 , ,Truck.vacc,RigidTrailer ,RigidSolo ,22.5/32.5 ,45/55 ,45/1 , ,pc(R) ,pc(R) ,pc(R) ,- ,- ,- ,- ,- ,- ,- -1 ,RigidTruck ,4x2 ,12 ,16 ,3 ,B3 , , ,Truck.vacc, ,RigidSolo , ,40/60 , , ,- ,pc(R) ,pc(R) ,- ,- ,- ,- ,- ,- ,- -1 ,Tractor ,4x2 ,12 ,16 ,3 ,B3 , , ,Truck.vacc, ,RigidSolo , ,40/60 , , ,- ,pc(R) ,pc(R) ,- ,- ,- ,- ,- ,- ,- -1 ,RigidTruck ,4x2 ,16 ,99 ,4 ,B4 ,T2 , ,Truck.vacc,RigidTrailer ,RigidSolo ,20/30 ,45/55 ,50/2 , ,14000 ,4400 ,- ,4400 ,- ,- ,- ,- ,- ,- -1 ,Tractor ,4x2 ,16 ,99 ,5 , , ,ST1 ,Truck.vacc,TractorSemitrailer ,TractorSemitrailer ,20/25 ,25/25 ,55/3 ,50/3 ,19300 ,12900 ,- ,- ,- ,- ,- ,- ,- ,- -0 ,RigidTruck ,4x4 ,7.5 ,16 ,6 , , , ,Truck.vacc, ,RigidSolo , , , , ,- ,- ,- ,??? ,??? ,- ,- ,- ,- ,- -0 ,RigidTruck ,4x4 ,16 ,99 ,7 , , , ,Truck.vacc, ,RigidSolo , , , , ,- ,- ,- ,- ,??? ,- ,- ,- ,- ,- -0 ,Tractor ,4x4 ,16 ,99 ,8 , , , ,Truck.vacc, ,TractorSemitrailer , , , , ,- ,- ,- ,- ,??? ,- ,- ,- ,- ,- -1 ,RigidTruck ,6x2 ,0 ,99 ,9 ,B5 ,T2 , ,Truck.vacc,RigidTrailer ,RigidSolo ,20/30/15 ,35/40/25 ,35/2 , ,19300 ,7100 ,- ,7100 ,- ,- ,- ,- ,- ,- -1 ,Tractor ,6x2 ,0 ,99 ,10 , , ,ST1 ,Truck.vacc,TractorSemitrailer ,TractorSemitrailer ,15/10/20 ,20/10/20 ,55/2 ,50/2 ,19300 ,12900 ,- ,- ,- ,- ,- ,- ,- ,- -0 ,RigidTruck ,6x4 ,0 ,99 ,11 , , , ,Truck.vacc, ,RigidSolo , ,35/35/30 , , ,- ,- ,- ,- ,7100 ,- ,- ,- ,- ,- -0 ,Tractor ,6x4 ,0 ,99 ,12 , , , ,Truck.vacc, ,TractorSemitrailer , ,20/15/15 , ,50/2 ,- ,- ,- ,- ,12900 ,- ,- ,- ,- ,- -0 ,RigidTruck ,6x6 ,0 ,99 ,13 , , , ,Truck.vacc, ,RigidSolo , , , , ,- ,- ,- ,- ,??? ,- ,- ,- ,- ,- -0 ,Tractor ,6x6 ,0 ,99 ,14 , , , ,Truck.vacc, ,TractorSemitrailer , , , , ,- ,- ,- ,- ,??? ,- ,- ,- ,- ,- -0 ,RigidTruck ,8x2 ,0 ,99 ,15 , , , ,Truck.vacc, ,RigidSolo , , , , ,- ,??? ,- ,- ,- ,- ,- ,- ,- ,- -0 ,RigidTruck ,8x4 ,0 ,99 ,16 , , , ,Truck.vacc, ,RigidSolo , , , , ,- ,- ,- ,- ,12900 ,- ,- ,- ,- ,- -0 ,RigidTruck ,8x6 ,0 ,99 ,17 , , , ,Truck.vacc, ,RigidSolo , , , , ,- ,- ,- ,- ,??? ,- ,- ,- ,- ,- -0 ,RigidTruck ,8x8 ,0 ,99 ,17 , , , ,Truck.vacc, ,RigidSolo , , , , ,- ,- ,- ,- ,??? ,- ,- ,- ,- ,- -0 ,CityBus ,4x2 ,0 ,18 ,B1 , , , , , ,CoachBus , , , , ,- ,- ,- ,- ,- ,??? ,??? ,??? ,- ,- -0 ,InterurbanBus ,4x2 ,0 ,18 ,B2 , , , , , ,CoachBus , , , , ,- ,- ,- ,- ,- ,- ,- ,- ,??? ,- -0 ,Coach ,4x2 ,0 ,18 ,B3 , , , , , ,CoachBus , , , , ,- ,- ,- ,- ,- ,- ,- ,- ,- ,??? -0 ,CityBus ,6x2 ,18 ,99 ,B4 , , , , , ,CoachBus , , , , ,- ,- ,- ,- ,- ,??? ,??? ,??? ,- ,- -0 ,InterurbanBus ,6x2 ,18 ,99 ,B5 , , , , , ,CoachBus , , , , ,- ,- ,- ,- ,- ,- ,- ,- ,??? ,- -0 ,Coach ,6x2 ,18 ,99 ,B6 , , , , , ,CoachBus , , , , ,- ,- ,- ,- ,- ,- ,- ,- ,- ,??? \ No newline at end of file +Valid,Vehicle Category,Axle Conf.,GVW_Min,GVW_Max,HDV class,Body,Trailer,Semitrailer,.vacc file,Cross Wind Correction - Long haul,Cross Wind Correction - Other,Truck Axles - Long haul,Truck Axles - Other,Trailer Axles - Long haul,Trailer Axles - Other,Long haul,Regional delivery,Urban delivery,Municipal utility,Construction,Heavy Urban,Urban,Suburban,Interurban,Coach,CdxA Construction +# @@@quam below 7.5t is not considered by VECTO atm. @@@ 0 ,RigidTruck ,4x2 ,0 ,7.5 ,0 , , , ,Truck.vacc, ,RigidSolo , , , , ,- ,pc(R) ,pc(R) ,- ,- ,- ,- ,- ,- ,-, , +1 ,RigidTruck ,4x2 ,7.5 ,10 ,1 ,B1 , , ,Truck.vacc, ,RigidSolo , ,45/55 , , ,- ,pc(R) ,pc(R) ,- ,- ,- ,- ,- ,- ,- , +1 ,Tractor ,4x2 ,7.5 ,10 ,1 ,B1 , , ,Truck.vacc, ,RigidSolo , ,45/55 , , ,- ,pc(R) ,pc(R) ,- ,- ,- ,- ,- ,- ,- , +1 ,RigidTruck ,4x2 ,10 ,12 ,2 ,B2 ,T1 , ,Truck.vacc,RigidTrailer ,RigidSolo ,22.5/32.5 ,45/55 ,45/1 , ,pc(R) ,pc(R) ,pc(R) ,- ,- ,- ,- ,- ,- ,- , +1 ,Tractor ,4x2 ,10 ,12 ,2 ,B2 ,T1 , ,Truck.vacc,RigidTrailer ,RigidSolo ,22.5/32.5 ,45/55 ,45/1 , ,pc(R) ,pc(R) ,pc(R) ,- ,- ,- ,- ,- ,- ,- , +1 ,RigidTruck ,4x2 ,12 ,16 ,3 ,B3 , , ,Truck.vacc, ,RigidSolo , ,40/60 , , ,- ,pc(R) ,pc(R) ,- ,- ,- ,- ,- ,- ,- , +1 ,Tractor ,4x2 ,12 ,16 ,3 ,B3 , , ,Truck.vacc, ,RigidSolo , ,40/60 , , ,- ,pc(R) ,pc(R) ,- ,- ,- ,- ,- ,- ,- , +1 ,RigidTruck ,4x2 ,16 ,99 ,4 ,B4 ,T2 , ,Truck.vacc,RigidTrailer ,RigidSolo ,20/30 ,45/55 ,50/2 , ,14000 ,4400 ,- ,4400 ,- ,- ,- ,- ,- ,- , +1 ,Tractor ,4x2 ,16 ,99 ,5 , , ,ST1 ,Truck.vacc,TractorSemitrailer ,TractorSemitrailer ,20/25 ,25/25 ,55/3 ,50/3 ,19300 ,12900 ,- ,- ,- ,- ,- ,- ,- ,- , +0 ,RigidTruck ,4x4 ,7.5 ,16 ,6 , , , ,Truck.vacc, ,RigidSolo , , , , ,- ,- ,- ,??? ,??? ,- ,- ,- ,- ,- , +0 ,RigidTruck ,4x4 ,16 ,99 ,7 , , , ,Truck.vacc, ,RigidSolo , , , , ,- ,- ,- ,- ,??? ,- ,- ,- ,- ,- , +0 ,Tractor ,4x4 ,16 ,99 ,8 , , , ,Truck.vacc, ,TractorSemitrailer , , , , ,- ,- ,- ,- ,??? ,- ,- ,- ,- ,- , +1 ,RigidTruck ,6x2 ,0 ,99 ,9 ,B5 ,T2 , ,Truck.vacc,RigidTrailer ,RigidSolo ,20/30/15 ,35/40/25 ,35/2 , ,19300 ,7100 ,- ,7100 ,- ,- ,- ,- ,- ,- , +1 ,Tractor ,6x2 ,0 ,99 ,10 , , ,ST1 ,Truck.vacc,TractorSemitrailer ,TractorSemitrailer ,15/10/20 ,20/10/20 ,55/3 ,50/3 ,19300 ,12900 ,- ,- ,- ,- ,- ,- ,- ,- , +1 ,RigidTruck ,6x4 ,0 ,99 ,11 , ,T2 , ,Truck.vacc,RigidTrailer ,RigidSolo ,20/22.5/22.5 ,35/35/30 ,35/2 , ,19300 ,7100 ,- ,7100 ,7100 ,- ,- ,- ,- ,- ,8.5 +1 ,Tractor ,6x4 ,0 ,99 ,12 , , ,ST1 ,Truck.vacc,TractorSemitrailer ,TractorSemitrailer ,15/15/15 ,20/15/15 ,55/3 ,50/3 ,19300 ,7100 ,- ,7100 ,12900 ,- ,- ,- ,- ,- ,8.8 +0 ,RigidTruck ,6x6 ,0 ,99 ,13 , , , ,Truck.vacc, ,RigidSolo , , , , ,- ,- ,- ,- ,??? ,- ,- ,- ,- ,- , +0 ,Tractor ,6x6 ,0 ,99 ,14 , , , ,Truck.vacc, ,TractorSemitrailer , , , , ,- ,- ,- ,- ,??? ,- ,- ,- ,- ,- , +0 ,RigidTruck ,8x2 ,0 ,99 ,15 , , , ,Truck.vacc, ,RigidSolo , , , , ,- ,??? ,- ,- ,- ,- ,- ,- ,- ,- , +1 ,RigidTruck ,8x4 ,0 ,99 ,16 , , , ,Truck.vacc, ,RigidSolo , ,25/25/25/25 , , ,- ,- ,- ,- ,12900 ,- ,- ,- ,- ,- , +0 ,RigidTruck ,8x6 ,0 ,99 ,17 , , , ,Truck.vacc, ,RigidSolo , , , , ,- ,- ,- ,- ,??? ,- ,- ,- ,- ,- ,9.0 +0 ,RigidTruck ,8x8 ,0 ,99 ,17 , , , ,Truck.vacc, ,RigidSolo , , , , ,- ,- ,- ,- ,??? ,- ,- ,- ,- ,- , +0 ,CityBus ,4x2 ,0 ,18 ,B1 , , , , , ,CoachBus , , , , ,- ,- ,- ,- ,- ,??? ,??? ,??? ,- ,- , +0 ,InterurbanBus ,4x2 ,0 ,18 ,B2 , , , , , ,CoachBus , , , , ,- ,- ,- ,- ,- ,- ,- ,- ,??? ,- , +0 ,Coach ,4x2 ,0 ,18 ,B3 , , , , , ,CoachBus , , , , ,- ,- ,- ,- ,- ,- ,- ,- ,- ,??? , +0 ,CityBus ,6x2 ,18 ,99 ,B4 , , , , , ,CoachBus , , , , ,- ,- ,- ,- ,- ,??? ,??? ,??? ,- ,- , +0 ,InterurbanBus ,6x2 ,18 ,99 ,B5 , , , , , ,CoachBus , , , , ,- ,- ,- ,- ,- ,- ,- ,- ,??? ,- , +0 ,Coach ,6x2 ,18 ,99 ,B6 , , , , , ,CoachBus , , , , ,- ,- ,- ,- ,- ,- ,- ,- ,- ,??? , \ No newline at end of file diff --git a/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs b/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs index d89cc5fea9df442784c277a5fe2fefb23f60cccc..83c485122262379f60b1dcce05099bc219ca7307 100644 --- a/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs +++ b/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs @@ -174,52 +174,51 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration Assert.AreEqual(a3, value.A3); } - [TestCase(VehicleCategory.RigidTruck, 0.013526, 0.017746, -0.000666), - TestCase(VehicleCategory.Tractor, 0.030042, 0.040817, -0.00213), - TestCase(VehicleCategory.CityBus, -0.000794, 0.02109, -0.00109), - TestCase(VehicleCategory.Coach, -0.000794, 0.02109, -0.00109), - TestCase(VehicleCategory.InterurbanBus, -0.000794, 0.02109, -0.00109)] - public void AirDrag_WithVehicleCategory(VehicleCategory cat, double a1, double a2, double a3) - { - var value = DeclarationData.AirDrag.Lookup(cat); + [TestCase("RigidSolo", 0.013526, 0.017746, -0.000666), + TestCase("TractorSemitrailer", 0.030042, 0.040817, -0.00213), + TestCase("RigidTrailer", 0.017125, 0.072275, -0.004148), + TestCase("CoachBus", -0.000794, 0.02109, -0.00109)] + public void AirDrag_WithVehicleCategory(string parameterSet, double a1, double a2, double a3) + { + var value = DeclarationData.AirDrag.Lookup(parameterSet); Assert.AreEqual(a1, value.A1); Assert.AreEqual(a2, value.A2); Assert.AreEqual(a3, value.A3); } - [TestCase(VehicleCategory.Tractor, 6.46, 0, 8.05913), - TestCase(VehicleCategory.Tractor, 6.46, 60, 8.05913), - TestCase(VehicleCategory.Tractor, 6.46, 75, 7.639436), - TestCase(VehicleCategory.Tractor, 6.46, 100, 7.22305), - TestCase(VehicleCategory.Tractor, 6.46, 52.1234, 8.059126), - TestCase(VehicleCategory.Tractor, 6.46, 73.5432, 7.67487), - TestCase(VehicleCategory.Tractor, 6.46, 92.8765, 7.317215), - TestCase(VehicleCategory.Tractor, 6.46, 100.449, 7.217975), - TestCase(VehicleCategory.Tractor, 6.46, 103, 7.18915), - TestCase(VehicleCategory.Tractor, 6.46, 105, 7.166555), - TestCase(VehicleCategory.Tractor, 6.46, 115, 7.071136), - TestCase(VehicleCategory.Tractor, 6.46, 130, 6.961237),] - public void CrossWindCorrectionTest(VehicleCategory vehicleCategory, double crossSectionArea, double kmph, + [TestCase("TractorSemitrailer", 6.46, 0, 8.05913), + TestCase("TractorSemitrailer", 6.46, 60, 8.05913), + TestCase("TractorSemitrailer", 6.46, 75, 7.639436), + TestCase("TractorSemitrailer", 6.46, 100, 7.22305), + TestCase("TractorSemitrailer", 6.46, 52.1234, 8.059126), + TestCase("TractorSemitrailer", 6.46, 73.5432, 7.67487), + TestCase("TractorSemitrailer", 6.46, 92.8765, 7.317215), + TestCase("TractorSemitrailer", 6.46, 100.449, 7.217975), + TestCase("TractorSemitrailer", 6.46, 103, 7.18915), + TestCase("TractorSemitrailer", 6.46, 105, 7.166555), + TestCase("TractorSemitrailer", 6.46, 115, 7.071136), + TestCase("TractorSemitrailer", 6.46, 130, 6.961237),] + public void CrossWindCorrectionTest(string parameterSet, double crossSectionArea, double kmph, double expected) { var crossWindCorrectionCurve = new CrosswindCorrectionCdxALookup( - DeclarationDataAdapter.GetDeclarationAirResistanceCurve(vehicleCategory, crossSectionArea.SI<SquareMeter>()), + DeclarationDataAdapter.GetDeclarationAirResistanceCurve(parameterSet, crossSectionArea.SI<SquareMeter>()), CrossWindCorrectionMode.DeclarationModeCorrection); var tmp = crossWindCorrectionCurve.EffectiveAirDragArea(kmph.KMPHtoMeterPerSecond()); Assert.AreEqual(expected, tmp.Value(), Tolerance); } - [TestCase(VehicleCategory.Tractor, 6.46, -0.1), - TestCase(VehicleCategory.Tractor, 6.46, 130.1),] - public void CrossWindCorrectionExceptionTest(VehicleCategory vehicleCategory, double crossSectionArea, double kmph) + [TestCase("TractorSemitrailer", 6.46, -0.1), + TestCase("TractorSemitrailer", 6.46, 130.1),] + public void CrossWindCorrectionExceptionTest(string parameterSet, double crossSectionArea, double kmph) { var crossWindCorrectionCurve = new CrosswindCorrectionCdxALookup( - DeclarationDataAdapter.GetDeclarationAirResistanceCurve(vehicleCategory, crossSectionArea.SI<SquareMeter>()), + DeclarationDataAdapter.GetDeclarationAirResistanceCurve(parameterSet, crossSectionArea.SI<SquareMeter>()), CrossWindCorrectionMode.DeclarationModeCorrection); AssertHelper.Exception<VectoException>(() => - crossWindCorrectionCurve.EffectiveAirDragArea(kmph.KMPHtoMeterPerSecond())); + crossWindCorrectionCurve.EffectiveAirDragArea(kmph.KMPHtoMeterPerSecond())); } [TestCase(MissionType.LongHaul, "Standard technology", 1200, 0.7), @@ -434,11 +433,11 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration public void SegmentWeightOutOfRange4X2(double weight) { AssertHelper.Exception<VectoException>(() => - DeclarationData.Segments.Lookup( - VehicleCategory.RigidTruck, - AxleConfiguration.AxleConfig_4x2, - weight.SI<Kilogram>(), - 0.SI<Kilogram>()), + DeclarationData.Segments.Lookup( + VehicleCategory.RigidTruck, + AxleConfiguration.AxleConfig_4x2, + weight.SI<Kilogram>(), + 0.SI<Kilogram>()), "Gross vehicle mass must be greater than 7.5 tons"); } @@ -451,11 +450,11 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration public void SegmentWeightOutOfRange4X4(double weight) { AssertHelper.Exception<VectoException>(() => - DeclarationData.Segments.Lookup( - VehicleCategory.RigidTruck, - AxleConfiguration.AxleConfig_4x4, - weight.SI<Kilogram>(), - 0.SI<Kilogram>()), + DeclarationData.Segments.Lookup( + VehicleCategory.RigidTruck, + AxleConfiguration.AxleConfig_4x4, + weight.SI<Kilogram>(), + 0.SI<Kilogram>()), "Gross vehicle mass must be greater than 7.5 tons"); } @@ -650,7 +649,7 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration double trailerGrossVehicleWeight, double deltaCdA) { Assert.AreEqual(missionType, m.MissionType); - Assert.AreEqual(cosswindCorrection, m.CrossWindCorrection); + Assert.AreEqual(cosswindCorrection, m.CrossWindCorrectionParameters); CollectionAssert.AreEqual(axleWeightDistribution, m.AxleWeightDistribution, "Axle distribution not equal.\nexpected: {0}\nactual: {1}", string.Join(",", axleWeightDistribution), string.Join(",", m.AxleWeightDistribution));