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 PressureUnit extends Unit<PressureUnit>
17 {
18
19 private static final long serialVersionUID = 20140607L;
20
21
22 public static final Quantity<PressureUnit> BASE = new Quantity<>("Pressure", "kg/ms2");
23
24
25 public static final PressureUnit SI =
26 new PressureUnit().build(new Unit.Builder<PressureUnit>().setQuantity(BASE).setId("Pa").setName("pascal")
27 .setUnitSystem(UnitSystem.SI_DERIVED).setSiPrefixes(SIPrefixes.UNIT, 1.0).setScale(IdentityScale.SCALE));
28
29
30 public static final PressureUnit PASCAL = SI;
31
32
33 public static final PressureUnit HECTOPASCAL = PASCAL.deriveLinear(100.0, "hPa", "hectopascal");
34
35
36 public static final PressureUnit KILOPASCAL = PASCAL.deriveLinear(1000.0, "kPa", "kilopascal");
37
38
39 public static final PressureUnit ATMOSPHERE_STANDARD =
40 PASCAL.deriveLinear(101325.0, "atm", "atmosphere (standard)", UnitSystem.OTHER);
41
42
43 public static final PressureUnit TORR = ATMOSPHERE_STANDARD.deriveLinear(1.0 / 760.0, "torr", "Torr");
44
45
46 public static final PressureUnit ATMOSPHERE_TECHNICAL = SI.deriveLinear(
47 factorFA(ForceUnit.KILOGRAM_FORCE, AreaUnit.SQUARE_CENTIMETER), "at", "atmosphere (technical)", UnitSystem.OTHER);
48
49
50 public static final PressureUnit BARYE =
51 SI.deriveLinear(factorFA(ForceUnit.DYNE, AreaUnit.SQUARE_CENTIMETER), "Ba", "barye", UnitSystem.CGS);
52
53
54 public static final PressureUnit BAR = SI.deriveLinear(1.0E5, "bar", "bar", UnitSystem.OTHER);
55
56
57 public static final PressureUnit MILLIBAR = BAR.deriveLinear(1.0E-3, "mbar", "millibar");
58
59
60 public static final PressureUnit CENTIMETER_MERCURY =
61 PASCAL.deriveLinear(1333.224, "cmHg", "centimeter mercury", UnitSystem.OTHER);
62
63
64 public static final PressureUnit MILLIMETER_MERCURY =
65 PASCAL.deriveLinear(133.3224, "mmHg", "millimeter mercury", UnitSystem.OTHER);
66
67
68 public static final PressureUnit FOOT_MERCURY =
69 PASCAL.deriveLinear(40.63666E3, "ftHg", "foot mercury", UnitSystem.IMPERIAL);
70
71
72 public static final PressureUnit INCH_MERCURY =
73 PASCAL.deriveLinear(3.386389E3, "inHg", "inch mercury", UnitSystem.IMPERIAL);
74
75
76 public static final PressureUnit KGF_PER_SQUARE_MM =
77 SI.deriveLinear(factorFA(ForceUnit.KILOGRAM_FORCE, AreaUnit.SQUARE_MILLIMETER), "kgf/mm^2",
78 "kilogram-force per square millimeter", UnitSystem.OTHER);
79
80
81 public static final PressureUnit POUND_PER_SQUARE_FOOT =
82 SI.deriveLinear(factorFA(ForceUnit.POUND_FORCE, AreaUnit.SQUARE_FOOT), "lbf/ft^2", "pound-force per square foot",
83 UnitSystem.IMPERIAL);
84
85
86 public static final PressureUnit POUND_PER_SQUARE_INCH =
87 SI.deriveLinear(factorFA(ForceUnit.POUND_FORCE, AreaUnit.SQUARE_INCH), "lbf/in^2", "pound-force per square inch",
88 UnitSystem.IMPERIAL);
89
90
91 public static final PressureUnit PIEZE =
92 SI.deriveLinear(factorFA(ForceUnit.STHENE, AreaUnit.SQUARE_METER), "pz", "pi\u00E8ze", UnitSystem.MTS);
93
94
95
96
97
98
99
100 private static double factorFA(final ForceUnit force, final AreaUnit area)
101 {
102 return force.getScale().toStandardUnit(1.0) / area.getScale().toStandardUnit(1.0);
103 }
104
105 }