Skip to content

Commit 31ed09f

Browse files
authored
Merge branch 'main' into otter_next_main_2022_02_06
2 parents 1e9651e + 8f33e9b commit 31ed09f

28 files changed

+342
-139
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,23 @@ name: Run tests
22

33
env:
44
JULIA_NUM_THREADS: 4
5-
65
on:
76
pull_request:
87
branches:
98
- main
10-
119
jobs:
1210
test:
1311
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
1412
runs-on: ${{ matrix.os }}
1513
strategy:
16-
fail-fast: true
14+
fail-fast: false
1715
matrix:
1816
version:
19-
- '1.7'
17+
- '1.7.2'
2018
os:
2119
- ubuntu-latest
2220
- windows-latest
21+
- macos-latest
2322
arch:
2423
- x64
2524
steps:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
docs/build/
33
docs/site/
44
.vscode/
5+
*.json

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "Modia3D"
22
uuid = "07f2c1e0-90b0-56cf-bda7-b44b56e34eed"
33
authors = ["Andrea Neumayr <[email protected]>", "Martin Otter <[email protected]>", "Gerhard Hippmann <[email protected]>"]
4-
version = "0.9.0-dev"
4+
version = "0.9.0"
55

66
[deps]
77
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"

docs/src/index.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,26 @@ Download and install the free DLR SimVis Community Edition, e.g. with [https://v
4848

4949
## Release Notes
5050

51+
### Version 0.8.2
52+
53+
- Fix Cone contact detection
54+
- Add rattleback test (Modia3D/test/Collisions/Rattleback.jl)
55+
56+
### Version 0.8.1
57+
58+
- `collisionSmoothingRadius`: edges are smoothed with `collisionSmoothingRadius`
59+
- its default value is `0.001`, if it is set to `0.0` no smoothing takes place
60+
- the edges of Box, Cylinder, Cone, and Beam are smoothened with `collisionSmoothingRadius`
61+
- For using Herz' pressure `contactSphereRadius` is introduced for each shape
62+
- it can be user set
63+
- otherwise, it is calculated from shape geometry
64+
5165
### Version 0.8.0
5266

5367
- Require ModiaLang 0.10.0 (e.g. require DifferentialEquations 7)
54-
- Support animation export for FloatType = Measurements.XXX (animation is performed for the nominal value).
55-
- Remove PathPlanning struct und functions (and instead use the functionality from ModiaLang 0.9.1).
56-
- Reactivate test model test/old/Test_PathPlanning.jl
68+
- Support animation export for `FloatType = Measurements.XXX` (animation is performed for the nominal value).
69+
- Remove PathPlanning struct und functions (and instead use the functionality from ModiaLang 0.9.1).
70+
- Reactivate test model `test/old/Test_PathPlanning.jl`
5771
- Remove unused files: .codecov.yml, .travis.yml, appveyor.yml
5872
- Fix import/using of some tests.
5973

src/Composition/responseCalculation/elasticCollisionResponse.jl

Lines changed: 38 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -36,28 +36,24 @@ function resultantDampingCoefficient(cor, abs_vreln, vsmall, maximumContactDampi
3636
return d_res
3737
end
3838

39-
4039
function elasticContactPairCoefficients(obj1::Object3D, obj2::Object3D)
41-
if typeof(obj1.feature.shape) <: Modia3D.Shapes.Sphere && typeof(obj2.feature.shape) <: Modia3D.Shapes.Sphere
42-
r1 = obj1.feature.shape.diameter*0.5
43-
r2 = obj2.feature.shape.diameter*0.5
44-
mu_r_geo = r1*r2/(r1 + r2)
45-
n_geo = 1.5
46-
c_geo = 4/3*sqrt(mu_r_geo)
47-
elseif typeof(obj1.feature.shape) <: Modia3D.Shapes.Sphere && typeof(obj2.feature.shape) != Modia3D.Shapes.Sphere
48-
mu_r_geo = obj1.feature.shape.diameter*0.5
49-
n_geo = 1.5
50-
c_geo = 4/3*sqrt(mu_r_geo)
51-
elseif typeof(obj1.feature.shape) != Modia3D.Shapes.Sphere && typeof(obj2.feature.shape) <: Modia3D.Shapes.Sphere
52-
mu_r_geo = obj2.feature.shape.diameter*0.5
40+
solid1::Shapes.Solid = obj1.feature
41+
solid2::Shapes.Solid = obj2.feature
42+
43+
if !solid1.isFlat && solid2.isFlat
44+
mu_r_geo = solid1.contactSphereRadius
45+
elseif solid1.isFlat && !solid2.isFlat
46+
mu_r_geo = solid2.contactSphereRadius
47+
else # (solid1.isFlat && solid2.isFlat) || (!solid1.isFlat && !solid2.isFlat)
48+
r1 = solid1.contactSphereRadius
49+
r2 = solid2.contactSphereRadius
50+
mu_r_geo = r1*r2/(r1 + r2)
51+
end
52+
5353
n_geo = 1.5
5454
c_geo = 4/3*sqrt(mu_r_geo)
55-
else
56-
mu_r_geo = 1.0
57-
n_geo = 1.0
58-
c_geo = 1.0
59-
end
60-
return (c_geo, n_geo, mu_r_geo)
55+
56+
return (c_geo, n_geo, mu_r_geo)
6157
end
6258

6359

@@ -86,28 +82,28 @@ function contactStart(matPair::Shapes.ElasticContactPairMaterial,
8682
nu1 = mat1.PoissonsRatio
8783
nu2 = mat2.PoissonsRatio
8884
if E1 <= 0.0 || E2 <= 0.0 || nu1 <= 0.0 || nu1 >= 1.0 ||
89-
nu2 <= 0.0 || nu2 >= 1.0 || elasticContactReductionFactor <= 0.0
90-
responseMaterial = nothing
85+
nu2 <= 0.0 || nu2 >= 1.0 || elasticContactReductionFactor <= 0.0
86+
responseMaterial = nothing
9187
else
92-
@assert(E1 > 0.0)
93-
@assert(E2 > 0.0)
94-
@assert(nu1 > 0.0 && nu1 < 1.0)
95-
@assert(nu2 > 0.0 && nu2 < 1.0)
96-
@assert(elasticContactReductionFactor > 0.0)
97-
c1 = E1/(1 - nu1^2)
98-
c2 = E2/(1 - nu2^2)
99-
c_res = elasticContactReductionFactor*c1*c2/(c1 + c2)
100-
101-
# Compute damping constant
102-
delta_dot_start = normalRelativeVelocityAtContact(obj1, obj2, rContact, contactNormal)
103-
d_res = Modia3D.resultantDampingCoefficient(matPair.coefficientOfRestitution, abs(delta_dot_start), matPair.vsmall, maximumContactDamping)
104-
105-
# Determine other coefficients
106-
(c_geo, n_geo, mu_r_geo) = elasticContactPairCoefficients(obj1,obj2)
107-
responseMaterial = ElasticContactPairResponseMaterial(c_res, c_geo, n_geo, d_res,
108-
matPair.slidingFrictionCoefficient,
109-
matPair.rotationalResistanceCoefficient, mu_r_geo,
110-
matPair.vsmall, matPair.wsmall)
88+
@assert(E1 > 0.0)
89+
@assert(E2 > 0.0)
90+
@assert(nu1 > 0.0 && nu1 < 1.0)
91+
@assert(nu2 > 0.0 && nu2 < 1.0)
92+
@assert(elasticContactReductionFactor > 0.0)
93+
c1 = E1/(1 - nu1^2)
94+
c2 = E2/(1 - nu2^2)
95+
c_res = elasticContactReductionFactor*c1*c2/(c1 + c2)
96+
97+
# Compute damping constant
98+
delta_dot_start = normalRelativeVelocityAtContact(obj1, obj2, rContact, contactNormal)
99+
d_res = Modia3D.resultantDampingCoefficient(matPair.coefficientOfRestitution, abs(delta_dot_start), matPair.vsmall, maximumContactDamping)
100+
101+
# Determine other coefficients
102+
(c_geo, n_geo, mu_r_geo) = elasticContactPairCoefficients(obj1,obj2)
103+
responseMaterial = ElasticContactPairResponseMaterial(c_res, c_geo, n_geo, d_res,
104+
matPair.slidingFrictionCoefficient,
105+
matPair.rotationalResistanceCoefficient, mu_r_geo,
106+
matPair.vsmall, matPair.wsmall)
111107
end
112108
return responseMaterial
113109
end
@@ -163,11 +159,8 @@ function responseCalculation(material::ElasticContactPairResponseMaterial, obj1:
163159
e_t_reg = v_t/Modia3D.regularize(norm(v_t),vsmall)
164160
delta = -s
165161

166-
if c_geo != 1.0 && n_geo != 1.0
167-
delta_comp = delta * sqrt(abs(delta))
168-
else
169-
delta_comp = delta
170-
end
162+
delta_comp = delta * sqrt(abs(delta))
163+
171164
#fn = -max(F(0.0), c_res * c_geo * delta_comp * (1 - d_res*delta_dot) )
172165
fn = -c_res * c_geo * delta_comp * (1 - d_res*delta_dot)
173166
ft = -mu_k*fn*e_t_reg

src/Modia3D.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
module Modia3D
55

66
const path = dirname(dirname(@__FILE__)) # Absolute path of package directory
7-
const Version = "0.9.0-dev"
7+
const Version = "0.9.0"
88
const Date = "2022-02-20"
99

1010
println("\nImporting Modia3D Version $Version ($Date)")

0 commit comments

Comments
 (0)