Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
s.zitz
JuThinFilm
Commits
aa7affcb
Commit
aa7affcb
authored
Sep 25, 2020
by
s.zitz
Browse files
Minor changes, maybe look at it during the weekend
parent
3902aa49
Pipeline
#23344
failed with stage
in 114 minutes and 34 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
scripts/sliding_analysis.jl
View file @
aa7affcb
...
...
@@ -16,16 +16,13 @@ using DataFrames, CSV, CodecZlib, Mmap, Images
# Define some constants
lx
=
512
ly
=
256
maxtime
=
5
0000
maxtime
=
20
0000
θₑ
=
1
/
9
# Contact angle on the substrate, expect on the patch
δ₀
=
4
.0
# Slip length, larger better for geometry
δ₀
=
2
.0
# Slip length, larger better for geometry
T
=
Float64
# The center of the lattice
center
=
(
lx÷2
,
ly÷2
)
# Things to be measured
measureframe
=
DataFrame
()
dropletframe
=
DataFrame
()
contactlineframe
=
DataFrame
()
# Geometric parameters for the patterns
boxside
=
62
triangleside
=
94.3
...
...
@@ -41,6 +38,9 @@ lat = JuThinFilm.lattice{T}()
for
R₀
in
[
55.8
69.75
83.7
]
# Loop over the four different patch shapes
for
shape
in
[
"box"
"triangle"
"ellipse"
"circle"
]
measureframe
=
DataFrame
()
contactlineframe
=
DataFrame
()
dropletframe
=
DataFrame
()
# Loop over five different contact angle contrasts, last one is less wettable than the surrounding substrate
for
δᵪ
in
[
1
/
36
1
/
18
1
/
12
1
/
9
-
1
/
18
]
vol
=
π
/
3
*
R₀
^
3
*
(
2
+
cospi
(
θₑ
)
*
(
1
-
cospi
(
θₑ
))
^
2
)
...
...
@@ -50,11 +50,10 @@ for R₀ in [55.8 69.75 83.7]
diffsurf
=
[]
energy
=
[]
contactline
=
[]
positions
=
[
0
,
0
,
0
]
positions
=
[]
MaxVel
=
[]
θₙ
=
fill
(
θₑ
,
lx
,
ly
)
angle_switch
=
true
# And the defect with the correct shape and contrast
# Forces needed for the simulation
Fpressure
=
default_force
(
T
,
lx
,
ly
)
...
...
@@ -68,6 +67,7 @@ for R₀ in [55.8 69.75 83.7]
copy!
(
dists
.
ftemp
,
dists
.
feq
)
# Start of the main time loop
for
t
in
1
:
parameters
.
mt
# isnan.(mom.height) && break
# Only change the substrate after the droplet has started sliding!
if
findmax
(
mom
.
height
,
dims
=
1
)[
2
][
:
1
][
1
][
1
]
>
lx÷2
+
150
&&
t
>
1000
&&
angle_switch
if
shape
==
"box"
...
...
@@ -83,13 +83,13 @@ for R₀ in [55.8 69.75 83.7]
angle_switch
=
false
end
# Performe the measurements
if
t
%
1
0
==
0
if
t
%
50
0
==
0
# Measurements of surface area and three phase contact line lenght
JuThinFilm
.
measuresurfaceandenergy!
(
diffsurf
,
energy
,
mom
,
θₙ
)
JuThinFilm
.
measurecontactlinelengthandposition!
(
contactline
,
positions
,
t
,
mom
)
JuThinFilm
.
measuremaxvelocity
(
MaxVel
,
mom
)
JuThinFilm
.
measuremaxvelocity
(
MaxVel
,
mom
)
end
if
t
%
5
000
==
0
if
t
%
10
000
==
0
# IO for progression
mass
=
round
(
sum
(
mom
.
height
),
digits
=
3
)
println
(
"time step
$
t and mass
$
mass"
)
...
...
@@ -121,20 +121,22 @@ for R₀ in [55.8 69.75 83.7]
dropletframe
[
"vely_shape_
$(shape)
_contrast_
$(angle_diff)
_vol_
$
(R₀)"
]
=
vec
(
mom
.
velocity
.
y
)
dropletframe
[
"pres_shape_
$(shape)
_contrast_
$(angle_diff)
_vol_
$
(R₀)"
]
=
vec
(
mom
.
pressure
)
end
# Save the collected data for any given shape to the disk
savepath
=
"data/sims/dynamic_different_shape_angle/"
results_measures
=
"measurements_shape_
$(shape)
_vol_
$
(R₀)_set1.csv"
results_drop
=
"final_hdvars_shape_
$(shape)
_vol_
$
(R₀)_set1.csv"
results_TPC
=
"contactline_shape_
$(shape)
_vol_
$
(R₀))set1.csv"
CSV
.
write
(
savepath
*
results_measures
,
measureframe
)
CSV
.
write
(
savepath
*
results_drop
,
dropletframe
)
CSV
.
write
(
savepath
*
results_TPC
,
contactlineframe
)
zip1
=
`gzip data/sims/dynamic_different_shape_angle/measurements_shape_$(shape)_vol_$(R₀)_set1.csv`
zip2
=
`gzip data/sims/dynamic_different_shape_angle/final_hdvars_shape_$(shape)_vol_$(R₀)_set1.csv`
zip3
=
`gzip data/sims/dynamic_different_shape_angle/contactline_shape_$(shape)_vol_$(R₀)_set1.csv`
run
(
zip1
)
run
(
zip2
)
run
(
zip3
)
println
(
"Simulations done results are saved in
$
savepath"
)
end
end
savepath
=
"data/sims/dynamic_different_shape_angle/"
results_measures
=
"measurements_0.csv"
results_drop
=
"final_hdvars_0.csv"
results_TPC
=
"contactline_0.csv"
CSV
.
write
(
savepath
*
results_measures
,
measureframe
)
CSV
.
write
(
savepath
*
results_drop
,
dropletframe
)
CSV
.
write
(
savepath
*
results_TPC
,
contactlineframe
)
zip1
=
`gzip data/sims/dynamic_different_shape_angle/measurements_0.csv`
zip2
=
`gzip data/sims/dynamic_different_shape_angle/final_hdvars_0.csv`
zip3
=
`gzip data/sims/dynamic_different_shape_angle/contactline_0.csv`
run
(
zip1
)
run
(
zip2
)
run
(
zip3
)
println
(
"Simulations done results are saved in
$
savepath"
)
# TODO: Add a send email flag, to be notified if the simulation has finished
\ No newline at end of file
src/initialstates.jl
View file @
aa7affcb
...
...
@@ -250,7 +250,7 @@ function boxpattern(lx, ly, stats::JuThinFilm.pressurestats; center=(lx÷2, ly÷
vertex₃
=
[
xcoords
[
3
],
ycoords
[
3
]]
vertex₄
=
[
xcoords
[
4
],
ycoords
[
4
]]
P
=
VPolygon
([
vertex₁
,
vertex₂
,
vertex₃
,
vertex₄
])
for
i
in
1
:
l
x
,
j
in
1
:
l
y
for
i
in
1
:
l
y
,
j
in
1
:
l
x
if
[
Float64
(
i
),
Float64
(
j
)]
∈
P
θₙ
[
j
,
i
]
=
stats
.
θ
+
δₐ
else
...
...
@@ -307,7 +307,7 @@ function ellipsepattern(lx, ly, stats::JuThinFilm.pressurestats; center=(lx÷2,
shape₁
=
a
^
(
2
)
shape₂
=
b
^
(
2
)
P
=
Ellipsoid
(
mid
,
[
shape₁
0.0
;
0.0
shape₂
])
for
i
=
1
:
l
x
,
j
=
1
:
l
y
for
i
=
1
:
l
y
,
j
=
1
:
l
x
if
[
Float64
(
i
),
Float64
(
j
)]
∈
P
θₙ
[
j
,
i
]
=
stats
.
θ
+
δₐ
else
...
...
@@ -368,7 +368,7 @@ function trianglepattern(lx, ly, stats::JuThinFilm.pressurestats; center=(lx÷2,
vertex₂
=
[
xcoords
[
2
],
ycoords
[
2
]]
vertex₃
=
[
xcoords
[
3
],
ycoords
[
3
]]
P
=
VPolygon
([
vertex₁
,
vertex₂
,
vertex₃
])
for
i
in
1
:
l
x
,
j
in
1
:
l
y
for
i
in
1
:
l
y
,
j
in
1
:
l
x
if
[
Float64
(
i
),
Float64
(
j
)]
∈
P
θₙ
[
j
,
i
]
=
stats
.
θ
+
δₐ
else
...
...
src/measurements.jl
View file @
aa7affcb
...
...
@@ -192,6 +192,7 @@ end
function
measurecontactlinelengthandposition!
(
perimeter
,
position
,
t
,
mom
)
len
,
wid
=
size
(
mom
.
height
)
ll
=
[]
height
=
copy
(
mom
.
height
)
height
[
height
.<=
0.06
]
.=
0
sol
=
0
...
...
@@ -199,11 +200,14 @@ function measurecontactlinelengthandposition!(perimeter, position, t, mom)
for
j
in
2
:
wid
-
1
# Basically if one or more of my neighbors is dry I have to be contactline!
if
(
height
[
i
+
1
,
j
]
==
0
&&
height
[
i
,
j
]
>
0
)
||
(
height
[
i
-
1
,
j
]
==
0
&&
height
[
i
,
j
]
>
0
)
||
(
height
[
i
,
j
+
1
]
==
0
&&
height
[
i
,
j
]
>
0
)
||
(
height
[
i
,
j
-
1
]
==
0
&&
height
[
i
,
j
]
>
0
)
append!
(
position
,
(
i
,
j
,
t
))
push!
(
ll
,
(
i
,
j
,
t
))
sol
+=
1
else
push!
(
ll
,
missing
)
end
end
end
push!
(
position
,
ll
)
push!
(
perimeter
,
sol
)
end
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment