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

Skip to content
Snippets Groups Projects
Commit 6e0a8d9a authored by Harald MARTINI's avatar Harald MARTINI
Browse files

added SerialHybridStrategyParameterDataAdapter

parent 96396423
No related branches found
No related tags found
No related merge requests found
using System;
using System.Collections.Generic;
using System.ComponentModel;
using TUGraz.VectoCommon.Exceptions;
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.InputData.Reader.DataObjectAdapter.HeavyLorry;
using TUGraz.VectoCore.Models.Simulation.Data;
using TUGraz.VectoCore.Models.SimulationComponent.Data;
using TUGraz.VectoCore.Models.SimulationComponent.Data.Battery;
using TUGraz.VectoCore.Models.SimulationComponent.Impl;
......@@ -54,9 +56,78 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter.SimulationComponen
public class SerialHybridStrategyParameterDataAdapter : HybridStrategyParameters
{
public HybridStrategyParameters CreateHybridStrategyParameters(BatterySystemData batterySystemData,
SuperCapData superCap)
SuperCapData superCapData, Kilogram vehicleMass, VectoRunData.OvcHevMode ovcMode)
{
return new HybridStrategyParameters();
if (batterySystemData == null && superCapData == null) {
return null;
}
if (superCapData != null) {
throw new VectoException("Super cap for serial hybrid is not implemented");
}
var result = new HybridStrategyParameters();
result.AuxReserveTime = null;
result.AuxReserveChargeTime = null;
result.MinICEOnTime = null;
result.GensetMinOptPowerFactor = 0;
result.ICEStartPenaltyFactor = double.NaN;
result.MaxPropulsionTorque = new Dictionary<GearshiftPosition, VehicleMaxPropulsionTorque>();
result.EquivalenceFactorCharge = double.NaN;
result.EquivalenceFactorDischarge = double.NaN;
result.CostFactorSOCExponent = 5;
switch (ovcMode) {
case VectoRunData.OvcHevMode.NotApplicable:
SetGenericParameters(result, batterySystemData, superCapData, vehicleMass);
break;
case VectoRunData.OvcHevMode.ChargeSustaining:
break;
case VectoRunData.OvcHevMode.ChargeDepleting:
break;
default:
throw new ArgumentOutOfRangeException(nameof(ovcMode), ovcMode, null);
}
//TODO Move to DeclarationData.Hybridstrategy.Parallel
return result;
}
private void SetGenericParameters(HybridStrategyParameters result, BatterySystemData batterySystemData,
SuperCapData superCapData, Kilogram vehicleMass){
var tmpSystem = new BatterySystem(null, batterySystemData);
var deltaSoc = CalculatedDeltaSocSHev(vehicleMass, batterySystemData, tmpSystem);
result.MinSoC = tmpSystem.MinSoC + 2 * deltaSoc;
result.TargetSoC = tmpSystem.MaxSoC - 5 * deltaSoc;
result.MaxSoC = tmpSystem.MaxSoC;
}
private double CalculatedDeltaSocSHev(Kilogram vehicleMass, BatterySystemData batterySystemData, BatterySystem tmpSystem)
{
var v_nom = tmpSystem.NominalVoltage;
var c_nom = tmpSystem.Capacity;
double speedInkmph = 100;
var result = vehicleMass * speedInkmph.KMPHtoMeterPerSecond() * speedInkmph.KMPHtoMeterPerSecond() / v_nom / c_nom;
return result.Value();
}
}
}
\ No newline at end of file
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