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

Skip to content
Snippets Groups Projects
Commit ef51a7b2 authored by Markus QUARITSCH's avatar Markus QUARITSCH
Browse files

efficiency for loss map must be between 0 and 1

parent ab0f2f6e
No related branches found
No related tags found
No related merge requests found
......@@ -64,6 +64,12 @@ namespace TUGraz.VectoCore.InputData.Reader.ComponentData
/// <returns></returns>
public static TransmissionLossMap Create(double efficiency, double gearRatio, string gearName)
{
if (efficiency <= 0) {
throw new VectoException("Efficiency for gear {0} must be greater than 0", gearName);
}
if (efficiency > 1) {
throw new VectoException("Efficiency for gear {1} must not be greater than 1", gearName);
}
var entries = new List<TransmissionLossMap.GearLossMapEntry> {
new TransmissionLossMap.GearLossMapEntry(0.RPMtoRad(), 1e5.SI<NewtonMeter>(),
(1 - efficiency) * 1e5.SI<NewtonMeter>()),
......
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