diff --git a/qsdsan/utils/__init__.py b/qsdsan/utils/__init__.py index 6eb3f8cf..5f5317b3 100644 --- a/qsdsan/utils/__init__.py +++ b/qsdsan/utils/__init__.py @@ -13,17 +13,31 @@ ''' # Units of measure -import os from thermosteam.units_of_measure import ( ureg, AbsoluteUnitsOfMeasure as auom, RelativeUnitsOfMeasure as ruom, ) -path = os.path.join(os.path.dirname(os.path.realpath(__file__)), - 'units_definition.txt') -ureg.load_definitions(path) - +# Additional unit definition +ureg.define('sq_m = m2') +ureg.define('cu_m = m3') +ureg.define('sq_cm = cm2') +ureg.define('cu_cm = cm3') +ureg.define('sq_ft = ft2') +ureg.define('cu_ft = ft3') +ureg.define('cu_in = in3') +ureg.define('yd3 = yard**3 = yd3 = cu_yd') +ureg.define('cfm = cf/minute = CFM') +ureg.define('cfs = cf/second = CFS') +ureg.define('yr = year = yr = y') +ureg.define('hr = hour = hr = h') +ureg.define('d = day') +ureg.define('each = count = ea') +ureg.define('unit = count') +ureg.define('point = points') +ureg.define('MGD = 1e6 * gallon / day') +ureg.define('mgd = MGD') from . import ( cod, diff --git a/qsdsan/utils/units_definition.txt b/qsdsan/utils/units_definition.txt deleted file mode 100644 index 5d70c6fc..00000000 --- a/qsdsan/utils/units_definition.txt +++ /dev/null @@ -1,20 +0,0 @@ -m2 = m**2 = m2 = sq_meter = sq_m -m3 = m**3 = m3 = cu_meter = cu_m -cm2 = (cm)**2 = cm2 = sq_centimeter = sq_cm -cm3 = (cm)**3 = cm3 = cu_centimeter = cu_cm -ft2 = ft**2 = ft2 = sq_ft -ft3 = ft**3 = ft3 = cu_ft = cf -in3 = in**3 = in3 = cu_in -yd3 = yard**3 = yd3 = cu_yd -cfm = cf/minute = CFM -cfs = cf/second = CFS -yr = year = yr = y -hr = hour = hr = h -d = day -USD = usd -each = count = ea -unit = count -point = points -MM- = 10**6 = mm- -MGD = 1e6 * gallon / day -mgd = MGD \ No newline at end of file