Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F67312042
test_westergaard.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Jun 21, 17:43
Size
2 KB
Mime Type
text/x-python
Expires
Sun, Jun 23, 17:43 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
18365790
Attached To
rTAMAAS tamaas
test_westergaard.py
View Options
#!/usr/bin/env python
# coding: utf-8
# -----------------------------------------------------------------------------
# @author Lucas Frérot <lucas.frerot@epfl.ch>
#
# @section LICENSE
#
# Copyright (©) 2016 EPFL (Ecole Polytechnique Fédérale de
# Lausanne) Laboratory (LSMS - Laboratoire de Simulation en Mécanique des
# Solides)
#
# Tamaas is free software: you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option) any
# later version.
#
# Tamaas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
# details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Tamaas. If not, see <http://www.gnu.org/licenses/>.
# -----------------------------------------------------------------------------
import
sys
import
numpy
as
np
import
tamaas
as
tm
def
constructSinProfile
(
size
,
mode
,
amplitude
):
x
=
np
.
linspace
(
0
,
1
,
size
)
y
=
np
.
linspace
(
0
,
1
,
size
)
x
,
y
=
np
.
meshgrid
(
x
,
y
)
surface
=
amplitude
*
np
.
sin
(
2
*
np
.
pi
*
x
*
mode
)
return
surface
.
copy
()
def
main
():
grid_size
=
256
mode
=
1
delta
=
0.1
effective_modulus
=
1.
p_star
=
np
.
pi
*
effective_modulus
*
delta
*
mode
# Full contact load
load
=
0.4
*
p_star
surface
=
constructSinProfile
(
grid_size
,
mode
,
delta
)
bem
=
tm
.
BemPolonski
(
surface
)
bem
.
setEffectiveModulus
(
effective_modulus
)
bem
.
computeEquilibrium
(
1e-12
,
load
)
tractions
=
bem
.
getTractions
()
displacements
=
bem
.
getDisplacements
()
# Testing contact area against Westergaard solution
contact_area
=
tm
.
SurfaceStatistics
.
computeContactArea
(
tractions
)
westergaard_contact_size
=
2.
/
(
mode
*
np
.
pi
)
*
np
.
arcsin
(
np
.
sqrt
(
load
/
p_star
))
area_error
=
np
.
abs
(
contact_area
-
mode
*
westergaard_contact_size
)
/
(
mode
*
westergaard_contact_size
)
print
"Area error: {}"
.
format
(
area_error
)
# Testing displacements at full contact
load
=
1.1
*
p_star
bem
.
computeEquilibrium
(
1e-12
,
load
)
contact_area
=
tm
.
SurfaceStatistics
.
computeContactArea
(
tractions
)
print
"Area at load > full contact : {}"
.
format
(
contact_area
)
# Testing pressure distribution at full contact
westergaard_pressure
=
constructSinProfile
(
grid_size
,
mode
,
p_star
)
tractions_amplitude
=
tractions
.
max
()
-
tractions
.
mean
()
return
0
if
__name__
==
"__main__"
:
sys
.
exit
(
main
())
Event Timeline
Log In to Comment