Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit a537fe44 authored by Markus QUARITSCH's avatar Markus QUARITSCH
Browse files

validation of vehicle data: validate total rolling resistance on object...

validation of vehicle data: validate total rolling resistance on object validation (not via property), check tyre test load for each axle
parent d1545286
No related branches found
No related tags found
No related merge requests found
......@@ -85,7 +85,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data
/// <summary>
/// The Gross Vehicle Weight of the Vehicle.
/// </summary>
[Required, SIRange(3500, 40000, ExecutionMode.Declaration), SIRange(0, 1000000, ExecutionMode.Engineering)]
[Required,
SIRange(3500, 40000, ExecutionMode.Declaration),
SIRange(0, 1000000, ExecutionMode.Engineering)]
public Kilogram GrossVehicleWeight { get; internal set; }
/// <summary>
......@@ -109,7 +111,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data
internal set { _wheelsInertia = value; }
}
[Required, SIRange(0, 1E12)]
//[Required, SIRange(0, 1E12)]
public double TotalRollResistanceCoefficient
{
get
......@@ -155,11 +157,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data
foreach (var axle in _axleData) {
var nrWheels = axle.TwinTyres ? 4 : 2;
var baseValue = (axle.AxleWeightShare * TotalVehicleWeight() * g / axle.TyreTestLoad / nrWheels).Value();
if (baseValue.IsEqual(0)) {
throw new VectoSimulationException(
"Axle Roll Resistance Coefficient could not be calculated. One of the values is 0: AxleWeightShare: {0}, TotalVehicleWeight: {1}, TyreTestLoad: {2}, nrWheels: {3}",
axle.AxleWeightShare, TotalVehicleWeight(), axle.TyreTestLoad, nrWheels);
}
//if (baseValue.IsEqual(0)) {
// throw new VectoSimulationException(
// "Axle Roll Resistance Coefficient could not be calculated. One of the values is 0: AxleWeightShare: {0}, TotalVehicleWeight: {1}, TyreTestLoad: {2}, nrWheels: {3}",
// axle.AxleWeightShare, TotalVehicleWeight(), axle.TyreTestLoad, nrWheels);
//}
rrc += axle.AxleWeightShare * axle.RollResistanceCoefficient *
Math.Pow(baseValue, Physics.RollResistanceExponent - 1);
wheelsInertia += nrWheels * axle.Inertia;
......@@ -178,6 +180,18 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data
string.Format("Sum of axle weight share is not 1! sum: {0}, difference: {1}",
weightShareSum, 1 - weightShareSum));
}
for (var i = 0; i < vehicleData.AxleData.Count; i++) {
if (vehicleData.AxleData[i].TyreTestLoad.IsSmallerOrEqual(0)) {
return new ValidationResult(string.Format("Tyre test load (FzISO) for axle {0} must be greater than 0.", i));
}
}
if (vehicleData.TotalRollResistanceCoefficient <= 0) {
return
new ValidationResult(string.Format("Total rolling resistance must be greater than 0! {0}",
vehicleData.TotalRollResistanceCoefficient));
}
// total gvw is limited by max gvw (40t)
var gvwTotal = VectoMath.Min(vehicleData.GrossVehicleWeight + vehicleData.TrailerGrossVehicleWeight,
......@@ -185,6 +199,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data
if (mode != ExecutionMode.Declaration) {
return ValidationResult.Success;
}
// vvvvvvv these checks apply only for declaration mode! vvvvvv
if (vehicleData.TotalVehicleWeight() > gvwTotal) {
return new ValidationResult(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment