tadd more geometrical parameters, resolve contact pressure - Granular.jl - Juli… | |
git clone git://src.adamsgaard.dk/Granular.jl | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 764bf1a96f0c1c5defe0afe0cc35c1db7f59eb07 | |
parent 1cc1237e7dd6b0a467dde033c5d324e4a47f75dd | |
Author: Anders Damsgaard <[email protected]> | |
Date: Mon, 24 Apr 2017 13:38:10 -0400 | |
add more geometrical parameters, resolve contact pressure | |
Diffstat: | |
M src/datatypes.jl | 8 ++++++-- | |
M src/icefloe.jl | 25 ++++++++++++++++++++----- | |
M src/interaction.jl | 8 +++++++- | |
M src/io.jl | 9 +++++++-- | |
4 files changed, 40 insertions(+), 10 deletions(-) | |
--- | |
diff --git a/src/datatypes.jl b/src/datatypes.jl | |
t@@ -12,7 +12,9 @@ type IceFloeCylindrical | |
thickness::float | |
contact_radius::float | |
areal_radius::float | |
- surface_area::float | |
+ circumreference::float | |
+ horizontal_surface_area::float | |
+ side_surface_area::float | |
volume::float | |
mass::float | |
moment_of_inertia::float | |
t@@ -54,7 +56,9 @@ type IceFloeArrays | |
thickness | |
contact_radius | |
areal_radius | |
- surface_area | |
+ circumreference | |
+ horizontal_surface_area | |
+ side_surface_area | |
volume | |
mass | |
moment_of_inertia | |
diff --git a/src/icefloe.jl b/src/icefloe.jl | |
t@@ -70,7 +70,9 @@ function addIceFloeCylindrical(simulation::Simulation, | |
thickness, | |
contact_radius, | |
areal_radius, | |
- 1.0, # surface_area | |
+ 1.0, # circumreference | |
+ 1.0, # horizontal_surface_area | |
+ 1.0, # side_surface_area | |
1.0, # volume | |
1.0, # mass | |
1.0, # moment_of_inertia | |
t@@ -98,7 +100,9 @@ function addIceFloeCylindrical(simulation::Simulation, | |
) | |
# Overwrite previous placeholder values | |
- icefloe.surface_area = iceFloeSurfaceArea(icefloe) | |
+ icefloe.circumreference = iceFloeCircumreference(icefloe) | |
+ icefloe.horizontal_surface_area = iceFloeHorizontalSurfaceArea(icefloe) | |
+ icefloe.side_surface_area = iceFloeSideSurfaceArea(icefloe) | |
icefloe.volume = iceFloeVolume(icefloe) | |
icefloe.mass = iceFloeMass(icefloe) | |
icefloe.moment_of_inertia = iceFloeMomentOfInertia(icefloe) | |
t@@ -107,12 +111,20 @@ function addIceFloeCylindrical(simulation::Simulation, | |
addIceFloe!(simulation, icefloe, verbose) | |
end | |
-function iceFloeSurfaceArea(icefloe::IceFloeCylindrical) | |
+function iceFloeCircumreference(icefloe::IceFloeCylindrical) | |
+ return pi*icefloe.areal_radius*2. | |
+end | |
+ | |
+function iceFloeHorizontalSurfaceArea(icefloe::IceFloeCylindrical) | |
return pi*icefloe.areal_radius^2. | |
end | |
+function iceFloeSideSurfaceArea(icefloe::IceFloeCylindrical) | |
+ return iceFloeCircumreference(icefloe)*icefloe.thickness | |
+end | |
+ | |
function iceFloeVolume(icefloe::IceFloeCylindrical) | |
- return iceFloeSurfaceArea(icefloe)*icefloe.thickness | |
+ return iceFloeHorizontalSurfaceArea(icefloe)*icefloe.thickness | |
end | |
function iceFloeMass(icefloe::IceFloeCylindrical) | |
t@@ -166,7 +178,10 @@ function convertIceFloeDataToArrays(simulation::Simulatio… | |
ifarr.thickness[i] = simulation.ice_floes[i].thickness | |
ifarr.contact_radius[i] = simulation.ice_floes[i].contact_radius | |
ifarr.areal_radius[i] = simulation.ice_floes[i].areal_radius | |
- ifarr.surface_area[i] = simulation.ice_floes[i].surface_area | |
+ ifarr.circumreference[i] = simulation.ice_floes[i].circumreference | |
+ ifarr.horizontal_surface_area[i] = | |
+ simulation.ice_floes[i].horizontal_surface_area | |
+ ifarr.side_surface_area[i] = simulation.ice_floes[i].side_surface_area | |
ifarr.volume[i] = simulation.ice_floes[i].volume | |
ifarr.mass[i] = simulation.ice_floes[i].mass | |
ifarr.moment_of_inertia[i] = simulation.ice_floes[i].moment_of_inertia | |
diff --git a/src/interaction.jl b/src/interaction.jl | |
t@@ -15,7 +15,9 @@ function interact!(simulation::Simulation) | |
end | |
""" | |
-Resolve an grain-to-grain interaction using a prescibed contact law. | |
+Resolve an grain-to-grain interaction using a prescibed contact law. This | |
+function adds the compressive force of the interaction to the ice floe | |
+`pressure` field of mean compressive stress on the ice floe sides. | |
""" | |
function interactIceFloes!(simulation::Simulation, | |
i::Integer, j::Integer, | |
t@@ -37,6 +39,10 @@ function interactIceFloes!(simulation::Simulation, | |
simulation.ice_floes[i].force += force; | |
simulation.ice_floes[j].force -= force; | |
+ simulation.ice_floes[i].pressure += | |
+ norm(force)/simulation.ice_floes[i].side_surface_area; | |
+ simulation.ice_floes[j].pressure += | |
+ norm(force)/simulation.ice_floes[j].side_surface_area; | |
end | |
""" | |
diff --git a/src/io.jl b/src/io.jl | |
t@@ -27,7 +27,12 @@ function writeVTK(simulation::Simulation; | |
"Diameter (contact) [m]") | |
WriteVTK.vtk_point_data(vtkfile, ifarr.areal_radius*2., | |
"Diameter (areal) [m]") | |
- WriteVTK.vtk_point_data(vtkfile, ifarr.surface_area, "Surface area [m^2]") | |
+ WriteVTK.vtk_point_data(vtkfile, ifarr.circumreference, | |
+ "Circumreference [m]") | |
+ WriteVTK.vtk_point_data(vtkfile, ifarr.horizontal_surface_area, | |
+ "Horizontal surface area [m^2]") | |
+ WriteVTK.vtk_point_data(vtkfile, ifarr.side_surface_area, | |
+ "Side surface area [m^2]") | |
WriteVTK.vtk_point_data(vtkfile, ifarr.volume, "Volume [m^3]") | |
WriteVTK.vtk_point_data(vtkfile, ifarr.mass, "Mass [kg]") | |
WriteVTK.vtk_point_data(vtkfile, ifarr.moment_of_inertia, | |
t@@ -62,7 +67,7 @@ function writeVTK(simulation::Simulation; | |
"Contact friction (dynamic) [-]") | |
WriteVTK.vtk_point_data(vtkfile, ifarr.pressure, | |
- "Pressure [Pa]") | |
+ "Contact pressure [Pa]") | |
outfiles = WriteVTK.vtk_save(vtkfile) | |
if verbose |