pulo 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/lib/pulo.rb +28 -0
  3. data/lib/pulo/exceptions.rb +6 -0
  4. data/lib/pulo/figure/figure2d.rb +248 -0
  5. data/lib/pulo/figure/figure3d.rb +166 -0
  6. data/lib/pulo/formatting.rb +140 -0
  7. data/lib/pulo/frames/frame.rb +289 -0
  8. data/lib/pulo/frames/frame_cell.rb +83 -0
  9. data/lib/pulo/frames/frame_column.rb +149 -0
  10. data/lib/pulo/frames/frame_row.rb +87 -0
  11. data/lib/pulo/helpers.rb +1 -0
  12. data/lib/pulo/machine/hydraulics/pipe.rb +71 -0
  13. data/lib/pulo/machine/machines.rb +10 -0
  14. data/lib/pulo/machine/mechanics/moments_of_inertia.rb +64 -0
  15. data/lib/pulo/machine/steam/boiler.rb +61 -0
  16. data/lib/pulo/machine/steam/boiler_deaerator.rb +64 -0
  17. data/lib/pulo/machine/steam/deaerator.rb +37 -0
  18. data/lib/pulo/machine/steam/desuperheater.rb +29 -0
  19. data/lib/pulo/machine/steam/header.rb +20 -0
  20. data/lib/pulo/machine/steam/if97.rb +378 -0
  21. data/lib/pulo/machine/steam/steam_process.rb +27 -0
  22. data/lib/pulo/machine/steam/steam_turbine.rb +42 -0
  23. data/lib/pulo/machine/steam/water_steam.rb +229 -0
  24. data/lib/pulo/material/water.rb +34 -0
  25. data/lib/pulo/quantity/dimension.rb +63 -0
  26. data/lib/pulo/quantity/numeric_overloads.rb +217 -0
  27. data/lib/pulo/quantity/quantity.rb +285 -0
  28. data/lib/pulo/quantity/quantity_builder.rb +185 -0
  29. data/lib/pulo/quantity/quantity_definitions.rb +8 -0
  30. data/lib/pulo/quantity/quantity_definitions/area_volume.rb +73 -0
  31. data/lib/pulo/quantity/quantity_definitions/basic.rb +157 -0
  32. data/lib/pulo/quantity/quantity_definitions/electric.rb +22 -0
  33. data/lib/pulo/quantity/quantity_definitions/energy.rb +50 -0
  34. data/lib/pulo/quantity/quantity_definitions/fluids.rb +23 -0
  35. data/lib/pulo/quantity/quantity_definitions/force_power.rb +82 -0
  36. data/lib/pulo/quantity/quantity_definitions/rotation.rb +49 -0
  37. data/lib/pulo/quantity/quantity_definitions/value.rb +65 -0
  38. data/lib/pulo/quantity/quantity_definitions/velocity_acc_flow.rb +66 -0
  39. data/lib/pulo/quantity/quantity_groups/quantity_groups.rb +36 -0
  40. data/lib/pulo/quantity/unit.rb +45 -0
  41. data/lib/pulo/quantity_checker.rb +13 -0
  42. data/lib/pulo/tables/density.rb +10 -0
  43. data/lib/pulo/tables/melting_temperature.rb +9 -0
  44. data/lib/pulo/tables/specific_energy.rb +10 -0
  45. data/lib/pulo/tables/speed_of_sound.rb +9 -0
  46. data/lib/pulo/tables/tables.rb +104 -0
  47. data/lib/pulo/tables/tensile_strength.rb +10 -0
  48. data/lib/pulo/tables/yield_strength.rb +10 -0
  49. data/lib/pulo/version.rb +3 -0
  50. metadata +51 -3
