1 package org.djunits.unit;
2
3 import org.djunits.quantity.Quantity;
4 import org.djunits.unit.scale.IdentityScale;
5 import org.djunits.unit.si.SIPrefixes;
6 import org.djunits.unit.unitsystem.UnitSystem;
7
8
9
10
11
12
13
14
15
16 public class FlowMassUnit extends Unit<FlowMassUnit>
17 {
18
19 private static final long serialVersionUID = 20140607L;
20
21
22 public static final Quantity<FlowMassUnit> BASE = new Quantity<>("FlowMass", "kg/s");
23
24
25 public static final FlowMassUnit SI = new FlowMassUnit().build(new Unit.Builder<FlowMassUnit>().setQuantity(BASE)
26 .setId("kg/s").setName("kilogram per second").setUnitSystem(UnitSystem.SI_BASE).setSiPrefixes(SIPrefixes.NONE, 1.0)
27 .setScale(IdentityScale.SCALE).setAdditionalAbbreviations("kg/sec"));
28
29
30 public static final FlowMassUnit KILOGRAM_PER_SECOND = SI;
31
32
33 public static final FlowMassUnit POUND_PER_SECOND =
34 KILOGRAM_PER_SECOND.deriveLinear(factorMD(MassUnit.POUND, DurationUnit.SECOND), "lb/s", "pound per second",
35 UnitSystem.IMPERIAL, "lb/s", "lb/s", "lb/sec");
36
37
38
39
40
41
42
43 private static double factorMD(final MassUnit mass, final DurationUnit duration)
44 {
45 return mass.getScale().toStandardUnit(1.0) / duration.getScale().toStandardUnit(1.0);
46 }
47
48 }