Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 5bafd1bf authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

moving wheels inertia to wheels component

parent df8f36ff
Branches
Tags
No related merge requests found
......@@ -54,7 +54,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data
public Kilogram Loading { get; internal set; }
public Kilogram GrossVehicleMassRating { get; internal set; }
public Meter DynamicTyreRadius { get; internal set; }
public Kilogram ReducedMassWheels { get; private set; }
public KilogramSquareMeter WheelsInertia { get; internal set; }
// public Kilogram ReducedMassWheels { get; private set; }
public string Rim { get; internal set; }
public double TotalRollResistanceCoefficient { get; private set; }
......@@ -86,7 +87,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data
}
var RRC = 0.0;
var mRed0 = 0.SI<Kilogram>();
var wheelsInertia = 0.SI<KilogramSquareMeter>();
foreach (var axle in _axleData) {
var nrWheels = axle.TwinTyres ? 4 : 2;
RRC += axle.AxleWeightShare * axle.RollResistanceCoefficient *
......@@ -94,10 +95,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data
(axle.AxleWeightShare * TotalVehicleWeight() * Physics.GravityAccelleration /
axle.TyreTestLoad /
nrWheels).Value(), Physics.RollResistanceExponent - 1);
mRed0 += nrWheels * (axle.Inertia / DynamicTyreRadius / DynamicTyreRadius).Cast<Kilogram>();
wheelsInertia += nrWheels * axle.Inertia;
}
TotalRollResistanceCoefficient = RRC;
ReducedMassWheels = mRed0;
WheelsInertia = wheelsInertia;
}
}
}
\ No newline at end of file
......@@ -49,6 +49,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
public IResponse Initialize(MeterPerSecond vehicleSpeed, Radian roadGradient)
{
// ReSharper disable once UseObjectOrCollectionInitializer @@@ computation of AirDragResistance (below) needs VecicleSpeed!
_previousState = new VehicleState {
Distance = DataBus.CycleStartDistance,
Velocity = vehicleSpeed,
......@@ -211,7 +212,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
protected Newton DriverAcceleration(MeterPerSquareSecond accelleration)
{
var retVal = ((_data.TotalVehicleWeight() + _data.ReducedMassWheels) * accelleration).Cast<Newton>();
var retVal = (_data.TotalVehicleWeight() * accelleration).Cast<Newton>();
Log.Debug("DriverAcceleration: {0}", retVal);
return retVal;
}
......
......@@ -17,6 +17,7 @@
*/
using System;
using NLog.Fluent;
using TUGraz.VectoCore.Models.Connector.Ports;
using TUGraz.VectoCore.Models.Simulation;
using TUGraz.VectoCore.Models.Simulation.Data;
......@@ -28,14 +29,17 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
public class Wheels : VectoSimulationComponent, IWheels, IFvOutPort, ITnInPort
{
protected ITnOutPort NextComponent;
private readonly Meter _dynamicWheelRadius;
private readonly KilogramSquareMeter _totalWheelsInertia;
protected Watt WheelsPowerRequest { get; set; }
public Wheels(IVehicleContainer cockpit, Meter rdyn)
public Wheels(IVehicleContainer cockpit, Meter rdyn, KilogramSquareMeter totalWheelsInertia)
: base(cockpit)
{
_dynamicWheelRadius = rdyn;
_totalWheelsInertia = totalWheelsInertia;
}
#region IFvOutProvider
......@@ -62,6 +66,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
{
Log.Debug("request: force: {0}, velocity: {1}", force, velocity);
var torque = force * _dynamicWheelRadius;
var inertiaLoss = _totalWheelsInertia;
var angularVelocity = velocity / _dynamicWheelRadius;
WheelsPowerRequest = torque * angularVelocity;
var retVal = NextComponent.Request(absTime, dt, torque, angularVelocity, dryRun);
......@@ -102,5 +107,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
}
#endregion
public class WheelsState
{
public MeterPerSquareSecond AngularVelocity;
}
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment