R/unpavedRoad.R

Defines functions unpavedRoad

Documented in unpavedRoad

##' unpaved road dust generation
##' 
##' A function to estimate dust generated by unpaved road in quarry site.
##' 
##' @param quarryInput data frame containing column names: quarryProduction - quarry production tonne per hour,
##' blastingFreq - blasting frequency per month, areaBlasted - area blasted (km. sq), blasthole - average of depth of blast hole (m), drillhole - drilling hole per month,
##' moisture - percentage of moisture content, silt - percentage of silt content, unpavedDist - unpaved road distant (KM), pavedDist - unpaved road distance (KM), 
##' unpavedVehicle - number of vehicle count travel using unpaved road per month, pavedVehicle - number of vehicle count travel using unpaved road per month, 
##' nPrimary - number of primary crusher, nSecondary - number of secondary crusher, nTertiary - number of tertiary crusher, nScreen - number of screen.
##'
##' @param particleSize particle size of dust deposited rate. The default value is "tsp" for total suspended solid 
##' and other available particle size is "pm10" for particulate matter <10 micron. 
##' 
##' @param vehicleTravelled number of vehicle used the road per month, use the default to read unpavedVehicle value inside quarryInput dataframe
##' @param roadDistance total unpaved road in the quarry (KM), use the default to read pavedDist value inside quarryInput dataframe
##' @param vehicleWeight average vehicle weight (tonne). The defaults value is 10.
##' @param moistureContent Percentage of soil moisture content, use the default to read moisture value inside quarryInput dataframe
##' @param siltContent Percentage of soil silt content, use the default to read silt value inside quarryInput dataframe 
##'
##' @export
##' 
##' @author Zul Fadhli & Dr. Izhar Abadi
##' 
##' @examples  
##' #demo
##' unpavedRoad <- function(quarryInput, particleSize = "tsp", vehicleWeight = 10)

unpavedRoad <- function(quarryInput, particleSize = "tsp",
                   vehicleTravelled = quarryInput$unpavedVehicle, roadDistance = quarryInput$unpavedDist,
                   siltContent = quarryInput$silt, moistureContent = quarryInput$moisture, vehicleWeight = 10)

{
  quarryInput <- quarryInput

  if(particleSize == "tsp") {
    kpave = 2.82
  }else if (particleSize == "pm10"){
    kpave = 0.73
  }

  if(particleSize == "tsp") {
    a = 0.8
  }else if (particleSize == "pm10"){
    a = 0.8
  }

  if(particleSize == "tsp") {
    b = 0.5
  }else if (particleSize == "pm10"){
    b = 0.4
  }

  if(particleSize == "tsp") {
    c = 0.4
  }else if (particleSize == "pm10"){
    c = 0.3
  }

  #w is average of vehicle weight travelled on this road

  vehicleWeight <- 10

  ef <- kpave*(siltContent/12)^a*(vehicleWeight/3)^b/(moistureContent/0.2)^c

  ef*vehicleTravelled*12*(roadDistance/roadDistance)/1000/1000
}
zf-ibrahim/myqdmi documentation built on June 22, 2022, 6:58 a.m.