@@ -0,0 +1,8 @@
1
+ require_relative './quantity_definitions/basic'
2
+ require_relative './quantity_definitions/area_volume'
3
+ require_relative './quantity_definitions/velocity_acc_flow'
4
+ require_relative './quantity_definitions/force_power'
5
+ require_relative './quantity_definitions/energy'
6
+ require_relative './quantity_definitions/rotation'
7
+ require_relative './quantity_definitions/fluids'
8
+ require_relative './quantity_definitions/value'
@@ -0,0 +1,73 @@
1
+ # encoding: utf-8
2
+
3
+ module Pulo
4
+
5
+ QuantityBuilder.build(:Area) do
6
+ dimensions L:2
7
+
8
+ si_unit :square_kilometer,:s, 'km²',10**6
9
+ si_unit :square_meter,:s, 'm²',1
10
+ si_unit :square_centimeter,:s, 'cm²',10**-4
11
+ si_unit :square_millimeter,:s, 'mm²',10**-6
12
+ si_unit :square_micrometer,:s, 'μm²',10**-12
13
+ si_unit :square_nanometer,:s, 'nm²',10**-18
14
+
15
+ non_si_unit :hectare,:s, 'ha',:square_meters,1.0/10000
16
+
17
+ non_si_unit :acre,:s, 'ac',:square_kilometer,247.105
18
+ non_si_unit :square_mile,:s, 'mi²',:square_kilometer,0.386102
19
+ non_si_unit :square_yard,:s, 'yd²',:square_meter,1.19599
20
+ non_si_unit :square_foot,:square_feet, 'ft²',:square_meter,10.7639
21
+ non_si_unit :square_inch,:square_inches, 'in²',:square_centimeter,0.15500031
22
+
23
+ synonyms :Extent, :Coverage
24
+ end
25
+
26
+ QuantityBuilder.build(:Volume) do
27
+ dimensions L:3
28
+
29
+ si_unit :cubic_kilometer,:s, 'km³',10**9
30
+ si_unit :cubic_meter,:s, 'm³',1
31
+ si_unit :cubic_centimeter,:s, 'cm³',10**-6
32
+ si_unit :cubic_millimeter,:s, 'mm³',10**-9
33
+ si_unit :cubic_micrometer,:s, 'μm³',10**-18
34
+ si_unit :cubic_nanometer,:s, 'nm³',10**-27
35
+
36
+ non_si_unit :megalitre,:s, 'Mlt',:cubic_meter,10.0**-3
37
+ non_si_unit :litre,:s, 'lt',:cubic_meter,10.0**3
38
+ non_si_unit :hectolitre,:s, 'hl',:cubic_meter,10.0
39
+ non_si_unit :millilitre,:s, 'ml',:cubic_centimeter,1
40
+
41
+ non_si_unit :cubic_mile,:s, 'mi³',:cubic_kilometer,0.239912759
42
+ non_si_unit :cubic_yard,:s, 'yd³',:cubic_meter,1.30795062
43
+ non_si_unit :cubic_foot,:cubic_feet, 'ft³',:cubic_meter,35.3147
44
+ non_si_unit :cubic_inch,:cubic_inches, 'in³',:cubic_centimeter,0.0610237441
45
+
46
+ non_si_unit :gallon,:s, 'gal',:cubic_meter,264.172
47
+ non_si_unit :pint,:s, 'pint',:cubic_meter,2113.38
48
+ non_si_unit :beer_barrel,:s,'bbl',:cubic_meter,10.0**3/117
49
+
50
+ synonyms :Capacity
51
+ end
52
+
53
+ QuantityBuilder.build(:Density) do
54
+ dimensions M:1,L:-3
55
+ si_unit :kilogram_per_cubic_meter,:sf, 'kg.m⁻³',1
56
+ si_unit :gram_per_cubic_centimeter,:sf, 'g.cm⁻³',10**3
57
+
58
+ non_si_unit :ounce_per_cubic_inch,:sf, 'oz.in⁻³',:gram_per_cubic_centimeter,0.578036672
59
+ non_si_unit :pound_per_cubic_foot,:sf, 'lb.ft⁻³',:kilogram_per_cubic_meter,0.0624279606
60
+ non_si_unit :pound_per_cubic_yard,:sf, 'lb.yd⁻³',:kilogram_per_cubic_meter,1.68555494
61
+ non_si_unit :pound_per_gallon,:sf, 'lb.gal⁻¹',:kilogram_per_cubic_meter,0.00834540445
62
+
63
+ constant :water, '',:kilogram_per_cubic_meter,1000
64
+ end
65
+
66
+ QuantityBuilder.build(:SpecificVolume) do
67
+ dimensions M:-1,L:3
68
+ si_unit :cubic_meter_per_kilogram,:cubic_meters_per_kilogram, 'm³.kg⁻¹',1
69
+ si_unit :cubic_centimeter_per_kilogram,:cubic_centimeters_per_kilogram, 'cm³.kg⁻¹',10**-6
70
+ non_si_unit :cubic_foot_per_pound,:cubic_feet_per_pound, 'ft³.lb⁻¹',:cubic_meter_per_kilogram,16.0184634
71
+ end
72
+
73
+ end
@@ -0,0 +1,157 @@
1
+ # encoding: utf-8
2
+
3
+ module Pulo
4
+ QuantityBuilder.build(:Dimensionless) do
5
+ dimensions L: 0
6
+ si_unit :n, :n, '', 1
7
+ si_unit :percent, :percent, 'pct', 0.01
8
+ synonyms :Efficiency, :Ratio, :Factor, :Count
9
+ end
10
+
11
+ QuantityBuilder.build(:Angle) do
12
+ dimensions L: 0
13
+ si_unit :radian, :radians, 'rad', 1
14
+ non_si_unit :degree, :s, 'deg', :radian, 360.0/(2*Math::PI)
15
+
16
+ constant :pi, 'pi', :radian, Math::PI
17
+ end
18
+ class Angle
19
+ def self.percent value
20
+ Angle.radians(Math::atan(value/100.0)).degrees
21
+ end
22
+ def self.one_in value
23
+ Angle.radians(Math::atan(1.0/value)).degrees
24
+ end
25
+ end
26
+
27
+ QuantityBuilder.build(:Length) do
28
+ dimensions L: 1
29
+ si_unit :meter, :s, 'm', 1.0
30
+ si_unit :centimeter, :s, 'cm', 10.0**-2
31
+ si_unit :kilometer, :s, 'km', 10**3
32
+ si_unit :millimeter, :s, 'mm', 10.0**-3
33
+ si_unit :micrometer, :s, 'um', 10.0**-6
34
+ si_unit :nanometer, :s, 'nm', 10.0**-9
35
+
36
+ non_si_unit :mile, :s, 'mi', :kilometer, 1.0/1.609344
37
+ non_si_unit :yard, :s, 'yd', :meter, 1.09361
38
+ non_si_unit :foot, :feet, 'ft', :meter, 1/0.3048
39
+ non_si_unit :inch, :inches, 'in', :millimeter, 1.0/25.4
40
+ non_si_unit :thou, :thou, 'th', :millimeter, 1.0/0.0254
41
+
42
+ non_si_unit :chain, :s, 'ch', :meter, 1.0/20.1168
43
+ non_si_unit :furlong, :s, 'fu', :kilometer, 1.0/0.201168
44
+
45
+ non_si_unit :astronomical_unit, :s, 'AU', :kilometer, 1.0/149597870.7
46
+ non_si_unit :parsec, :s, 'pc', :kilometer, 1.0/(3.0856776*10**13)
47
+ non_si_unit :lightyear, :s, 'ly', :kilometer, 1.0/(9.4607*10**13)
48
+
49
+ non_si_unit :fathom, :s, 'fth', :meter, 0.546806649
50
+ non_si_unit :cable, :s, 'cbl', :kilometer, 1000.0/185.2
51
+ non_si_unit :nautical_mile, :s, 'nm', :kilometer, 1000.0/1852
52
+
53
+ synonyms :Width, :Depth, :Height, :Head, :Distance, :Displacement, :Precipitation, :Elevation
54
+ end
55
+
56
+ QuantityBuilder.build(:Duration) do
57
+ dimensions T: 1
58
+
59
+ si_unit :day, :s, 'dy', 3600*24
60
+ si_unit :hour, :s, 'hr', 3600
61
+ si_unit :minute, :s, 'min', 60
62
+ si_unit :second, :s, 'sec', 1
63
+ si_unit :millisecond, :s, 'ms', 10.0**-3
64
+ si_unit :microsecond, :s, 'μs', 10.0**-6
65
+ si_unit :nanosecond, :s, 'ns', 10.0**-9
66
+
67
+ non_si_unit :year, :s, 'yr', :day, 1.0/365
68
+ non_si_unit :month, :s, 'mnth', :day, 1.0/(365.0/12)
69
+ non_si_unit :week, :s, 'wk', :day, 1.0/7
70
+
71
+
72
+ synonyms :Period, :Timing, :Interval
73
+ end
74
+
75
+ QuantityBuilder.build(:Frequency) do
76
+ dimensions T: -1
77
+ si_unit :hertz, :hertz, 'Hz', 1
78
+ si_unit :kilohertz, :kilohertz, 'kHz', 10**3
79
+ si_unit :megahertz, :megahertz, 'MHz', 10**6
80
+
81
+ end
82
+
83
+ QuantityBuilder.build(:Mass) do
84
+ dimensions M: 1
85
+ si_unit :tonne, :s, 't', 10**3
86
+ si_unit :kilogram, :s, 'kg', 1
87
+ si_unit :gram, :s, 'g', 10**-3
88
+ si_unit :milligram, :s, 'mg', 10**-6
89
+ si_unit :microgram, :s, 'μg', 10**-9
90
+
91
+ non_si_unit :grain, :s, 'gr', :gram, 15.4323584
92
+ non_si_unit :drachm, :s, 'dr', :gram, 0.56438339119727
93
+ non_si_unit :ounce, :s, 'oz', :gram, 0.035274
94
+ non_si_unit :pound, :s, 'lb', :kilogram, 2.20462
95
+ non_si_unit :stone, :stone, 'st', :kilogram, 0.157473
96
+ non_si_unit :quarter, :s, 'qr', :kilogram, 0.078736522
97
+
98
+ non_si_unit :hundredweight, :s, 'cwt', :tonne, 0.050802345
99
+ non_si_unit :short_ton, :s, 'short ton', :tonne, 1.10231
100
+ non_si_unit :long_ton, :s, 'long ton', :tonne, 0.984207
101
+
102
+ non_si_unit :solar_unit, :s, 'Mo', :kilogram, 1.0/(1.98855*10**30)
103
+
104
+ synonyms :Weight, :Heft
105
+ end
106
+
107
+ QuantityBuilder.build(:Temperature) do
108
+ dimensions K: 1
109
+
110
+ si_unit :kelvin, :kelvin, 'K', 1
111
+
112
+ non_si_unit :celsius, :degrees_celsius, '°C', :kelvin, 1
113
+ non_si_unit :fahrenheit, :degrees_fahrenheit, '°F', :kelvin, 5.0/9
114
+
115
+ end
116
+ class Temperature
117
+ def kelvin
118
+ case self.unit.name
119
+ when :kelvin
120
+ self
121
+ when :celsius
122
+ self.class.new(self.value+273.15, :kelvin)
123
+ when :fahrenheit
124
+ self.class.new((5.0/9.0*(self.value-32.0))+273.15, :kelvin)
125
+ else
126
+ self
127
+ end
128
+ end
129
+
130
+ def celsius
131
+ case self.unit.name
132
+ when :celcius
133
+ self
134
+ when :kelvin
135
+ self.class.new(self.value-273.15, :celsius)
136
+ when :fahrenheit
137
+ self.class.new((5.0/9.0*(self.value-32.0)), :celsius)
138
+ else
139
+ self
140
+ end
141
+ end
142
+
143
+ def fahrenheit
144
+ case self.unit.name
145
+ when :fahrenheit
146
+ self
147
+ when :celsius
148
+ self.class.new((9.0/5.0*self.value)+32.0, :fahrenheit)
149
+ when :kelvin
150
+ self.class.new((9.0/5.0*(self.value-273.15))+32.0, :fahrenheit)
151
+ else
152
+ self
153
+ end
154
+ end
155
+ end
156
+
157
+ end
@@ -0,0 +1,22 @@
1
+ # encoding: utf-8
2
+
3
+ module Pulo
4
+
5
+ QuantityBuilder.build(:Current) do
6
+ dimensions I:1
7
+ si_unit :amp,:s, 'A',1
8
+ si_unit :milliamp,:s, 'mA',10**-3
9
+ si_unit :microamp,:s, 'μA',10**-6
10
+ end
11
+
12
+ QuantityBuilder.build(:Resistance) do
13
+ dimensions M:1,L:2,T:-3,I:-2
14
+ si_unit :ohm,:s, 'Ω',1
15
+ end
16
+
17
+ QuantityBuilder.build(:Voltage) do
18
+ dimensions M:1,L:2,T:-3,I:-1
19
+ si_unit :volt,:s, 'V',1
20
+ end
21
+
22
+ end
@@ -0,0 +1,50 @@
1
+ # encoding: utf-8
2
+
3
+ module Pulo
4
+
5
+ QuantityBuilder.build(:Energy) do
6
+ dimensions M:1,L:2,T:-2
7
+
8
+ si_unit :joule,:s, 'J',1
9
+ si_unit :kilojoule,:s, 'kJ',10**3
10
+ si_unit :megajoule,:s, 'MJ',10**6
11
+ si_unit :gigajoule,:s, 'GJ',10**9
12
+
13
+ non_si_unit :kilowatt_hour,:s, 'kWh',:megajoule,0.277777778
14
+ non_si_unit :megawatt_hour,:s, 'MWh',:megajoule,0.000277777778
15
+ non_si_unit :gigawatt_hour,:s, 'GWh',:gigajoule,0.000277777778
16
+ non_si_unit :erg,:s, 'erg',:joule,10**7
17
+ non_si_unit :calorie,:s, 'cal',:joule,0.239005736
18
+ non_si_unit :kilocalorie,:s, 'kcal',:kilojoule,0.239005736
19
+ non_si_unit :btu,:s, 'Btu',:megajoule,947.81712
20
+ non_si_unit :million_btu,:million_btu, 'MMBtu',:gigajoule,947.81712/1000
21
+ non_si_unit :therm,:s, 'thm',:gigajoule,947.81712/100
22
+ non_si_unit :foot_pound,:s, 'ft.lb',:kilojoule,737.562149
23
+
24
+ synonyms :Enthalpy
25
+ end
26
+ QuantityBuilder.build(:SpecificEnergy) do
27
+ dimensions L:2,T:-2
28
+ si_unit :joule_per_kilogram,:sf,'J.kg⁻¹',1
29
+ si_unit :kilojoule_per_kilogram,:sf,'kJ.kg⁻¹',10**3
30
+ si_unit :megajoule_per_kilogram,:sf,'MJ.kg⁻¹',10**6
31
+
32
+ non_si_unit :megajoules_per_tonne,:sf,'MJ.t⁻¹',:megajoule_per_kilogram,1000
33
+ non_si_unit :kilocalorie_per_kilogram,:sf,'kcal.kg⁻¹',:kilojoule_per_kilogram,0.239005736
34
+ non_si_unit :btu_per_pound,:btu_per_pound,'Btu.lb⁻¹',:kilojoule_per_kilogram,0.429922614
35
+
36
+ synonyms :SpecificEnthalpy,:CalorificValue,:HHV,:LHV
37
+ end
38
+ QuantityBuilder.build(:SpecificHeat) do
39
+ dimensions L:2,T:-2,K:-1
40
+
41
+ si_unit :joule_per_kilogram_kelvin,:sf, 'J.kg⁻¹.K⁻¹',1
42
+ si_unit :kilojoule_per_kilogram_kelvin,:sf, 'kJ.kg⁻¹.K⁻¹',10**3
43
+ si_unit :megajoule_per_kilogram_kelvin,:sf, 'MJ.kg⁻¹.K⁻¹',10**6
44
+
45
+ non_si_unit :btu_per_pound_rankine,:btu_per_pound_rankine,'Btu.lb⁻¹.R⁻¹',:kilojoule_per_kilogram_kelvin,0.238845896627
46
+
47
+ synonyms :SpecificEntropy,:SpecificHeatCapacity
48
+ end
49
+
50
+ end
@@ -0,0 +1,23 @@
1
+ # encoding: utf-8
2
+
3
+ module Pulo
4
+
5
+ QuantityBuilder.build(:DynamicViscosity) do
6
+ dimensions M:1,L:-1,T:-1
7
+
8
+ si_unit :millipascal_second,:s, 'mPa.s',10**-3
9
+ si_unit :pascal_second,:s, 'Pa.s',1
10
+ si_unit :kilopascal_second,:s, 'kPa.s',10**3
11
+
12
+ synonyms :Viscosity
13
+ end
14
+
15
+ QuantityBuilder.build(:KinematicViscosity) do
16
+ dimensions L:2,T:-1
17
+
18
+ si_unit :millistoke,:s, 'mSt',10**-7
19
+ si_unit :centistoke,:s, 'cSt',10**-6
20
+ si_unit :stoke,:s, 'St',10**-4
21
+ end
22
+
23
+ end
@@ -0,0 +1,82 @@
1
+ # encoding: utf-8
2
+
3
+ module Pulo
4
+
5
+ QuantityBuilder.build(:Force) do
6
+ dimensions M:1,L:1,T:-2
7
+
8
+ si_unit :millinewton,:s, 'mN',10**-3
9
+ si_unit :newton,:s, 'N',1
10
+ si_unit :kilonewton,:s, 'kN',10**3
11
+ si_unit :meganewton,:s, 'MN',10**6
12
+
13
+ non_si_unit :pound_force,:pound_force, 'lbf',:newton,0.224808943
14
+ non_si_unit :dyne,:dyne, 'dyn',:newton,10**5
15
+
16
+ end
17
+
18
+ QuantityBuilder.build(:Momentum) do
19
+ dimensions M:1,L:1,T:-1
20
+
21
+ si_unit :millinewton_second,:s, 'mN.s',10**-3
22
+ si_unit :newton_second,:s, 'N.s',1
23
+ si_unit :kilonewton_second,:s, 'kN.s',10**3
24
+ si_unit :meganewton_second,:s, 'MN.s',10**6
25
+
26
+ end
27
+
28
+ QuantityBuilder.build(:Power) do
29
+ dimensions M:1,L:2,T:-3
30
+
31
+ si_unit :milliwatt,:s, 'mW',10**-3
32
+ si_unit :watt,:s, 'W',1
33
+ si_unit :kilowatt,:s, 'kW',10**3
34
+ si_unit :megawatt,:s, 'MW',10**6
35
+ si_unit :gigawatt,:s, 'GW',10**9
36
+
37
+
38
+ non_si_unit :erg_per_second,:sf, 'erg.s⁻¹',:milliwatt,10000
39
+ non_si_unit :btu_per_hour,:btu_per_hour,'Btu.hr⁻¹',:watt,3.41214163
40
+ non_si_unit :foot_pound_per_minute,:foot_pounds_per_minute, 'ft.lb.min⁻¹',:watt,44.253729
41
+ non_si_unit :horsepower,:horsepower, 'hp',:kilowatt,1.34102209
42
+ non_si_unit :metric_horsepower,:metric_horsepower, 'mhp',:kilowatt,1.35962162
43
+ non_si_unit :million_btu_per_hour,:sf,'MMBtu.hr⁻¹',:megawatt,3.41214163
44
+ non_si_unit :gigawatt_hour_per_year,:gigawatt_hours_per_year, 'GW.hr.yr⁻¹',:gigawatt,24.0*365
45
+ non_si_unit :kilowatt_hour_per_year,:kilowatt_hours_per_year, 'kW.hr.yr⁻¹',:kilowatt,24.0*365
46
+ non_si_unit :kilowatt_hour_per_month,:kilowatt_hours_per_month, 'KW.hr.mnth⁻¹',:kilowatt,24.0*365/12
47
+ end
48
+ QuantityBuilder.build(:Pressure) do
49
+ dimensions M:1,L:-1,T:-2
50
+
51
+ si_unit :pascal,:s, 'Pa',1
52
+ si_unit :kilopascal,:s, 'kPa',10**3
53
+ si_unit :megapascal,:s, 'MPa',10**6
54
+
55
+ non_si_unit :hectopascal,:s, 'hPa',:pascal,1.0/100
56
+ non_si_unit :bar,:bar, 'bar',:kilopascal,0.01
57
+ non_si_unit :millibar,:s, 'mbar',:pascal,0.01
58
+ non_si_unit :torr,:torr, 'tor',:kilopascal,7.50061683
59
+ non_si_unit :atmosphere,:s, 'atm',:megapascal,9.86923267
60
+ non_si_unit :pounds_per_square_inch,:psia, 'psia',:kilopascal,0.145037738
61
+ non_si_unit :pounds_per_square_inch_gauge,:psig, 'psig',:kilopascal,0.145037738
62
+ non_si_unit :pound_per_square_foot,:sf, 'psf',:kilopascal,20.8854342
63
+ non_si_unit :inch_of_mercury,:inches_of_mercury, 'inHg',:kilopascal,0.295333727
64
+ non_si_unit :millimeter_of_mercury,:sf, 'mmHg',:kilopascal,7.50061683
65
+
66
+ non_si_unit :megajoule_per_litre,:sf, 'MJ.lt⁻¹',:megapascal,10**-3
67
+ non_si_unit :megajoule_per_hectolitre,:sf, 'MJ.hl⁻¹',:megapascal,10**-1
68
+
69
+ synonyms :EnergyDensity, :VolumeEnergyDemand, :Stress, :TensileStrength, :YieldStrength
70
+ end
71
+ class Pressure
72
+ class << self
73
+ def psig(val)
74
+ self.psia(val+14.7)
75
+ end
76
+ end
77
+ def psig
78
+ self.class.new(self.psia.value-14.7,:pounds_per_square_inch_gauge)
79
+ end
80
+ end
81
+
82
+ end
@@ -0,0 +1,49 @@
1
+ # encoding: utf-8
2
+
3
+ module Pulo
4
+
5
+ QuantityBuilder.build(:AngularVelocity) do
6
+ dimensions T:-1
7
+ si_unit :radian_per_second,:sf, 'rad.s⁻¹',1
8
+ non_si_unit :rpm, :rpm, 'rpm', :radian_per_second, 60/(2*Math::PI)
9
+
10
+ end
11
+ #overide the standard methods for conversion between AngularVelocity and Frequency as it is not 1 to 1
12
+ class AngularVelocity
13
+ def frequency
14
+ Frequency.hertz(self.radian_per_second.value/(Math::PI*2))
15
+ end
16
+ end
17
+ class Frequency
18
+ def angularvelocity
19
+ AngularVelocity.radian_per_second(self.hertz.value*(Math::PI*2))
20
+ end
21
+ end
22
+
23
+ QuantityBuilder.build(:AngularAcceleration) do
24
+ dimensions T:-2
25
+ si_unit :radian_per_second_squared,:sf, 'rad.s⁻²',1
26
+ end
27
+
28
+ QuantityBuilder.build(:MomentOfInertia) do
29
+ dimensions M:1,L:2
30
+ si_unit :gram_meters_squared,:sf, 'g.m²',10**-3
31
+ si_unit :kilogram_meters_squared,:sf, 'kg.m²',1
32
+ end
33
+
34
+ QuantityBuilder.build(:AngularMomentum) do
35
+ dimensions M:1,L:2,T:-1
36
+ si_unit :gram_meters_squared_per_second,:sf, 'g.m².s⁻¹',10**-3
37
+ si_unit :kilogram_meters_squared_per_second,:sf, 'kg.m².s⁻¹',1
38
+ end
39
+
40
+ QuantityBuilder.build(:Torque) do
41
+ dimensions M:1,L:2,T:-2
42
+
43
+ si_unit :millinewton_meter,:s, 'mN.m',10**-3
44
+ si_unit :newton_meter,:s, 'N.m',1
45
+ si_unit :kilonewton_meter,:s, 'kN.m',10**3
46
+ si_unit :meganewton_meter,:s, 'MN.m',10**6
47
+ end
48
+
49
+ end