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

Skip to content
Snippets Groups Projects
Commit 00ad40b0 authored by Michael KRISPER's avatar Michael KRISPER
Browse files

updated steering pump csv tables, added SP-Axle, begin to update declaration data classes for it

parent 4134bbe2
No related branches found
No related tags found
No related merge requests found
......@@ -47,7 +47,7 @@ namespace TUGraz.VectoCore.Models.Declaration
private readonly Dictionary<Tuple<MissionType, string>, Watt> _data =
new Dictionary<Tuple<MissionType, string>, Watt>();
public ElectricSystem()
{
ParseData(ReadCsvResource(ResourceId));
......@@ -84,14 +84,14 @@ namespace TUGraz.VectoCore.Models.Declaration
return sum / _alternator.Lookup(missionType, null);
}
private sealed class Alternator : LookupData<MissionType, string, double>
internal sealed class Alternator : LookupData<MissionType, string, double>
{
private const string ResourceId = "TUGraz.VectoCore.Resources.Declaration.VAUX.ALT-Tech.csv";
private const string Default = "Standard alternator";
private readonly Dictionary<Tuple<MissionType, string>, double> _data =
new Dictionary<Tuple<MissionType, string>, double>();
public Alternator()
{
ParseData(ReadCsvResource(ResourceId));
......
......@@ -43,9 +43,12 @@ namespace TUGraz.VectoCore.Models.Declaration
{
private const string ResourceId = "TUGraz.VectoCore.Resources.Declaration.VAUX.SP-Table.csv";
private readonly SteeringPumpTechnologies _technologies = new SteeringPumpTechnologies();
private readonly SteeringPumpAxles _axles = new SteeringPumpAxles();
private readonly ElectricSystem.Alternator _alternator = new ElectricSystem.Alternator();
private readonly Dictionary<Tuple<MissionType, VehicleClass>, Watt[]> _data =
new Dictionary<Tuple<MissionType, VehicleClass>, Watt[]>();
public SteeringPump()
{
ParseData(ReadCsvResource(ResourceId));
......@@ -56,12 +59,7 @@ namespace TUGraz.VectoCore.Models.Declaration
try {
var shares = _data[Tuple.Create(mission, hdvClass)];
var factors = _technologies.Lookup(technology);
var sum = 0.SI<Watt>();
for (var i = 0; i < factors.Length; i++) {
sum += shares[i] * factors[i];
}
return sum;
return shares[0] * factors.UnloadedFriction + shares[1] * factors.Banking + shares[2] * factors.Steering;
} catch (KeyNotFoundException) {
throw new VectoException(
"Auxiliary Lookup Error: No value found for Steering Pump with mission '{0}', HDVClass '{1}' and technology '{3}'",
......@@ -85,15 +83,55 @@ namespace TUGraz.VectoCore.Models.Declaration
}
}
private sealed class SteeringPumpTechnologies : LookupData<string, double[]>
private sealed class SteeringPumpTechnologies : LookupData<string, SteeringPumpTechnologies.CorrectionFactors>
{
private const string ResourceId = "TUGraz.VectoCore.Resources.Declaration.VAUX.SP-Tech.csv";
internal struct CorrectionFactors
{
public double UnloadedFriction;
public double Banking;
public double Steering;
public CorrectionFactors(double unloadedFriction, double banking, double steering)
{
UnloadedFriction = unloadedFriction;
Banking = banking;
Steering = steering;
}
}
public SteeringPumpTechnologies()
{
ParseData(ReadCsvResource(ResourceId));
}
protected override void ParseData(DataTable table)
{
Data = table.Rows.Cast<DataRow>().ToDictionary(
key => key.Field<string>("Scaling Factors"),
value => new CorrectionFactors(value.ParseDouble("UF"), value.ParseDouble("B"), value.ParseDouble("S")));
}
public override CorrectionFactors Lookup(string tech)
{
try {
return Data[tech];
} catch (KeyNotFoundException) {
throw new VectoException("Auxiliary Lookup Error: No value found for SteeringPump Technology with key '{0}'", tech);
}
}
}
private sealed class SteeringPumpAxles : LookupData<string, double[]>
{
private const string ResourceId = "TUGraz.VectoCore.Resources.Declaration.VAUX.SP-Tech.csv";
public SteeringPumpAxles()
{
ParseData(ReadCsvResource(ResourceId));
}
protected override void ParseData(DataTable table)
{
Data = table.Rows.Cast<DataRow>().ToDictionary(
......
No steered axles / power demand percentage [%],Long haul,Regional delivery,Urban delivery,Municipal utility,construction
1,100/100/100,100/100/100,100/100/100,100/100/100,100/100/100
2,100/70/70,100/70/70,100/70/70,100/70/70,100/70/70
3,100/50/50,100/50/50,100/50/50,100/50/50,100/50/50
4,100/50/50,100/50/50,100/50/50,100/50/50,100/50/50
HDV Class / Power demand per share,Long haul,Regional delivery,Urban delivery,Municipal utility,Construction,Heavy Urban,Urban,Suburban,Interurban,Coach
1,0,110/130/20/0,100/120/20/30,0,0,0,0,0,0,0
2,150/190/30/0,130/160/30/0,120/140/20/30,0,0,0,0,0,0,0
3,0,140/170/30/0,130/150/30/40,0,0,0,0,0,0,0
4,230/280/100/0,220/270/40/0,0,220/270/40/0,0,0,0,0,0,0
5,270/330/120/0,250/290/90/0,220/260/80/60,0,0,0,0,0,0,0
6,0,0,0,0,0,0,0,0,0,0
7,0,0,0,0,0,0,0,0,0,0
8,0,0,0,0,0,0,0,0,0,0
9,270/330/120/0,220/270/60/0,0,220/270/60/0,0,0,0,0,0,0
10,200/250/120/0,200/240/90/0,0,0,0,0,0,0,0,0
HDV Class / Power demand per share [W],Long haul,Regional delivery,Urban delivery,Municipal utility,Construction
1,,240/20/20,220/20/30,,
2,340/30/0,290/30/20,260/20/30,,
3,,310/30/30,280/30/40,,
4,510/100/0,490/40/40,,430/30/50,
5,600/120/0,540/90/40,480/80/60,,
6,,,,,
7,,,,,
8,,,,,
9,600/120/0,490/60/40,,430/30/50,
10,450/120/0,440/90/40,,,
11,600/120/0,490/60/40,,430/30/50,640/50/80
12,450/120/0,440/90/40,,,640/50/80
16,,,,,640/50/80
Scaling Factors,U,F,B,S
Fixed displacement,1,1,1,1
Variable displacement,0.6,0.6,0.6,0.6
Hydraulic supported by electric,0.7,1,0.9,0.9
Technology / Scaling Factors [-],CF_UF,CF_B,CF_S
Fixed displacement,1,1,1
Fixed displacement elec. controlled,0.95,1,1
Dual displacement,0.85,0.85,0.85
Variable displacement mech. controlled,0.75,0.75,0.75
Variable displacement elec. controlled,0.6,0.6,0.6
Electric,0,1.5/eff_alt,1/eff_alt
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