Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ElmerCSC
GitHub Repository: ElmerCSC/elmerfem
Path: blob/devel/elmerice/Tests/FSSA_perlin2d/perlin.lua
3206 views
1
-- constants
2
-- #########
3
betamin=0.01
4
betamax=1
5
dbeta=10.0
6
delta=2.0
7
sigma=delta/4.59511985013458992685
8
alpha = 1.0
9
beta = 3.0
10
LX=8000.0
11
LY=2500.0
12
13
-- the vertical offset to the base topography
14
-- ##########################################
15
function parbl(Y)
16
aux= LY - math.sqrt(LY*LY - 0.25*Y*Y)
17
return aux
18
end
19
20
-- this is our accumulation rate
21
-- #############################
22
function accum(X)
23
aux=alpha-beta*X/LX
24
if (aux > 0.0) then
25
return aux
26
else
27
return 0.0
28
end
29
end
30
31
-- this is our accumulation rate in 3D
32
-- ###################################
33
function accum3D(X,Y)
34
fade=1.0 - ((Y-2500.0)/LY)^2.0
35
return accum(X)*fade
36
end
37
38
-- linear sliding coefficient
39
-- ##########################
40
function lslidingcoeff(X,H,D)
41
height = H-D
42
fact = 1.0/(1.0 + math.exp((height - hmin)/(0.5*sigma)))
43
return (betamax - betamin)/(1.0 + math.exp((X - 0.5*LX)/sigma)) + betamin + fact*betamax
44
end
45
46
47
-- sliding with fixed target velocity ub agnostic of driving stress
48
-- ################################################################
49
function slidingcoeffv(X,H,D)
50
return lslidingcoeff(X,H,D)/(ub^(mw - 1.0))
51
end
52
53
-- sliding that tries to match the linear sliding speed for given driving stress (2nd argument)
54
-- ############################################################################################
55
function slidingcoeff(X,Tau,H,D)
56
ub=Tau/lslidingcoeff(X,H,D)
57
return lslidingcoeff(X,H,D)/(ub^(mw - 1.0))
58
end
59
60
61
62