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

Skip to content
Snippets Groups Projects
Commit 24500810 authored by Stefanos Doumpoulakis's avatar Stefanos Doumpoulakis
Browse files

implemented vdri input: fan electrical power

parent 861501b0
No related branches found
No related tags found
No related merge requests found
Showing
with 4719 additions and 14 deletions
...@@ -207,3 +207,5 @@ Documentation/VehiclesReleaseComparisonDeclarationMode/tmp/ ...@@ -207,3 +207,5 @@ Documentation/VehiclesReleaseComparisonDeclarationMode/tmp/
Documentation/VehiclesReleaseComparisonDeclarationMode/**/*.vmod Documentation/VehiclesReleaseComparisonDeclarationMode/**/*.vmod
Documentation/VehiclesReleaseComparisonDeclarationMode/**/*.vsum Documentation/VehiclesReleaseComparisonDeclarationMode/**/*.vsum
Documentation/User Manual/img/ Documentation/User Manual/img/
.vs/
\ No newline at end of file
...@@ -49,6 +49,8 @@ namespace TUGraz.VectoCore.Configuration ...@@ -49,6 +49,8 @@ namespace TUGraz.VectoCore.Configuration
public const string Prefix = "AUX_"; public const string Prefix = "AUX_";
public const string PowerPrefix = "P_"; public const string PowerPrefix = "P_";
public const double FanElectricToMechanicalEfficiency = 0.7;
public static class IDs public static class IDs
{ {
public const string PTOTransmission = "PTO_TRANSM"; public const string PTOTransmission = "PTO_TRANSM";
......
...@@ -361,6 +361,7 @@ namespace TUGraz.VectoCore.InputData.Reader ...@@ -361,6 +361,7 @@ namespace TUGraz.VectoCore.InputData.Reader
public const string PTOActive = "PTO"; public const string PTOActive = "PTO";
public const string PTODuringDrivePower = "PTO_Power"; public const string PTODuringDrivePower = "PTO_Power";
public const string Highway = "HW"; public const string Highway = "HW";
public const string FanElectricalPower = "Pel_fan";
} }
#region DataParser #region DataParser
...@@ -435,6 +436,22 @@ namespace TUGraz.VectoCore.InputData.Reader ...@@ -435,6 +436,22 @@ namespace TUGraz.VectoCore.InputData.Reader
return true; return true;
} }
protected static bool CheckExclusiveColumns(DataColumnCollection header, string[] cols, bool throwExceptions)
{
var colCount = header.Cast<DataColumn>().Count(col => cols.Select(x => x.ToLowerInvariant())
.Contains(col.ColumnName.ToLowerInvariant()));
if (colCount != 1) {
if (throwExceptions) {
throw new VectoException("Exactly one of these columns have to be defined: {0}", string.Join(", ", cols));
}
return false;
}
return true;
}
public abstract IEnumerable<DrivingCycleData.DrivingCycleEntry> Parse(DataTable table, bool crossWindRequired); public abstract IEnumerable<DrivingCycleData.DrivingCycleEntry> Parse(DataTable table, bool crossWindRequired);
} }
...@@ -789,7 +806,7 @@ namespace TUGraz.VectoCore.InputData.Reader ...@@ -789,7 +806,7 @@ namespace TUGraz.VectoCore.InputData.Reader
AdditionalAuxPowerDemand = AdditionalAuxPowerDemand =
row.ParseDoubleOrGetDefault(Fields.AdditionalAuxPowerDemand).SI(Unit.SI.Kilo.Watt).Cast<Watt>(), row.ParseDoubleOrGetDefault(Fields.AdditionalAuxPowerDemand).SI(Unit.SI.Kilo.Watt).Cast<Watt>(),
EngineSpeed = row.ParseDouble(Fields.EngineSpeedSuffix).RPMtoRad(), EngineSpeed = row.ParseDouble(Fields.EngineSpeedSuffix).RPMtoRad(),
FanSpeed = row.ParseDouble(Fields.FanSpeed).RPMtoRad(), FanSpeed = row.ParseDoubleOrGetDefault(Fields.FanSpeed).RPMtoRad(),
Gear = (uint)row.ParseDoubleOrGetDefault(Fields.Gear), Gear = (uint)row.ParseDoubleOrGetDefault(Fields.Gear),
Fuelconsumption = row.ParseDoubleOrGetDefault(Fields.FuelConsumption).SI(Unit.SI.Gramm.Per.Hour) Fuelconsumption = row.ParseDoubleOrGetDefault(Fields.FuelConsumption).SI(Unit.SI.Gramm.Per.Hour)
.Cast<KilogramPerSecond>(), .Cast<KilogramPerSecond>(),
...@@ -797,7 +814,10 @@ namespace TUGraz.VectoCore.InputData.Reader ...@@ -797,7 +814,10 @@ namespace TUGraz.VectoCore.InputData.Reader
TorqueWheelLeft = tqLeft, TorqueWheelLeft = tqLeft,
TorqueWheelRight = tqRight, TorqueWheelRight = tqRight,
WheelSpeedLeft = speedLeft, WheelSpeedLeft = speedLeft,
WheelSpeedRight = speedRight WheelSpeedRight = speedRight,
FanElectricalPower = table.Columns.Contains(Fields.FanElectricalPower)
? row.ParseDouble(Fields.FanElectricalPower).SI<Watt>()
: null
}; };
}).ToArray(); }).ToArray();
...@@ -810,7 +830,6 @@ namespace TUGraz.VectoCore.InputData.Reader ...@@ -810,7 +830,6 @@ namespace TUGraz.VectoCore.InputData.Reader
Fields.Time, Fields.Time,
Fields.VehicleSpeed, Fields.VehicleSpeed,
Fields.EngineSpeedSuffix, Fields.EngineSpeedSuffix,
Fields.FanSpeed,
Fields.WheelSpeedLeft, Fields.WheelSpeedLeft,
Fields.WheelSpeedRight, Fields.WheelSpeedRight,
Fields.WheelTorqueLeft, Fields.WheelTorqueLeft,
...@@ -828,13 +847,17 @@ namespace TUGraz.VectoCore.InputData.Reader ...@@ -828,13 +847,17 @@ namespace TUGraz.VectoCore.InputData.Reader
Fields.WheelTorqueRight, Fields.WheelTorqueRight,
Fields.Gear, Fields.Gear,
Fields.TorqueConverterActive, Fields.TorqueConverterActive,
Fields.FuelConsumption Fields.FuelConsumption,
Fields.FanElectricalPower
}; };
const bool allowAux = true; const bool allowAux = true;
return CheckColumns(header, allowedCols, requiredCols, throwExceptions, allowAux) && throwExceptions = true;
CheckComboColumns(header, new[] { Fields.AirSpeedRelativeToVehicle, Fields.WindYawAngle }, throwExceptions);
return CheckColumns(header, allowedCols, requiredCols, throwExceptions, allowAux)
&& CheckComboColumns(header, new[] { Fields.AirSpeedRelativeToVehicle, Fields.WindYawAngle }, throwExceptions)
&& CheckExclusiveColumns(header, new[] { Fields.FanSpeed, Fields.FanElectricalPower}, throwExceptions);
} }
} }
......
...@@ -183,7 +183,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl ...@@ -183,7 +183,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
var aux = CreateSpeedDependentAuxiliaries(data, container); var aux = CreateSpeedDependentAuxiliaries(data, container);
var engineFan = new EngineFanAuxiliary(data.FanData.FanCoefficients, data.FanData.FanDiameter); var engineFan = new EngineFanAuxiliary(data.FanData.FanCoefficients, data.FanData.FanDiameter);
aux.AddCycle(Constants.Auxiliaries.IDs.Fan, cycleEntry => engineFan.PowerDemand(cycleEntry.FanSpeed)); aux.AddCycle(Constants.Auxiliaries.IDs.Fan, cycleEntry => engineFan.PowerDemand(cycleEntry));
container.ModalData.AddAuxiliary(Constants.Auxiliaries.IDs.Fan); container.ModalData.AddAuxiliary(Constants.Auxiliaries.IDs.Fan);
if (data.PTO != null) { if (data.PTO != null) {
......
...@@ -251,6 +251,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data ...@@ -251,6 +251,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data
public PerSecond FanSpeed; public PerSecond FanSpeed;
public Watt FanElectricalPower;
// required for VTP Mode (validation of cycle data in declaration mode) // required for VTP Mode (validation of cycle data in declaration mode)
public NewtonMeter TorqueWheelLeft; public NewtonMeter TorqueWheelLeft;
......
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
using System; using System;
using TUGraz.VectoCommon.Utils; using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.Configuration;
using TUGraz.VectoCore.Models.SimulationComponent.Data;
namespace TUGraz.VectoCore.Models.SimulationComponent.Impl namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
{ {
...@@ -51,8 +53,20 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -51,8 +53,20 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
public Watt PowerDemand(PerSecond fanSpeed) public Watt PowerDemand(PerSecond fanSpeed)
{ {
return (FanCoefficients[0] * Math.Pow(fanSpeed.AsRPM / FanCoefficients[1], 3) * Math.Pow(FanDiameter / FanCoefficients[2], 5) * 1000).SI<Watt>(); return (FanCoefficients[0] * Math.Pow(fanSpeed.AsRPM / FanCoefficients[1], 3) * Math.Pow(FanDiameter / FanCoefficients[2], 5) * 1000).SI<Watt>();
}
public Watt PowerDemand(DrivingCycleData.DrivingCycleEntry entry)
{
return (entry.FanElectricalPower != null)
? PowerDemand(entry.FanElectricalPower)
: PowerDemand(entry.FanSpeed);
}
public Watt PowerDemand(Watt fanElectricalPower)
{
return fanElectricalPower / Constants.Auxiliaries.FanElectricToMechanicalEfficiency;
} }
}
}
} }
\ No newline at end of file
...@@ -837,9 +837,6 @@ ...@@ -837,9 +837,6 @@
<EmbeddedResource Include="Resources\XSD\VectoOutputManufacturer.0.7.2.xsd"> <EmbeddedResource Include="Resources\XSD\VectoOutputManufacturer.0.7.2.xsd">
<SubType>Designer</SubType> <SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Resources\XSD\VectoMonitoring.0.7.2.xsd">
<SubType>Designer</SubType>
</EmbeddedResource>
<None Include="Utils\VectoVersionCore.tt"> <None Include="Utils\VectoVersionCore.tt">
<Generator>TextTemplatingFileGenerator</Generator> <Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>VectoVersionCore.cs</LastGenOutput> <LastGenOutput>VectoVersionCore.cs</LastGenOutput>
......
...@@ -89,7 +89,8 @@ namespace TUGraz.VectoCore.Tests.Integration.VTP ...@@ -89,7 +89,8 @@ namespace TUGraz.VectoCore.Tests.Integration.VTP
[Category("Integration")] [Category("Integration")]
[TestCase(@"TestData\Integration\VTPMode\GenericVehicle\class_5_generic vehicle_DECL.vecto", 0.8972, TestName = "Generic Group 5 VTP Test Declaration Mode"), [TestCase(@"TestData\Integration\VTPMode\GenericVehicle\class_5_generic vehicle_DECL.vecto", 0.8972, TestName = "Generic Group 5 VTP Test Declaration Mode"),
TestCase(@"TestData\Integration\VTPMode\GenericVehicle XMLJob PTO\class_5_generic vehicle_DECL.vecto", 0.8925, TestName = "Generic Group 5 VTP Test Declaration Mode with PTO"), TestCase(@"TestData\Integration\VTPMode\GenericVehicle XMLJob PTO\class_5_generic vehicle_DECL.vecto", 0.8925, TestName = "Generic Group 5 VTP Test Declaration Mode with PTO"),
TestCase(@"TestData\Integration\VTPMode\GenericVehicle\class_3_generic vehicle_DECL.vecto", 1.0068, TestName = "Generic Group 3 VTP Test Declaration Mode") TestCase(@"TestData\Integration\VTPMode\GenericVehicle\class_3_generic vehicle_DECL.vecto", 1.0068, TestName = "Generic Group 3 VTP Test Declaration Mode"),
TestCase(@"TestData\Integration\VTPMode\GenericVehicle\class_5_generic vehicle_DECL_FanPel.vecto", 0.8968, TestName = "Generic Group 5 VTP Test Declaration Mode Fan Electrical Power")
] ]
public void RunVTP_Declaration(string jobFile, double expectedVTPFactor) public void RunVTP_Declaration(string jobFile, double expectedVTPFactor)
{ {
......
...@@ -50,6 +50,19 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent ...@@ -50,6 +50,19 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
var engineFan = new EngineFanAuxiliary(new[] { 5.5e-7, 14.62, 108.5 }, 0.225.SI<Meter>()); var engineFan = new EngineFanAuxiliary(new[] { 5.5e-7, 14.62, 108.5 }, 0.225.SI<Meter>());
Assert.AreEqual(expectedPowerDemand, engineFan.PowerDemand(fanSpeedRPM.RPMtoRad()).Value(), 1e-3); Assert.AreEqual(expectedPowerDemand, engineFan.PowerDemand(fanSpeedRPM.RPMtoRad()).Value(), 1e-3);
}
[
TestCase(14, 20),
TestCase(28, 40),
TestCase(7, 10)
]
public void TestEngineFanPowerDemandWithElectricalPower(double fanElectricalPower, double expectedPowerDemand)
{
var engineFan = new EngineFanAuxiliary(new[] { 5.5e-7, 14.62, 108.5 }, 0.225.SI<Meter>());
Assert.AreEqual(expectedPowerDemand, engineFan.PowerDemand(fanElectricalPower.SI<Watt>()).Value(), 1e-3);
} }
}
}
} }
\ No newline at end of file
source diff could not be displayed: it is too large. Options to address this: view the blob.
{
"Header": {
"CreatedBy": "",
"Date": "2018-05-02T11:40:41.8847449Z",
"AppVersion": "3",
"FileVersion": 4
},
"Body": {
"SavedInDeclMode": true,
"DeclarationVehicle": "Tractor_4x2_vehicle-class-5_Generic vehicle.xml",
"ManufacturerRecord": "Tractor_4x2_vehicle-class-5_Generic vehicle.RSLT_MANUFACTURER.xml",
"Mileage": 10000.0,
"NCVTestFuel": 41.0,
"FanPowerCoefficients": [
5.5E-07,
15.0,
108.5
],
"FanDiameter": 0.225,
"Cycles": [
"VTP_rural_2Hz_FanPel.vdri"
]
}
}
\ No newline at end of file
...@@ -2571,6 +2571,9 @@ ...@@ -2571,6 +2571,9 @@
<None Include="TestData\Integration\VTPMode\GenericVehicle\class_3_generic vehicle_DECL.vecto"> <None Include="TestData\Integration\VTPMode\GenericVehicle\class_3_generic vehicle_DECL.vecto">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Include="TestData\Integration\VTPMode\GenericVehicle\class_5_generic vehicle_DECL_FanPel.vecto">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="TestData\Integration\VTPMode\GenericVehicle\VTP cycle_RD_2Hz.vdri"> <None Include="TestData\Integration\VTPMode\GenericVehicle\VTP cycle_RD_2Hz.vdri">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
...@@ -2580,6 +2583,9 @@ ...@@ -2580,6 +2583,9 @@
<None Include="TestData\Integration\VTPMode\GenericVehicle\vtp_cycle_citybus_atser_2TC.vdri"> <None Include="TestData\Integration\VTPMode\GenericVehicle\vtp_cycle_citybus_atser_2TC.vdri">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Include="TestData\Integration\VTPMode\GenericVehicle\VTP_rural_2Hz_FanPel.vdri">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="TestData\Integration\VTPMode\GenericVehicle_CNG\class_5_generic vehicle_DECL.vecto"> <None Include="TestData\Integration\VTPMode\GenericVehicle_CNG\class_5_generic vehicle_DECL.vecto">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
......
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