Coder Social home page Coder Social logo

davidatlarge / sinking_velocity Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 250 KB

Calculates sinking velocity of particles in water.

R 100.00%
r functional-programming function returns-sinking-velocity dietrich stokes stokesian-hydrodynamics density sinking-particles

sinking_velocity's Introduction

Dietrich sinking velocity

David Kaiser 2018-11-19

Description

Calculates the sinking velocity of a particle in a fluid, in meters per second. By default uses formulas by Dietrich (1982). The script was originally written to calculate the theoretical sinking velocity of microplastic particles with diameters < 5 mm but > 200 µm. This calculation was used e.g. by Kowalski et al. (2016), because the commonly used Stokes formula overestimates sinking velocity for particles with diameters > 200 µm. The formula by Dietrich considers effects of fluid denisty as well as particle density, size, shape and roundness. Alternatively, setting the argument method = "stokes" returns sinking velocity according to Stokes' Law (see e.g. Glokzin et al. 2010). This only considers water denisty and particle size and density, and thus considers all particles perfect spheres. If the particle diameter is > 200 µm, a warning will be printed but the value will be returned nontheless. Additionally, setting method = "zhiyao" returns sinking velocity calculated after Zhiyao et al. (2008). This method does not require input of shape related variables, but Zhiyao et al. claim their formula is applicable to a wide range of particle shapes and sizes (with Reynolds numbers < 2 x 105). Using method = "ahrens" calculates sinking velocity according to a formula by Ahrens (2000), which is a generalization of formulas by Hallmeier (1981). Method = "komar" returns sinking velocity for ellipsoidal particles according to Komar (1980). Methods "dietrich" and "komar" require the input of a shape factor, with Corey shape factor preferred for "dietrich" and Janke's E factor for "komar" (Dietrich 1982, Komar 1980).

For non-spherical particles, the size/diameter can be expressed as equivalent spherical diameter (ESD) (e.g. Kumar et al. 2010).

The function only works when the density of the particle is higher than that of the fluid, i.e. when there is downward sinking. Otherwise the result is NaN and a warning will be printed.

The function requires the packages marelac and seacarb to be installed. Required functions are called directly without loading the packages. Water density is calculated from salinity and temperature, using the older UNESCO calculation because it allows the use of practical salinity (instead of the less commonly recorded absolute salinity). Pressure for density calculation is calculated from depth and latitude. Latitude is also used to calculate gravity.

Arguments

  • salinity -- practical salinity (unitless)
  • temperature -- in °C
  • depth -- in m
  • latitude -- in °N (negative for southern hemisphere)
  • particle.density -- in kg m-3
  • particle.diameter -- in m
  • powers.p = 6 -- Powers roundness; defaults to 6 for perfectly round projected areas, including those of spheres
  • shape.factor = 1 -- Corey Shape Factor or Janke E; defaults to 1 for spheres
  • method = c("dietrich", "stokes", "zhiyao", "ahrens", "komar") -- method to calculate the sinking velocity, defaults to "dietrich"

Value

A numeric value of the sinking velocity in m s-1

Examples

Use Dietrich formula to calculate the sinking velocity [m s-1] for a polystyrene sphere (density is 1050 kg m-3) with a diameter of 1.5 mm, in temperate ocean surface water.

sinking.velocity.m.sec(salinity = 36, 
                        temperature = 20, 
                        depth = 0.2, 
                        latitude = 40, 
                        particle.density = 1050, 
                        particle.diameter = 0.0015)
## [1] 0.01192481

Use Zhiyao et al. formula for the same case.

sinking.velocity.m.sec(salinity = 36, 
                        temperature = 20, 
                        depth = 0.2, 
                        latitude = 40, 
                        particle.density = 1050, 
                        particle.diameter = 0.0015,
                       method = "zhiyao")
## [1] 0.01104578

Use Ahrens formula to calculate the sinking velocity [m s-1] of a quartz grain (density is 2650 kg m-3) with a diameter of 0.4 mm, in deep temperate ocean water.

sinking.velocity.m.sec(salinity = 36, 
                        temperature = 20, 
                        depth = 2000, 
                        latitude = 40, 
                        particle.density = 2650, 
                        particle.diameter = 0.0004,
                        method = "ahrens")
## [1] 0.05230099

Use Stokes formula to calculate the sinking velocity [m s-1] for a polystyrene sphere (density is 1050 kg m-3) with a diameter of 1.5 mm, in temperate ocean surface water. Prints a warning but also returns the value.

sinking.velocity.m.sec(salinity = 36, 
                        temperature = 20, 
                        depth = 0.2, 
                        latitude = 40, 
                        particle.density = 1050, 
                        particle.diameter = 0.0015,
                        method = "stokes")
## Warning: Particle diameter > 200 µm! 
##  Stokes' Law will overestimate sinking velocity! 
##  Use another method!

## [1] 0.02761736

Sinking velocity cannot be calculated for particles with lower density than the fluid, e.g. polyethylene in temperate ocean surface water.

sinking.velocity.m.sec(salinity = 36, 
                        temperature = 20, 
                        depth = 0.2, 
                        latitude = 40, 
                        particle.density = 955, 
                        particle.diameter = 0.0015,
                        method = "stokes")
## Warning: Particle diameter > 200 µm! 
##  Stokes' Law will overestimate sinking velocity! 
##  Use another method!

## Warning: Particle density (955) < water density (1026)! Particle will not
## sink! Returning NaN.

## [1] NaN

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.