QSDsan: Quantitative Sustainable Design for sanitation and resource recovery systems

This module is developed by:

Yalin Li <>

This module is under the University of Illinois/NCSA Open Source License. Please refer to for license details.

class qsdsan.sanunits._trucking.Trucking(ID='', ins: Sequence[Stream] | None = None, outs: Sequence[Stream] | None = (), thermo=None, init_with='WasteStream', load_type='mass', load=1.0, load_unit='kg', distance=1.0, distance_unit='km', interval=1.0, interval_unit='hr', fee=0.0, fee_unit='USD', if_material_loss=True, loss_ratio=0.02, price_ratio=1.0)#

For transportation of materials with considerations on material loss based on Trimmer et al.

To enable life cycle assessment, the following impact items should be pre-constructed: Trucking.

  • load_type (str) – Either ‘mass’ or ‘volume’.

  • load (float) – Transportation load per trip.

  • load_unit (str) – Unit of the load.

  • distance (float) – Transportation distance per trip.

  • distance_unit (float) – Unit of the distance.

  • interval (float) – Time interval between trips.

  • fee (float) – Transportation fee per trip.

  • fee_unit (str) – Currency of the fee.

  • if_material_loss (bool) – If material loss occurs during transportation.

  • loss_ratio (float or dict) – Fractions of material losses due to transportation.

  • price_ratio (float.) – Calculated transportation cost will be multiplied by this number to consider the effect in cost difference from different locations.


bwaise systems


[1] Trimmer et al., Navigating Multidimensional Social–Ecological System Trade-Offs across Sanitation Alternatives in an Urban Informal Settlement. Environ. Sci. Technol. 2020, 54 (19), 12641–12653.

F_BM: dict[str, float]#

All bare-module factors for each purchase cost. Defaults to values in the class attribute _F_BM_default.

F_D: dict[str, float]#

All design factors for each purchase cost item in baseline_purchase_costs.

F_M: dict[str, float]#

All material factors for each purchase cost item in baseline_purchase_costs.

F_P: dict[str, float]#

All pressure factors for each purchase cost item in baseline_purchase_costs.

baseline_purchase_costs: dict[str, float]#

All baseline purchase costs without accounting for design, pressure, and material factors.

design_results: dict[str, object]#

All design requirements excluding utility requirements and detailed auxiliary unit requirements.

equipment_lifetime: int | dict[str, int]#

Lifetime of equipment. Defaults to values in the class attribute _default_equipment_lifetime. Use an integer to specify the lifetime for all items in the unit purchase costs. Use a dictionary to specify the lifetime of each purchase cost item.

property fee#

[float] Transportation fee per trip.

heat_utilities: tuple[HeatUtility, ...]#

All heat utilities associated to unit. Cooling and heating requirements are stored here (including auxiliary requirements).

installed_costs: dict[str, float]#

All installed costs accounting for bare module, design, pressure, and material factors. Items here are automatically updated at the end of unit simulation.

line: str = 'Trucking'#

class-attribute Name denoting the type of Unit class. Defaults to the class name of the first child class

property loss_ratio#

[float] or [dict] Fractions of material losses due to transportation. If a single number is provided, then it is assumed that losses of all Components in the WasteStream are the same.


Pre-set state variable values in WasteStream (e.g., COD set through _COD rather than calculated) will be retained if the loss ratio is a single number (treated like the loss stream is split from the original stream), but will be overwritten when the ratio is a dict.

parallel: dict[str, int]#

Name-number pairs of baseline purchase costs and auxiliary unit operations in parallel. Use ‘self’ to refer to the main unit. Capital and heat and power utilities in parallel will become proportional to this value.

power_utility: PowerUtility#

Electric utility associated to unit (including auxiliary requirements).

prioritize: bool#

Whether to prioritize unit operation specification within recycle loop (if any).

purchase_costs: dict[str, float]#

Itemized purchase costs (including auxiliary units) accounting for design, pressure, and material factors (i.e., F_D, F_P, F_M). Items here are automatically updated at the end of unit simulation.

responses: set[bst.GenericResponse]#

Unit design decisions that must be solved to satisfy specifications. While adding responses is optional, simulations benefit from responses by being able to predict better guesses.

run_after_specifications: bool#

Whether to run mass and energy balance after calling specification functions