Granular.jl

Julia package for granular dynamics simulation
git clone git://src.adamsgaard.dk/Granular.jl
Log | Files | Refs | README | LICENSE

commit b43f3bbd228f43e90ce1c74ad8ae94f08369fbcb
parent 36783cd1acd10f5a76553357199cb8e65ad53b4a
Author: Anders Damsgaard <andersd@riseup.net>
Date:   Thu,  8 Feb 2018 10:14:36 -0500

Clarify expression for ocean and atmosphere drag

Diffstat:
Msrc/atmosphere.jl | 14++++++--------
Msrc/ocean.jl | 13++++++-------
2 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/src/atmosphere.jl b/src/atmosphere.jl @@ -211,13 +211,11 @@ grain. """ function applyAtmosphereDragToGrain!(grain::GrainCylindrical, u::Float64, v::Float64) - rho_a = 1.2754 # atmosphere density - length = grain.areal_radius*2. - width = grain.areal_radius*2. + ρ_a = 1.2754 # atmosphere density - drag_force = rho_a * - (.5*grain.ocean_drag_coeff_vert*width*.1*grain.thickness + - grain.atmosphere_drag_coeff_horiz*length*width) * + drag_force = ρ_a * π * + (2.0*grain.ocean_drag_coeff_vert*grain.areal_radius*.1*grain.thickness + + grain.atmosphere_drag_coeff_horiz*grain.areal_radius^2.0) * ([u, v] - grain.lin_vel)*norm([u, v] - grain.lin_vel) grain.force += drag_force @@ -233,10 +231,10 @@ and Boucher, 1999. """ function applyAtmosphereVorticityToGrain!(grain::GrainCylindrical, atmosphere_curl::Float64) - rho_a = 1.2754 # atmosphere density + ρ_a = 1.2754 # atmosphere density grain.torque += - pi * grain.areal_radius^4. * rho_a * + π * grain.areal_radius^4. * ρ_a * (grain.areal_radius / 5. * grain.atmosphere_drag_coeff_horiz + .1 * grain.thickness * grain.atmosphere_drag_coeff_vert) * abs(.5 * atmosphere_curl - grain.ang_vel) * diff --git a/src/ocean.jl b/src/ocean.jl @@ -328,13 +328,12 @@ floe. function applyOceanDragToGrain!(grain::GrainCylindrical, u::Float64, v::Float64) freeboard = .1*grain.thickness # height above water - rho_o = 1000. # ocean density + ρ_o = 1000. # ocean density draft = grain.thickness - freeboard # height of submerged thickness - length = grain.areal_radius*2. - width = grain.areal_radius*2. - drag_force = rho_o * (.5*grain.ocean_drag_coeff_vert*width*draft + - grain.ocean_drag_coeff_horiz*length*width) * + drag_force = ρ_o * π * + (2.0*grain.ocean_drag_coeff_vert*grain.areal_radius*draft + + grain.ocean_drag_coeff_horiz*grain.areal_radius^2.0) * ([u, v] - grain.lin_vel)*norm([u, v] - grain.lin_vel) grain.force += drag_force @@ -351,11 +350,11 @@ and Boucher, 1999. function applyOceanVorticityToGrain!(grain::GrainCylindrical, ocean_curl::Float64) freeboard = .1*grain.thickness # height above water - rho_o = 1000. # ocean density + ρ_o = 1000. # ocean density draft = grain.thickness - freeboard # height of submerged thickness grain.torque += - pi * grain.areal_radius^4. * rho_o * + π * grain.areal_radius^4. * ρ_o * (grain.areal_radius/5. * grain.ocean_drag_coeff_horiz + draft * grain.ocean_drag_coeff_vert) * abs(.5 * ocean_curl - grain.ang_vel) * (.5 * ocean_curl - grain.ang_vel)