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

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

engine: write engine power demand only if not set (by e.g. pto controller);

fix: auxiliary don't store powerdemand for mapping aux in current state on dry-run
clutch: initialize clutch-loss to 0 by default
cleanup summary data container
parent 8de98869
No related branches found
No related tags found
No related merge requests found
Showing
with 162 additions and 166 deletions
......@@ -42,6 +42,7 @@ using TUGraz.VectoCore.Models.Simulation.DataBus;
using TUGraz.VectoCore.Models.SimulationComponent;
using TUGraz.VectoCore.Models.SimulationComponent.Data;
using TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox;
using TUGraz.VectoCore.Models.SimulationComponent.Impl;
using TUGraz.VectoCore.OutputData;
using TUGraz.VectoCore.Utils;
......@@ -74,17 +75,14 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
#region IGearCockpit
public GearboxType GearboxType
{
public GearboxType GearboxType {
get { return Gearbox == null ? GearboxType.MT : Gearbox.GearboxType; }
}
public uint Gear
{
public uint Gear {
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design",
"CA1065:DoNotRaiseExceptionsInUnexpectedLocations")]
get
{
get {
if (Gearbox == null) {
throw new VectoException("no gearbox available!");
}
......@@ -92,12 +90,10 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
}
}
public MeterPerSecond StartSpeed
{
public MeterPerSecond StartSpeed {
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design",
"CA1065:DoNotRaiseExceptionsInUnexpectedLocations")]
get
{
get {
if (Gearbox == null) {
throw new VectoException("No Gearbox available. StartSpeed unkown");
}
......@@ -105,12 +101,10 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
}
}
public MeterPerSquareSecond StartAcceleration
{
public MeterPerSquareSecond StartAcceleration {
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design",
"CA1065:DoNotRaiseExceptionsInUnexpectedLocations")]
get
{
get {
if (Gearbox == null) {
throw new VectoException("No Gearbox available. StartAcceleration unknown.");
}
......@@ -118,8 +112,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
}
}
public NewtonMeter GearMaxTorque
{
public NewtonMeter GearMaxTorque {
get { return Gearbox != null ? Gearbox.GearMaxTorque : null; }
}
......@@ -128,8 +121,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
return Gearbox.GearboxLoss();
}
public Second LastShift
{
public Second LastShift {
get { return Gearbox.LastShift; }
}
......@@ -138,13 +130,11 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
return Gearbox.GetGearData(gear);
}
public GearInfo NextGear
{
public GearInfo NextGear {
get { return Gearbox.NextGear; }
}
public Second TractionInterruption
{
public Second TractionInterruption {
get { return Gearbox.TractionInterruption; }
}
......@@ -152,12 +142,10 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
#region IEngineCockpit
public PerSecond EngineSpeed
{
public PerSecond EngineSpeed {
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design",
"CA1065:DoNotRaiseExceptionsInUnexpectedLocations")]
get
{
get {
if (Engine == null) {
throw new VectoException("no engine available!");
}
......@@ -165,8 +153,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
}
}
public NewtonMeter EngineTorque
{
public NewtonMeter EngineTorque {
get { return Engine.EngineTorque; }
}
......@@ -180,23 +167,19 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
return Engine.EngineDragPower(angularSpeed);
}
public PerSecond EngineIdleSpeed
{
public PerSecond EngineIdleSpeed {
get { return Engine.EngineIdleSpeed; }
}
public PerSecond EngineRatedSpeed
{
public PerSecond EngineRatedSpeed {
get { return Engine.EngineRatedSpeed; }
}
public PerSecond EngineN95hSpeed
{
public PerSecond EngineN95hSpeed {
get { return Engine.EngineN95hSpeed; }
}
public PerSecond EngineN80hSpeed
{
public PerSecond EngineN80hSpeed {
get { return Engine.EngineN80hSpeed; }
}
......@@ -204,23 +187,19 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
#region IVehicleCockpit
public MeterPerSecond VehicleSpeed
{
public MeterPerSecond VehicleSpeed {
get { return Vehicle != null ? Vehicle.VehicleSpeed : 0.SI<MeterPerSecond>(); }
}
public Kilogram VehicleMass
{
public Kilogram VehicleMass {
get { return Vehicle != null ? Vehicle.VehicleMass : 0.SI<Kilogram>(); }
}
public Kilogram VehicleLoading
{
public Kilogram VehicleLoading {
get { return Vehicle != null ? Vehicle.VehicleLoading : 0.SI<Kilogram>(); }
}
public Kilogram TotalMass
{
public Kilogram TotalMass {
get { return Vehicle != null ? Vehicle.TotalMass : 0.SI<Kilogram>(); }
}
......@@ -251,8 +230,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
#region IVehicleContainer
public IModalDataContainer ModalData
{
public IModalDataContainer ModalData {
get { return ModData; }
}
......@@ -290,7 +268,8 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
.If<IDrivingCycleInfo>(c => {
DrivingCycle = c;
commitPriority = 6;
});
})
.If<PTOCycleController>(c => { commitPriority = 99; });
_components.Add(Tuple.Create(commitPriority, component));
_components = _components.OrderBy(x => x.Item1).Reverse().ToList();
......@@ -332,10 +311,8 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
return new ReadOnlyCollection<VectoSimulationComponent>(_components.Select(x => x.Item2).ToList());
}
public Meter Distance
{
get
{
public Meter Distance {
get {
if (MilageCounter == null) {
Log.Warn("No MileageCounter in VehicleContainer. Distance cannot be measured.");
return 0.SI<Meter>();
......@@ -354,8 +331,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
return DrivingCycle.LookAhead(time);
}
public Watt BrakePower
{
public Watt BrakePower {
get { return Brakes.BrakePower; }
set { Brakes.BrakePower = value; }
}
......@@ -369,31 +345,26 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
return Clutch.ClutchClosed(absTime);
}
public bool VehicleStopped
{
public bool VehicleStopped {
get { return Vehicle.VehicleStopped; }
}
public DrivingBehavior DriverBehavior
{
public DrivingBehavior DriverBehavior {
get { return Driver.DriverBehavior; }
}
public MeterPerSquareSecond DriverAcceleration
{
public MeterPerSquareSecond DriverAcceleration {
get { return Driver.DriverAcceleration; }
}
public Meter CycleStartDistance
{
public Meter CycleStartDistance {
get { return DrivingCycle == null ? 0.SI<Meter>() : DrivingCycle.CycleStartDistance; }
}
public VectoRunData RunData { get; set; }
public ExecutionMode ExecutionMode { get; set; }
public CycleData CycleData
{
public CycleData CycleData {
get { return DrivingCycle.CycleData; }
}
......@@ -402,8 +373,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
return DrivingCycle.CycleLookAhead(distance);
}
public Meter Altitude
{
public Meter Altitude {
get { return DrivingCycle.Altitude; }
}
......@@ -412,8 +382,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
return Axlegear.AxlegearLoss();
}
public Kilogram ReducedMassWheels
{
public Kilogram ReducedMassWheels {
get { return Wheels.ReducedMassWheels; }
}
}
......
......@@ -79,7 +79,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
AddClutchLoss(outTorque, outAngularVelocity, out torqueIn, out engineSpeedIn);
}
PreviousState.SetState(torqueIn, outAngularVelocity, outTorque, outAngularVelocity);
PreviousState.ClutchLoss = 0.SI<Watt>();
var retVal = NextComponent.Initialize(torqueIn, engineSpeedIn);
retVal.ClutchPowerRequest = outTorque * outAngularVelocity;
......@@ -173,7 +172,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
public class ClutchState : SimpleComponentState
{
public Watt ClutchLoss;
public Watt ClutchLoss = 0.SI<Watt>();
}
}
}
\ No newline at end of file
......@@ -350,7 +350,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
var avgEngineSpeed = (PreviousState.EngineSpeed + CurrentState.EngineSpeed) / 2.0;
container[ModalResultField.P_eng_fcmap] = CurrentState.EngineTorque * avgEngineSpeed;
container[ModalResultField.P_eng_out] = CurrentState.EngineTorqueOut * avgEngineSpeed;
container[ModalResultField.P_eng_out] = container[ModalResultField.P_eng_out] is DBNull ? CurrentState.EngineTorqueOut * avgEngineSpeed : container[ModalResultField.P_eng_out];
container[ModalResultField.P_eng_inertia] = CurrentState.InertiaTorqueLoss * avgEngineSpeed;
container[ModalResultField.n_eng_avg] = avgEngineSpeed;
......
......@@ -54,18 +54,16 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
IDrivingCycle, ISimulationOutPort, IDrivingCycleInPort, IDisposable
{
private const double LookaheadTimeSafetyMargin = 1.5;
private readonly IDrivingCycleData _data;
internal readonly IDrivingCycleData _data;
internal readonly DrivingCycleEnumerator CycleIntervalIterator;
private bool _intervalProlonged;
internal IdleControllerSwitcher IdleController;
private DrivingCycleData.DrivingCycleEntry Left
{
private DrivingCycleData.DrivingCycleEntry Left {
get { return CycleIntervalIterator.LeftSample; }
}
private DrivingCycleData.DrivingCycleEntry Right
{
private DrivingCycleData.DrivingCycleEntry Right {
get { return CycleIntervalIterator.RightSample; }
}
......@@ -383,10 +381,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
/// <summary>
/// Progress of the distance in the driving cycle.
/// </summary>
public double Progress
{
get
{
public double Progress {
get {
return _data.Entries.Count > 0
? (CurrentState.Distance.Value() - _data.Entries.First().Distance.Value()) /
(_data.Entries.Last().Distance.Value() - _data.Entries.First().Distance.Value())
......@@ -441,10 +437,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
_data.Finish();
}
public CycleData CycleData
{
get
{
public CycleData CycleData {
get {
return new CycleData {
AbsTime = CurrentState.AbsTime,
AbsDistance = CurrentState.Distance,
......@@ -498,8 +492,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
return retVal;
}
public Meter Altitude
{
public Meter Altitude {
get { return PreviousState.Altitude; }
}
......
......@@ -116,7 +116,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
return 0.SI<NewtonMeter>();
}
return ComputePowerDemand(angularSpeed) / angularSpeed;
return ComputePowerDemand(angularSpeed, false) / angularSpeed;
}
/// <summary>
......@@ -139,21 +139,24 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
CurrentState.AngularSpeed = angularSpeed;
}
if (avgAngularSpeed.IsGreater(0)) {
return ComputePowerDemand(avgAngularSpeed) / avgAngularSpeed;
return ComputePowerDemand(avgAngularSpeed, dryRun) / avgAngularSpeed;
}
return 0.SI<NewtonMeter>();
}
protected Watt ComputePowerDemand(PerSecond engineSpeed)
protected Watt ComputePowerDemand(PerSecond engineSpeed, bool dryRun)
{
CurrentState.PowerDemands = new Dictionary<string, Watt>(Auxiliaries.Count);
var powerDemands = new Dictionary<string, Watt>(Auxiliaries.Count);
foreach (var item in Auxiliaries) {
var value = item.Value(engineSpeed);
if (value != null) {
CurrentState.PowerDemands[item.Key] = value;
powerDemands[item.Key] = value;
}
}
return CurrentState.PowerDemands.Sum(kv => kv.Value);
if (!dryRun) {
CurrentState.PowerDemands = powerDemands;
}
return powerDemands.Sum(kv => kv.Value);
}
protected override void DoWriteModalResults(IModalDataContainer container)
......
......@@ -45,8 +45,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
{
public class PTOCycleController : PowertrainDrivingCycle, IIdleController
{
public ITnOutPort RequestPort
{
public ITnOutPort RequestPort {
set { NextComponent = value; }
}
......@@ -82,7 +81,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
public void Reset()
{
CycleIterator.Reset();
PreviousState.InAngularVelocity = CycleIterator.LeftSample.AngularVelocity;
IdleStart = null;
}
......@@ -98,7 +97,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
protected override void DoWriteModalResults(IModalDataContainer container)
{
base.DoWriteModalResults(container);
container[Constants.Auxiliaries.IDs.PTOConsumer] = CurrentState.InTorque * CurrentState.InAngularVelocity;
container[Constants.Auxiliaries.IDs.PTOConsumer] = CurrentState.InTorque *
(PreviousState.InAngularVelocity + CurrentState.InAngularVelocity) / 2;
container[ModalResultField.P_eng_out] = 0.SI<Watt>();
}
}
}
\ No newline at end of file
......@@ -166,6 +166,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
protected override void DoCommitSimulationStep()
{
CycleIterator.MoveNext();
AdvanceState();
}
#endregion
......
......@@ -203,6 +203,16 @@ namespace TUGraz.VectoCore.OutputData
return paEngine + paGearbox;
}
public static WattSecond WorkClutch(this IModalDataContainer data)
{
return data.TimeIntegral<WattSecond>(ModalResultField.P_clutch_loss);
}
public static WattSecond WorkGearshift(this IModalDataContainer data)
{
return data.TimeIntegral<WattSecond>(ModalResultField.P_gbx_shift_loss);
}
public static WattSecond WorkGearbox(this IModalDataContainer data)
{
return data.TimeIntegral<WattSecond>(ModalResultField.P_gbx_loss);
......@@ -231,10 +241,11 @@ namespace TUGraz.VectoCore.OutputData
public static Second Duration(this IModalDataContainer data)
{
var time = data.GetValues<Second>(ModalResultField.time).ToList();
var dt = data.GetValues<Second>(ModalResultField.simulationInterval).ToList();
if (time.Count == 1) {
return time.First();
}
return time.Max() - time.Min();
return time.Max() - time.Min() + dt.First() / 2 + dt.Last() / 2;
}
public static Meter Distance(this IModalDataContainer data)
......@@ -249,6 +260,12 @@ namespace TUGraz.VectoCore.OutputData
return data.TimeIntegral<WattSecond>(ModalResultField.P_brake_loss);
}
public static WattSecond WorkVehicleInertia(this IModalDataContainer data)
{
return data.TimeIntegral<WattSecond>(ModalResultField.P_veh_inertia) +
data.TimeIntegral<WattSecond>(ModalResultField.P_wheel_inertia);
}
public static WattSecond WorkAuxiliaries(this IModalDataContainer data)
{
return data.TimeIntegral<WattSecond>(ModalResultField.P_aux);
......@@ -274,30 +291,35 @@ namespace TUGraz.VectoCore.OutputData
return data.TimeIntegral<WattSecond>(ModalResultField.P_eng_out, x => x > 0);
}
public static WattSecond TotalEngineWorkPositive(this IModalDataContainer data)
{
return data.TimeIntegral<WattSecond>(ModalResultField.P_eng_fcmap, x => x > 0);
}
public static WattSecond EngineWorkNegative(this IModalDataContainer data)
{
return data.TimeIntegral<WattSecond>(ModalResultField.P_eng_out, x => x < 0);
}
public static Watt PowerBrake(this IModalDataContainer data)
public static WattSecond TotalEngineWorkPositive(this IModalDataContainer data)
{
return data.TimeIntegral<WattSecond>(ModalResultField.P_brake_loss) / data.Duration();
return data.TimeIntegral<WattSecond>(ModalResultField.P_eng_fcmap, x => x > 0);
}
public static Watt PowerAngle(this IModalDataContainer data)
public static WattSecond TotalEngineWorkNegative(this IModalDataContainer data)
{
return data.TimeIntegral<WattSecond>(ModalResultField.P_angle_loss) / data.Duration();
return data.TimeIntegral<WattSecond>(ModalResultField.P_eng_fcmap, x => x < 0);
}
public static Watt PowerTorqueConverter(this IModalDataContainer data)
{
return data.TimeIntegral<WattSecond>(ModalResultField.P_TC_loss) / data.Duration();
}
//public static Watt PowerBrake(this IModalDataContainer data)
//{
// return data.TimeIntegral<WattSecond>(ModalResultField.P_brake_loss) / data.Duration();
//}
//public static Watt PowerAngle(this IModalDataContainer data)
//{
// return data.TimeIntegral<WattSecond>(ModalResultField.P_angle_loss) / data.Duration();
//}
//public static Watt PowerTorqueConverter(this IModalDataContainer data)
//{
// return data.TimeIntegral<WattSecond>(ModalResultField.P_TC_loss) / data.Duration();
//}
public static Watt PowerWheelPositive(this IModalDataContainer data)
{
......@@ -394,29 +416,29 @@ namespace TUGraz.VectoCore.OutputData
return data.TimeIntegral<Kilogram>(ModalResultField.FCMap) / distance;
}
public static Watt EnginePowerNegativeAverage(this IModalDataContainer data)
{
var simulationIntervals = data.GetValues<Second>(ModalResultField.simulationInterval);
var values = data.GetValues<Watt>(ModalResultField.P_eng_out)
.Zip(simulationIntervals, (value, dt) => new { Dt = dt, Value = value * dt })
.Where(v => v.Value < 0).ToList();
if (values.Any()) {
return values.Sum(v => v.Value) / values.Sum(v => v.Dt);
}
return 0.SI<Watt>();
}
public static Watt EnginePowerPositiveAverage(this IModalDataContainer data)
{
var simulationIntervals = data.GetValues<Second>(ModalResultField.simulationInterval);
var values = data.GetValues<Watt>(ModalResultField.P_eng_out)
.Zip(simulationIntervals, (value, dt) => new { Dt = dt, Value = value * dt })
.Where(v => v.Value > 0).ToList();
if (values.Any()) {
return values.Sum(v => v.Value) / values.Sum(v => v.Dt);
}
return 0.SI<Watt>();
}
//public static Watt EnginePowerNegativeAverage(this IModalDataContainer data)
//{
// var simulationIntervals = data.GetValues<Second>(ModalResultField.simulationInterval);
// var values = data.GetValues<Watt>(ModalResultField.P_eng_out)
// .Zip(simulationIntervals, (value, dt) => new { Dt = dt, Value = value * dt })
// .Where(v => v.Value < 0).ToList();
// if (values.Any()) {
// return values.Sum(v => v.Value) / values.Sum(v => v.Dt);
// }
// return 0.SI<Watt>();
//}
//public static Watt EnginePowerPositiveAverage(this IModalDataContainer data)
//{
// var simulationIntervals = data.GetValues<Second>(ModalResultField.simulationInterval);
// var values = data.GetValues<Watt>(ModalResultField.P_eng_out)
// .Zip(simulationIntervals, (value, dt) => new { Dt = dt, Value = value * dt })
// .Where(v => v.Value > 0).ToList();
// if (values.Any()) {
// return values.Sum(v => v.Value) / values.Sum(v => v.Dt);
// }
// return 0.SI<Watt>();
//}
public static Watt TotalPowerEnginePositiveAverage(this IModalDataContainer data)
{
......@@ -425,7 +447,7 @@ namespace TUGraz.VectoCore.OutputData
.Zip(simulationIntervals, (value, dt) => new { Dt = dt, Value = value * dt })
.Where(v => v.Value > 0).ToList();
if (values.Any()) {
return values.Sum(v => v.Value) / values.Sum(v => v.Dt);
return values.Sum(v => v.Value) / Duration(data);
}
return 0.SI<Watt>();
}
......
......@@ -78,12 +78,12 @@ namespace TUGraz.VectoCore.OutputData
public const string CO2_TKM = "CO2 [g/tkm]";
public const string P_WHEEL_POS = "P_wheel_in_pos [kW]";
public const string P_BRAKE_LOSS = "P_brake_loss [kW]";
public const string P_CLUTCH_POS = "P_clutch_pos [kW]";
public const string P_CLUTCH_NEG = "P_clutch_neg [kW]";
//public const string P_BRAKE_LOSS = "P_brake_loss [kW]";
//public const string P_CLUTCH_POS = "P_clutch_pos [kW]";
//public const string P_CLUTCH_NEG = "P_clutch_neg [kW]";
public const string P_FCMAP_POS = "P_fcmap_pos [kW]";
public const string P_ANGLE_LOSS = "P_angle_loss [kW]";
public const string P_TC_LOSS = "P_tc_loss [kW]";
//public const string P_ANGLE_LOSS = "P_angle_loss [kW]";
//public const string P_TC_LOSS = "P_tc_loss [kW]";
public const string E_FORMAT = "E_{0} [kWh]";
public const string E_AUX_FORMAT = "E_aux_{0} [kWh]";
......@@ -92,16 +92,20 @@ namespace TUGraz.VectoCore.OutputData
public const string E_AIR = "E_air [kWh]";
public const string E_ROLL = "E_roll [kWh]";
public const string E_GRAD = "E_grad [kWh]";
public const string E_INERTIA = "E_inertia [kWh]";
public const string E_VEHICLE_INERTIA = "E_vehi_inertia [kWh]";
public const string E_POWERTRAIN_INERTIA = "E_powertrain_inertia [kWh]";
public const string E_BRAKE = "E_brake [kWh]";
public const string E_GBX_LOSS = "E_gbx_loss [kWh]";
public const string E_SHIFT_LOSS = "E_shift_loss [kWh]";
public const string E_AXL_LOSS = "E_axl_loss [kWh]";
public const string E_RET_LOSS = "E_ret_loss [kWh]";
public const string E_TC_LOSS = "E_tc_loss [kWh]";
public const string E_ANGLE_LOSS = "E_angle_loss [kWh]";
public const string E_CLUTCH_POS = "E_clutch_pos [kWh]";
public const string E_CLUTCH_NEG = "E_clutch_neg [kWh]";
//public const string E_CLUTCH_POS = "E_clutch_pos [kWh]";
//public const string E_CLUTCH_NEG = "E_clutch_neg [kWh]";
public const string E_CLUTCH_LOSS = "E_clutch_loss [kWh]";
public const string E_FCMAP_POS = "E_fcmap_pos [kWh]";
public const string E_FCMAP_NEG = "E_fcmap_neg [kWh]";
public const string ACC = "a [m/s^2]";
public const string ACC_POS = "a_pos [m/s^2]";
......@@ -113,7 +117,7 @@ namespace TUGraz.VectoCore.OutputData
public const string STOP_TIMESHARE = "StopTimeShare [%]";
// ReSharper restore InconsistentNaming
private readonly DataTable _table;
internal readonly DataTable _table;
private readonly ISummaryWriter _sumWriter;
protected SummaryDataContainer() {}
......@@ -135,9 +139,10 @@ namespace TUGraz.VectoCore.OutputData
_table.Columns.AddRange(new[] {
MASS, LOADING, TIME, DISTANCE, SPEED, ALTITUDE_DELTA, FCMAP_H, FCMAP_KM, FCAUXC_H, FCAUXC_KM, FCWHTCC_H, FCWHTCC_KM,
FCAAUX_H, FCAAUX_KM, FCFINAL_H, FCFINAL_KM, FCFINAL_LITERPER100KM, FCFINAL_LITERPER100TKM, CO2_KM, CO2_TKM,
P_WHEEL_POS, P_BRAKE_LOSS, P_ANGLE_LOSS, P_TC_LOSS, P_CLUTCH_POS, P_CLUTCH_NEG, P_FCMAP_POS, E_AUX, E_AIR, E_ROLL,
E_GRAD, E_INERTIA, E_BRAKE, E_GBX_LOSS, E_AXL_LOSS, E_ANGLE_LOSS, E_RET_LOSS, E_TC_LOSS, E_CLUTCH_POS, E_CLUTCH_NEG,
E_FCMAP_POS, ACC, ACC_POS, ACC_NEG, ACC_TIMESHARE, DEC_TIMESHARE, CRUISE_TIMESHARE, STOP_TIMESHARE
P_WHEEL_POS, P_FCMAP_POS,
E_FCMAP_POS, E_FCMAP_NEG, E_POWERTRAIN_INERTIA, E_AUX, E_CLUTCH_LOSS, E_TC_LOSS, E_SHIFT_LOSS, E_GBX_LOSS,
E_RET_LOSS, E_ANGLE_LOSS, E_AXL_LOSS, E_BRAKE, E_VEHICLE_INERTIA, E_AIR, E_ROLL, E_GRAD,
ACC, ACC_POS, ACC_NEG, ACC_TIMESHARE, DEC_TIMESHARE, CRUISE_TIMESHARE, STOP_TIMESHARE
}.Select(x => new DataColumn(x, typeof(SI))).ToArray());
}
......@@ -227,14 +232,11 @@ namespace TUGraz.VectoCore.OutputData
}
row[P_WHEEL_POS] = modData.PowerWheelPositive().ConvertTo().Kilo.Watt;
row[P_BRAKE_LOSS] = modData.PowerBrake().ConvertTo().Kilo.Watt;
row[P_ANGLE_LOSS] = modData.PowerAngle().ConvertTo().Kilo.Watt;
row[P_TC_LOSS] = modData.PowerTorqueConverter().ConvertTo().Kilo.Watt;
row[P_CLUTCH_POS] = modData.EnginePowerPositiveAverage().ConvertTo().Kilo.Watt;
row[P_CLUTCH_NEG] = modData.EnginePowerNegativeAverage().ConvertTo().Kilo.Watt;
//row[P_BRAKE_LOSS] = modData.PowerBrake().ConvertTo().Kilo.Watt;
//row[P_ANGLE_LOSS] = modData.PowerAngle().ConvertTo().Kilo.Watt;
//row[P_TC_LOSS] = modData.PowerTorqueConverter().ConvertTo().Kilo.Watt;
//row[P_CLUTCH_POS] = modData.EnginePowerPositiveAverage().ConvertTo().Kilo.Watt;
//row[P_CLUTCH_NEG] = modData.EnginePowerNegativeAverage().ConvertTo().Kilo.Watt;
row[P_FCMAP_POS] = modData.TotalPowerEnginePositiveAverage().ConvertTo().Kilo.Watt;
......@@ -254,21 +256,25 @@ namespace TUGraz.VectoCore.OutputData
row[colName] = modData.AuxiliaryWork(aux.Value).ConvertTo().Kilo.Watt.Hour;
}
row[E_AUX] = modData.WorkAuxiliaries().ConvertTo().Kilo.Watt.Hour;
row[E_AIR] = modData.WorkAirResistance().ConvertTo().Kilo.Watt.Hour;
row[E_ROLL] = modData.WorkRollingResistance().ConvertTo().Kilo.Watt.Hour;
row[E_GRAD] = modData.WorkRoadGradientResistance().ConvertTo().Kilo.Watt.Hour;
row[E_INERTIA] = modData.PowerAccelerations().ConvertTo().Kilo.Watt.Hour;
row[E_BRAKE] = modData.WorkTotalMechanicalBrake().ConvertTo().Kilo.Watt.Hour;
//row[E_CLUTCH_POS] = modData.EngineWorkPositive().ConvertTo().Kilo.Watt.Hour;
//row[E_CLUTCH_NEG] = modData.EngineWorkNegative().ConvertTo().Kilo.Watt.Hour;
row[E_FCMAP_POS] = modData.TotalEngineWorkPositive().ConvertTo().Kilo.Watt.Hour;
row[E_FCMAP_NEG] = -modData.TotalEngineWorkNegative().ConvertTo().Kilo.Watt.Hour;
row[E_POWERTRAIN_INERTIA] = modData.PowerAccelerations().ConvertTo().Kilo.Watt.Hour;
row[E_AUX] = modData.WorkAuxiliaries().ConvertTo().Kilo.Watt.Hour;
row[E_CLUTCH_LOSS] = modData.WorkClutch().ConvertTo().Kilo.Watt.Hour;
row[E_TC_LOSS] = modData.WorkTorqueConverter().ConvertTo().Kilo.Watt.Hour;
row[E_SHIFT_LOSS] = modData.WorkGearshift().ConvertTo().Kilo.Watt.Hour;
row[E_GBX_LOSS] = modData.WorkGearbox().ConvertTo().Kilo.Watt.Hour;
row[E_AXL_LOSS] = modData.WorkAxlegear().ConvertTo().Kilo.Watt.Hour;
row[E_RET_LOSS] = modData.WorkRetarder().ConvertTo().Kilo.Watt.Hour;
row[E_TC_LOSS] = modData.WorkTorqueConverter().ConvertTo().Kilo.Watt.Hour;
row[E_AXL_LOSS] = modData.WorkAxlegear().ConvertTo().Kilo.Watt.Hour;
row[E_ANGLE_LOSS] = modData.WorkAngledrive().ConvertTo().Kilo.Watt.Hour;
row[E_CLUTCH_POS] = modData.EngineWorkPositive().ConvertTo().Kilo.Watt.Hour;
row[E_CLUTCH_NEG] = modData.EngineWorkNegative().ConvertTo().Kilo.Watt.Hour;
row[E_FCMAP_POS] = modData.TotalEngineWorkPositive().ConvertTo().Kilo.Watt.Hour;
row[E_BRAKE] = modData.WorkTotalMechanicalBrake().ConvertTo().Kilo.Watt.Hour;
row[E_VEHICLE_INERTIA] = modData.WorkVehicleInertia().ConvertTo().Kilo.Watt.Hour;
row[E_AIR] = modData.WorkAirResistance().ConvertTo().Kilo.Watt.Hour;
row[E_ROLL] = modData.WorkRollingResistance().ConvertTo().Kilo.Watt.Hour;
row[E_GRAD] = modData.WorkRoadGradientResistance().ConvertTo().Kilo.Watt.Hour;
var acc = modData.AccelerationPer3Seconds();
......
......@@ -55,8 +55,8 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
[Test,
// clutch slipping
TestCase(DrivingBehavior.Driving, 100, 0, 100, 65.6889),
TestCase(DrivingBehavior.Driving, 100, 30, 100, 65.6889),
TestCase(DrivingBehavior.Driving, 100, 0, 0, 65.6889),
TestCase(DrivingBehavior.Driving, 100, 30, 45.6697, 65.6889),
// clutch opened - would cause neg. clutch losses (which is not possible), torque is adapted
TestCase(DrivingBehavior.Halted, 100, 30, 51.1569, 58.643062),
// clutch closed
......@@ -72,6 +72,8 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
var engineData = MockSimulationDataFactory.CreateEngineDataFromFile(CoachEngine);
var gearbox = new MockGearbox(container);
var clutch = new Clutch(container, engineData) { IdleController = new MockIdleController() };
var vehicle = new MockVehicle(container);
vehicle.MyVehicleSpeed = 50.KMPHtoMeterPerSecond();
var inPort = clutch.InPort();
var outPort = new MockTnOutPort();
......
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