         sigma (/ mean 6)]
     (tuc/draw-normal mean sigma)))
 
-(def physical-quantities [:length :mass :pressure :volume :injection-rate :proppant-concentration])
-
-(defn rand-physical-quantity []
-  (rand-nth physical-quantities))
-
-(defn rand-unit [physical-quantity]
-  (let [quantity-units-map {:length [:ft :m]
-                            :mass [:lb :kg]
-                            :pressure [:psi :kPa :MPa]
-                            :volume [:bbl :m3]
-                            :injection-rate [:bbl-per-min :bpm :m3-per-min :m3/min]
-                            :proppant-concentration [:lb-per-gal :lb/gal :kg-per-m3 :kg/m3]}]
-    (fn [] (rand-nth (get quantity-units-map physical-quantity)))))
-
-(def rand-length-unit (rand-unit :length))
-(def rand-mass-unit (rand-unit :mass))
-(def rand-pressure-unit (rand-unit :pressure))
-(def rand-volume-unit (rand-unit :volume))
-(def rand-injection-rate-unit (rand-unit :injection-rate))
-(def rand-proppant-concentration-unit (rand-unit :proppant-concentration))
-
 (defn typical-monitor-pressure
   ([units]
    (cond (= units :psi)

        (keyword? arg)
        (repeatedly (fn [] (typical-surface-treating-pressure arg)))))

(defn typical-injection-rate
  ([]
   (let [unit (rand-injection-rate-unit)]
     [unit (typical-injection-rate unit)]))
  ([unit]
   (cond (or (= unit :bbl-per-min)
             (= unit :bpm))
         (value-from-typical-range 75 100)
         (or (= unit :m3-per-min)
             (= unit :m3/min))
         (value-from-typical-range 11.92 15.9))))

(defn injection-rate-seq [arg]
  (cond (int? arg)
        (let [unit (rand-injection-rate-unit)]
          [unit (take arg (injection-rate-seq unit))])
        (keyword? arg)
        (repeatedly (fn [] (typical-injection-rate arg)))))

(defn typical-proppant-concentration
  ([]
   (let [unit (rand-proppant-concentration-unit)]
     [unit (typical-proppant-concentration unit)]))
  ([unit]
   (cond (or (= unit :lb-per-gal)
             (= unit :lb/gal))
         (value-from-typical-range 0.2 10)
         (or (= unit :kg-per-m3)
             (= unit :kg/m3))
         (let [conversion (/ 0.453592 0.00378541)]
           (value-from-typical-range (* 0.2 conversion) (* 10 conversion))))))

(defn proppant-concentration-seq [arg]
  (cond (int? arg)

                   [:kPa :psi] #(/ % (factors [:psi :kPa]))
                   [:kPa :MPa] #(/ % (factors [:M :k]))
                   [:MPa :kPa] #(* % (factors [:M :k]))
                   [:lb-per-gal :kg-per-m3] #(* % (factors [:lb-per-gal :kg-per-m3]))
                   [:kg-per-m3 :lb-per-gal] #(/ % (factors [:lb-per-gal :kg-per-m3]))
                   [:m3-per-min :bbl-per-min] #(* % (factors [:m3 :bbl]))
                   [:bbl-per-min :m3-per-min] #(/ % (factors [:lb-per-gal :kg-per-m3]))
                   [:C :F] #(+ (* % 1.8) 32)}]
    (converter [from to])))

