diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/AbstractSimulationDataAdapter.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/AbstractSimulationDataAdapter.cs index b9d0050d2aa729d6ed5a1a62b08d5e8671bb8746..375727b677541273cfd5e4a100a79d508de9b663 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/AbstractSimulationDataAdapter.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/AbstractSimulationDataAdapter.cs @@ -63,7 +63,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdaper CurbWeight = data.CurbWeightChassis, //CurbWeigthExtra = data.CurbWeightExtra.SI<Kilogram>(), //Loading = data.Loading.SI<Kilogram>(), - GrossVehicleMassRating = data.GrossVehicleMassRating, + GrossVehicleWeight = data.GrossVehicleMassRating, //DragCoefficient = data.DragCoefficient, //CrossSectionArea = data.CrossSectionArea.SI<SquareMeter>(), //DragCoefficientRigidTruck = data.DragCoefficientRigidTruck, diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs index 6293973db8944da269fa6d63e340dd6eaa4eed50..94d1ea890620ea1e4e26969aeee9cd4f2bb8b3e8 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs @@ -94,9 +94,9 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdaper } var retVal = SetCommonVehicleData(data); - retVal.GrossVehicleMassRating = data.GrossVehicleMassRating; - retVal.TrailerGrossVehicleMassRating = mission.TrailerGrossVehicleWeight; - retVal.CurbWeigthExtra = mission.BodyCurbWeight + mission.TrailerCurbWeight; + retVal.GrossVehicleWeight = data.GrossVehicleMassRating; + retVal.TrailerGrossVehicleWeight = mission.TrailerGrossVehicleWeight; + retVal.CurbWeight += mission.BodyCurbWeight + mission.TrailerCurbWeight; retVal.Loading = loading; retVal.DynamicTyreRadius = DeclarationData.DynamicTyreRadius(data.Axles[DeclarationData.PoweredAxle()].Wheels, data.Rim); diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs index fd38c2c1c3f6fc3b16a7e530bddd5f6687674688..7fd40021fb5e97c3a691e3bdc6ff7ba416c114f3 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs @@ -56,7 +56,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdaper var retVal = SetCommonVehicleData(data); - retVal.CurbWeigthExtra = data.CurbWeightExtra; + retVal.CurbWeight += data.CurbWeightExtra; retVal.Loading = data.Loading; retVal.DynamicTyreRadius = data.DynamicTyreRadius; retVal.CrossWindCorrectionMode = data.CrossWindCorrectionMode; diff --git a/VectoCore/VectoCore/Models/Declaration/Segments.cs b/VectoCore/VectoCore/Models/Declaration/Segments.cs index 5ed97658462b1bd06036764e514f7fe0efecf05d..07294080960e31fc0d65108f6237a9669e25d60f 100644 --- a/VectoCore/VectoCore/Models/Declaration/Segments.cs +++ b/VectoCore/VectoCore/Models/Declaration/Segments.cs @@ -84,7 +84,7 @@ namespace TUGraz.VectoCore.Models.Declaration }); } catch (InvalidOperationException e) { var errorMessage = string.Format( - "ERROR: Could not find the declaration segment for vehicle. Category: {0}, AxleConfiguration: {1}, GrossVehicleMassRating: {2}", + "ERROR: Could not find the declaration segment for vehicle. Category: {0}, AxleConfiguration: {1}, GrossVehicleWeight: {2}", vehicleCategory, axleConfiguration.GetName(), grossVehicleMassRating); Log.Fatal(errorMessage); throw new VectoException(errorMessage, e); diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/VehicleData.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/VehicleData.cs index f39b379093b474c7fc34cea1d3a620af8f49422d..3f21d3baf2d6d7b1cc3eb45ecdbdd31d544886a7 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/VehicleData.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/VehicleData.cs @@ -36,6 +36,7 @@ using System.Linq; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.Configuration; using TUGraz.VectoCore.Models.Declaration; using TUGraz.VectoCore.Utils; @@ -49,13 +50,14 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data { public VehicleCategory VehicleCategory { get; internal set; } public VehicleClass VehicleClass { get; internal set; } + public AxleConfiguration AxleConfiguration { get; internal set; } [Required, ValidateObject] public ICrossWindCorrection CrossWindCorrectionCurve { get; internal set; } private List<Axle> _axleData; - [ValidateObject] + [Required, ValidateObject] public List<Axle> AxleData { get { return _axleData; } @@ -66,22 +68,28 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data } } - public AxleConfiguration AxleConfiguration { get; internal set; } - + /// <summary> + /// The Curb Weight of the vehicle + /// (+ Curb Weight of Standard-Body if it has one) + /// (+ Curb Weight of Trailer if it has one) + /// </summary> [Required, SIRange(500, 40000)] public Kilogram CurbWeight { get; internal set; } - [Required, SIRange(0, 40000)] - public Kilogram CurbWeigthExtra { get; internal set; } - [Required, SIRange(0, 40000)] public Kilogram Loading { get; internal set; } + /// <summary> + /// The Gross Vehicle Weight of the Vehicle. + /// </summary> [Required, SIRange(3500, 40000)] - public Kilogram GrossVehicleMassRating { get; internal set; } + public Kilogram GrossVehicleWeight { get; internal set; } + /// <summary> + /// The Gross Vehicle Weight of the Trailer (if the vehicle has one). + /// </summary> [Required, SIRange(0, 40000)] - public Kilogram TrailerGrossVehicleMassRating { get; internal set; } + public Kilogram TrailerGrossVehicleWeight { get; internal set; } [Required, SIRange(0.1, 0.7)] public Meter DynamicTyreRadius { get; internal set; } @@ -99,7 +107,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data { var retVal = 0.SI<Kilogram>(); retVal += CurbWeight ?? 0.SI<Kilogram>(); - retVal += CurbWeigthExtra ?? 0.SI<Kilogram>(); retVal += Loading ?? 0.SI<Kilogram>(); return retVal; } @@ -108,7 +115,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data { var retVal = 0.SI<Kilogram>(); retVal += CurbWeight ?? 0.SI<Kilogram>(); - retVal += CurbWeigthExtra ?? 0.SI<Kilogram>(); return retVal; } @@ -150,10 +156,13 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data weightShareSum, 1 - weightShareSum)); } - var gvwTotal = vehicleData.GrossVehicleMassRating + vehicleData.TrailerGrossVehicleMassRating; + // total gvw is limited by max gvw (40t) + var gvwTotal = VectoMath.Min(vehicleData.GrossVehicleWeight + vehicleData.TrailerGrossVehicleWeight, + Constants.SimulationSettings.MaximumGrossVehicleWeight); + if (vehicleData.TotalVehicleWeight() > gvwTotal) { return new ValidationResult( - string.Format("Total Vehicle Weight is greater than GrossVehicleMassRating! sum: {0}, GVM: {1}", + string.Format("Total Vehicle Weight is greater than GrossVehicleWeight! Weight: {0}, GVW: {1}", vehicleData.TotalVehicleWeight(), gvwTotal)); } diff --git a/VectoCore/VectoCoreTest/FileIO/SimulationDataReaderTest.cs b/VectoCore/VectoCoreTest/FileIO/SimulationDataReaderTest.cs index 9375c4e2fd51db5785e8745b64cd3f506c597325..b30076229cd2aab663ecb9a5edf29670a8d2f605 100644 --- a/VectoCore/VectoCoreTest/FileIO/SimulationDataReaderTest.cs +++ b/VectoCore/VectoCoreTest/FileIO/SimulationDataReaderTest.cs @@ -64,9 +64,8 @@ namespace TUGraz.VectoCore.Tests.FileIO Assert.AreEqual(ExecutionMode.Declaration, runData.ExecutionMode); Assert.AreEqual(Path.GetFileNameWithoutExtension(DeclarationJob), runData.JobName); - Assert.AreEqual(5850, runData.VehicleData.CurbWeight.Value()); - Assert.AreEqual(1900, runData.VehicleData.CurbWeigthExtra.Value()); // taken from segmentation table - Assert.AreEqual(11900, runData.VehicleData.GrossVehicleMassRating.Value()); + Assert.AreEqual(5850 + 1900, runData.VehicleData.CurbWeight.Value()); + Assert.AreEqual(11900, runData.VehicleData.GrossVehicleWeight.Value()); Assert.AreEqual(AxleConfiguration.AxleConfig_4x2, runData.VehicleData.AxleConfiguration); Assert.AreEqual(0.4069297458, runData.VehicleData.DynamicTyreRadius.Value(), Tolerance); @@ -116,9 +115,6 @@ namespace TUGraz.VectoCore.Tests.FileIO runData.GearboxData.Gears[1].ShiftPolygon.Upshift[i].AngularSpeed.Value(), Tolerance); Assert.AreEqual(upshiftTorque[i], runData.GearboxData.Gears[1].ShiftPolygon.Upshift[i].Torque.Value(), Tolerance); } - //Assert.AreEqual(); - - //Assert.AreEqual(, runData.DriverData.LookAheadCoasting.); } } diff --git a/VectoCore/VectoCoreTest/Integration/CoachAdvancedAuxPowertrain.cs b/VectoCore/VectoCoreTest/Integration/CoachAdvancedAuxPowertrain.cs index 9941976d6a144b6b6edc04eead10ee9330373f87..9bb267469f46dcd4217980d2537821ef55deea85 100644 --- a/VectoCore/VectoCoreTest/Integration/CoachAdvancedAuxPowertrain.cs +++ b/VectoCore/VectoCoreTest/Integration/CoachAdvancedAuxPowertrain.cs @@ -184,7 +184,6 @@ namespace TUGraz.VectoCore.Tests.Integration new CrosswindCorrectionCdxALookup(CrossWindCorrectionCurveReader.GetNoCorrectionCurve(3.2634.SI<SquareMeter>()), CrossWindCorrectionMode.NoCorrection), CurbWeight = 15700.SI<Kilogram>(), - CurbWeigthExtra = 0.SI<Kilogram>(), Loading = loading, DynamicTyreRadius = 0.52.SI<Meter>(), AxleData = axles, diff --git a/VectoCore/VectoCoreTest/Integration/CoachPowerTrain.cs b/VectoCore/VectoCoreTest/Integration/CoachPowerTrain.cs index 1e3b75436b8d3764fd0716b5a82d936466bed8cd..d4131dbac7c50dba4fb9406cacddef30d989c191 100644 --- a/VectoCore/VectoCoreTest/Integration/CoachPowerTrain.cs +++ b/VectoCore/VectoCoreTest/Integration/CoachPowerTrain.cs @@ -187,7 +187,6 @@ namespace TUGraz.VectoCore.Tests.Integration new CrosswindCorrectionCdxALookup(CrossWindCorrectionCurveReader.GetNoCorrectionCurve(3.2634.SI<SquareMeter>()), CrossWindCorrectionMode.NoCorrection), CurbWeight = 15700.SI<Kilogram>(), - CurbWeigthExtra = 0.SI<Kilogram>(), Loading = loading, DynamicTyreRadius = 0.52.SI<Meter>(), AxleData = axles, diff --git a/VectoCore/VectoCoreTest/Integration/SimulationRuns/FullPowertrain.cs b/VectoCore/VectoCoreTest/Integration/SimulationRuns/FullPowertrain.cs index f3ced4885b94dabe13f729c83692f8c45356f349..f59a8b772a0965122d947df4db48a8b907a7e2d9 100644 --- a/VectoCore/VectoCoreTest/Integration/SimulationRuns/FullPowertrain.cs +++ b/VectoCore/VectoCoreTest/Integration/SimulationRuns/FullPowertrain.cs @@ -387,7 +387,6 @@ namespace TUGraz.VectoCore.Tests.Integration.SimulationRuns new CrosswindCorrectionCdxALookup(CrossWindCorrectionCurveReader.GetNoCorrectionCurve(3.2634.SI<SquareMeter>()), CrossWindCorrectionMode.NoCorrection), CurbWeight = 15700.SI<Kilogram>(), - CurbWeigthExtra = 0.SI<Kilogram>(), Loading = loading, DynamicTyreRadius = 0.52.SI<Meter>(), AxleData = axles, diff --git a/VectoCore/VectoCoreTest/Integration/SimulationRuns/MinimalPowertrain.cs b/VectoCore/VectoCoreTest/Integration/SimulationRuns/MinimalPowertrain.cs index 1cbd26fbef50660e60cb50d77403655d5d909e75..715e9716c38b3a6b9b562eb2b1fd914129d972e1 100644 --- a/VectoCore/VectoCoreTest/Integration/SimulationRuns/MinimalPowertrain.cs +++ b/VectoCore/VectoCoreTest/Integration/SimulationRuns/MinimalPowertrain.cs @@ -99,8 +99,8 @@ namespace TUGraz.VectoCore.Tests.Integration.SimulationRuns Assert.IsInstanceOfType(response, typeof(ResponseSuccess)); -// time [s] , dist [m] , v_act [km/h] , v_targ [km/h] , acc [m/s²] , grad [%] , n_eng_avg [1/min] , T_eng_fcmap [Nm] , Tq_clutch [Nm] , Tq_full [Nm] , Tq_drag [Nm] , P_eng_out [kW] , P_eng_full [kW] , P_eng_drag [kW] , P_clutch_out [kW] , Pa Eng [kW] , P_aux [kW] , Gear [-] , Ploss GB [kW] , Ploss Diff [kW] , Ploss Retarder [kW] , Pa GB [kW] , Pa Veh [kW] , P_roll [kW] , P_air [kW] , P_slope [kW] , P_wheel_in [kW] , P_brake_loss [kW] , FC-Map [g/h] , FC-AUXc [g/h] , FC-WHTCc [g/h] -// 1.5 , 5 , 18 , 18 , 0 , 2.842372 , 964.1117 , 323.7562 , 323.7562 , 2208.664 , -158.0261 , 32.68693 , 222.9902 , -15.95456 , 32.68693 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 5.965827 , 0.2423075 , 26.47879 , 32.68693 , 0 , 7574.113 , - , - + // time [s] , dist [m] , v_act [km/h] , v_targ [km/h] , acc [m/s²] , grad [%] , n_eng_avg [1/min] , T_eng_fcmap [Nm] , Tq_clutch [Nm] , Tq_full [Nm] , Tq_drag [Nm] , P_eng_out [kW] , P_eng_full [kW] , P_eng_drag [kW] , P_clutch_out [kW] , Pa Eng [kW] , P_aux [kW] , Gear [-] , Ploss GB [kW] , Ploss Diff [kW] , Ploss Retarder [kW] , Pa GB [kW] , Pa Veh [kW] , P_roll [kW] , P_air [kW] , P_slope [kW] , P_wheel_in [kW] , P_brake_loss [kW] , FC-Map [g/h] , FC-AUXc [g/h] , FC-WHTCc [g/h] + // 1.5 , 5 , 18 , 18 , 0 , 2.842372 , 964.1117 , 323.7562 , 323.7562 , 2208.664 , -158.0261 , 32.68693 , 222.9902 , -15.95456 , 32.68693 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 5.965827 , 0.2423075 , 26.47879 , 32.68693 , 0 , 7574.113 , - , - AssertHelper.AreRelativeEqual(964.1117.RPMtoRad().Value(), vehicleContainer.Engine.EngineSpeed.Value()); Assert.AreEqual(2208.664, engine.PreviousState.StationaryFullLoadTorque.Value(), Tolerance); @@ -286,7 +286,6 @@ namespace TUGraz.VectoCore.Tests.Integration.SimulationRuns new CrosswindCorrectionCdxALookup(CrossWindCorrectionCurveReader.GetNoCorrectionCurve(3.2634.SI<SquareMeter>()), CrossWindCorrectionMode.NoCorrection), CurbWeight = 15700.SI<Kilogram>(), - CurbWeigthExtra = 0.SI<Kilogram>(), Loading = loading, DynamicTyreRadius = 0.52.SI<Meter>(), AxleData = axles, diff --git a/VectoCore/VectoCoreTest/Integration/Truck40tPowerTrain.cs b/VectoCore/VectoCoreTest/Integration/Truck40tPowerTrain.cs index 90e513ca4f381fddb3e163d47f4b0ad35fc489dd..f292ba05c5d993abc9dfb159d9406da9ee5d2b69 100644 --- a/VectoCore/VectoCoreTest/Integration/Truck40tPowerTrain.cs +++ b/VectoCore/VectoCoreTest/Integration/Truck40tPowerTrain.cs @@ -217,8 +217,7 @@ namespace TUGraz.VectoCore.Tests.Integration CrossWindCorrectionCurve = new CrosswindCorrectionCdxALookup(CrossWindCorrectionCurveReader.GetNoCorrectionCurve(6.2985.SI<SquareMeter>()), CrossWindCorrectionMode.NoCorrection), - CurbWeight = 7100.SI<Kilogram>(), - CurbWeigthExtra = massExtra, + CurbWeight = 7100.SI<Kilogram>() + massExtra, Loading = loading, DynamicTyreRadius = 0.4882675.SI<Meter>(), AxleData = axles, diff --git a/VectoCore/VectoCoreTest/Models/SimulationComponent/DriverTest.cs b/VectoCore/VectoCoreTest/Models/SimulationComponent/DriverTest.cs index 8864a78dbff2b80acb469769e483f89490b71dec..ef309e5375f01e4484a32886b0d506da0c13d5e4 100644 --- a/VectoCore/VectoCoreTest/Models/SimulationComponent/DriverTest.cs +++ b/VectoCore/VectoCoreTest/Models/SimulationComponent/DriverTest.cs @@ -246,7 +246,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent var targetVelocity = 5.SI<MeterPerSecond>(); -// var response = driver.OutPort().Request(absTime, ds, targetVelocity, gradient); + // var response = driver.OutPort().Request(absTime, ds, targetVelocity, gradient); var accelerations = new[] { 1.01570922, 1.384540943, 1.364944972, 1.350793466, 1.331848649, 1.314995215, 1.2999934, @@ -314,7 +314,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent var targetVelocity = 0.SI<MeterPerSecond>(); -// var response = driver.OutPort().Request(absTime, ds, targetVelocity, gradient); + // var response = driver.OutPort().Request(absTime, ds, targetVelocity, gradient); var accelerations = new[] { -0.68799597, -0.690581291, -0.693253225, -0.696020324, -0.698892653, -0.701882183, -0.695020765, @@ -392,7 +392,6 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent new CrosswindCorrectionCdxALookup(CrossWindCorrectionCurveReader.GetNoCorrectionCurve(3.2634.SI<SquareMeter>()), CrossWindCorrectionMode.NoCorrection), CurbWeight = 15700.SI<Kilogram>(), - CurbWeigthExtra = 0.SI<Kilogram>(), Loading = loading, DynamicTyreRadius = 0.52.SI<Meter>(), AxleData = axles,