Coverage for test_spill.py : 100%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
#!/usr/bin/env python # -*- coding: utf-8 -*-
# make the environment def env():
# make the locations def Location(): (core.Identifiable, # Give it a name core.Log, # Allow logging of all discrete events core.Locatable, # Add coordinates to extract distance information and visualize core.HasContainer, # Add information on the material available at the site core.HasResource, # Add information on serving equipment core.HasSoil, # Add soil layers and information core.HasSpill), # Add tracking of spill {})
# make a location with spill requirement def LocationReq(): (core.Identifiable, # Give it a name core.Log, # Allow logging of all discrete events core.Locatable, # Add coordinates to extract distance information and visualize core.HasContainer, # Add information on the material available at the site core.HasResource, # Add information on serving equipment core.HasSoil, # Add soil layers and information core.HasSpillCondition, # Add limit core.HasSpill), # Add tracking of spill {})
# make the soil objects def Soil():
# make the processors def Processor(): (core.Processor, core.Log, core.Locatable, core.HasPlume), {})
# make the movers def Mover(): (core.Movable, core.Log, core.HasResource, core.HasContainer, core.HasPlume, core.HasSoil), {})
""" Using values from Becker [2014], https://www.sciencedirect.com/science/article/pii/S0301479714005143.
density = the density of the dredged material fines = the percentage of fines in the dredged material volume = the dredged volume dredging_duration = duration of the dredging event overflow_duration = duration of the dredging event whilst overflowing
m_t = total mass of dredged fines per cycle m_d = total mass of spilled fines during one dredging event m_h = total mass of dredged fines that enter the hopper
m_o = total mass of fine material that leaves the hopper during overflow m_op = total mass of fines that are released during overflow that end in dredging plume m_r = total mass of fines that remain within the hopper
m_t = density * fines * volume m_d = processor.sigma_d * m_t m_h = m_t - m_d
m_o = (overflow_duration / dredging_duration) * (1 - mover.f_sett) * (1 - mover.f_trap) * m_h m_op = mover.sigma_o * m_o
Spill dredging = m_d + m_op = (0.015 * 1800 * 0.1 * 1000) + 0 = 2700 Spill placement = m_r * sigma_p = (m_h - m_o) * sigma_p = (m_t - m_d - m_o) * sigma_p = ((1 - 0.015) * 1800 * 0.1 * 1000) * 0.05 = 8865
density = 1800 fines = 0.1 dredging_duration = 1000 overflow_duration = 0 sigma_d=0.015 sigma_o=0.1 sigma_p=0.05 f_sett=0.5 f_trap=0.01 """
# Test spill with dredging
# make the locations that have soil
"name": "Location A", # The name of the "from location" "geometry": location, # The coordinates of the "from location" "capacity": 1_000, # The capacity of the "from location" "level": 1_000} # The actual volume of the "from location"
"name": "Location B", # The name of the "to location" "geometry": location, # The coordinates of the "to location" "capacity": 1_000, # The capacity of the "to location" "level": 0} # The actual volume of the "to location"
# make the processor with source terms "geometry": location, # The coordinates of the "processore" "unloading_func": (lambda x: x / 1), # The unloading function 1 amount per second "loading_func": (lambda x: x / 1)} # The unloading function 1 amount per second
# Log fuel use of the processor in step 1
# Test spill with dredging and placement
# make the locations that have soil
"name": "Location A", # The name of the "from location" "geometry": location, # The coordinates of the "from location" "capacity": 1_000, # The capacity of the "from location" "level": 1_000} # The actual volume of the "from location"
"name": "Location B", # The name of the "to location" "geometry": location, # The coordinates of the "to location" "capacity": 1_000, # The capacity of the "to location" "level": 0} # The actual volume of the "to location"
# make the processor with source terms "geometry": location, # The coordinates of the "processore" "unloading_func": (lambda x: x / 1), # The unloading function 1 amount per second "loading_func": (lambda x: x / 1)} # The unloading function 1 amount per second
# make the mover "v": 1, # The speed of the mover "capacity": 1_000, # The capacity of the mover container "geometry": location} # The unloading function 1 amount per second
# Log fuel use of the processor in step 1
# Log fuel use of the processor in step 1
# Test spill with requirement
# make the locations that have soil
"name": "Location A", # The name of the "from location" "geometry": location, # The coordinates of the "from location" "capacity": 1_000, # The capacity of the "from location" "level": 1_000, # The actual volume of the "from location" "conditions": [condition_1]} # The spill condition of the "from location"
"name": "Location B", # The name of the "to location" "geometry": location, # The coordinates of the "to location" "capacity": 1_000, # The capacity of the "to location" "level": 0} # The actual volume of the "to location"
# make the processor with source terms "geometry": location, # The coordinates of the "processore" "unloading_func": (lambda x: x / 1), # The unloading function 1 amount per second "loading_func": (lambda x: x / 1)} # The unloading function 1 amount per second
# Log fuel use of the processor in step 1
|