Skip to content
GitLab
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
0cbdb650
Commit
0cbdb650
authored
Sep 18, 2020
by
s.zitz
Browse files
Fixed the wrong energy measurement
parent
ef5729f5
Pipeline
#23086
passed with stage
in 51 minutes and 44 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Sidebyside
src/measurements.jl
View file @
0cbdb650
...
@@ 3,7 +3,17 @@
...
@@ 3,7 +3,17 @@
Measurement of the base wetted area of a droplet.
Measurement of the base wetted area of a droplet.
# Theory
The area of the fluidsolid interface is easily computed by summing up the fluid nodes which are higher than the precursor film.
`` S =
\\
int_{h>h_p}
\\
Theta(
\\
mathbf{x},t)
\\
text{d}
\\
mathbf{x}. ``
Where ``
\\
Theta(
\\
mathbf{x},t) `` is a Heavyside function that returns one for a film height ``h(
\\
mathbf{x},t) >
\\
text{precursor layer}``.
The threshold value that seperates between film and dry spot is h = 0.06, all below will be counted as dry spot.
# Examples
# Examples
```jldoctest
```jldoctest
julia> using JuThinFilm
julia> using JuThinFilm
...
@@ 24,7 +34,7 @@ julia> JuThinFilm.measurewettedarea!(area, mom) # Now there is only one spot wit
...
@@ 24,7 +34,7 @@ julia> JuThinFilm.measurewettedarea!(area, mom) # Now there is only one spot wit
# References
# References
See also: [`run
real
simulation
2
'](@ref)
See also: [`runsimulation'](@ref)
"""
"""
function
measurewettedarea!
(
area
,
mom
::
Moment
)
function
measurewettedarea!
(
area
,
mom
::
Moment
)
mask
=
findall
(
x
>
x
>
0.06
,
mom
.
height
)
mask
=
findall
(
x
>
x
>
0.06
,
mom
.
height
)
...
@@ 37,14 +47,38 @@ end
...
@@ 37,14 +47,38 @@ end
Returns the differential surface area of the fluid interface.
Returns the differential surface area of the fluid interface.
# Theory
Computes the differential surface area according to
Computes the differential surface area according to
``S = ∫∫√[(∂ᵢh)^2 + (∂ⱼh)^2 + 1]didj ``
``S = ∫∫√[(∂ᵢh)^2 + (∂ⱼh)^2 + 1]didj .``
Keep in mind that we are not interested in the layer that stabilizes the simulation.
That is why a flat interface offers **no surface area**.
# Examples
# Examples
```jldoctest
```jldoctest
julia> using JuThinFilm
julia> using JuThinFilm
julia> surface = []; mom = default_moments(Float64, 10, 10);
julia> JuThinFilm.measurefluidsurfacearea!(surface, mom)
1element Array{Any,1}:
0.0
julia> mom.height = reshape(collect(1.0:100.0),10,10);
julia> JuThinFilm.measurefluidsurfacearea!(surface, mom) # Mainly due to the periodic bc!
2element Array{Any,1}:
0.0
1620.682406458573
```
```
# References
See also: [`runsimulation`](@ref)
"""
"""
function
measurefluidsurfacearea!
(
surface
,
mom
::
JuThinFilm
.
Moment
)
function
measurefluidsurfacearea!
(
surface
,
mom
::
JuThinFilm
.
Moment
)
len
,
wid
=
size
(
mom
.
height
)
len
,
wid
=
size
(
mom
.
height
)
...
@@ 62,7 +96,59 @@ function measurefluidsurfacearea!(surface, mom::JuThinFilm.Moment)
...
@@ 62,7 +96,59 @@ function measurefluidsurfacearea!(surface, mom::JuThinFilm.Moment)
push!
(
surface
,
area
)
push!
(
surface
,
area
)
end
end
"""
measuresurfaceandenergy!(surface, energy, mom::JuThinFilm.Moment, θ)
Returns the differential surface area of the fluid interface as well as the reduced interfacial energy.
# Theory
Again we use the formular from `measurefluidsurfacearea` to calculate the differential surface area
``S = ∫∫√[(∂ᵢh)^2 + (∂ⱼh)^2 + 1]didj .``
Keep in mind that we are not interested in the layer that stabilizes the simulation.
That is why a flat interface offers **no surface area**.
On top for the computation of the reduced interfacial free energy we use
``
\\
tilde{E} =
\\
frac{E}{
\\
gamma} = S_{lv} 
\\
int_{A_{ls}}
\\
cos(
\\
theta(x,y))
\\
text{d}A.``
Where the contact angle ``
\\
theta(x,y)`` is assumed to be *Youngs* contact angle and not the dynamically measured one.
# Examples
```jldoctest
julia> using JuThinFilm
julia> surface = []; energy = []; mom = default_moments(Float64, 10, 10);
julia> JuThinFilm.measuresurfaceandenergy!(surface, energy, mom, fill(1/9,10,10))
1element Array{Any,1}:
93.96926207859084
julia> surface
1element Array{Any,1}:
0.0
julia> mom.height = reshape(collect(1.0:100.0),10,10);
julia> JuThinFilm.measuresurfaceandenergy!(surface, energy, mom, fill(1/9,10,10))
2element Array{Any,1}:
93.96926207859084
1526.7131443799822
julia> surface
2element Array{Any,1}:
0.0
1620.682406458573
```
# References
See also: [`runsimulation`](@ref)
"""
function
measuresurfaceandenergy!
(
surface
,
energy
,
mom
::
JuThinFilm
.
Moment
,
θ
)
function
measuresurfaceandenergy!
(
surface
,
energy
,
mom
::
JuThinFilm
.
Moment
,
θ
)
len
,
wid
=
size
(
mom
.
height
)
len
,
wid
=
size
(
mom
.
height
)
minfilm
=
0.05
minfilm
=
0.05
...
@@ 78,7 +164,7 @@ function measuresurfaceandenergy!(surface, energy, mom::JuThinFilm.Moment, θ)
...
@@ 78,7 +164,7 @@ function measuresurfaceandenergy!(surface, energy, mom::JuThinFilm.Moment, θ)
area
=
sum
(
sqarea
)
area
=
sum
(
sqarea
)
# For the interfacial energy the contact angle field is needed as well.
# For the interfacial energy the contact angle field is needed as well.
mask
=
findall
(
x
>
x
>
0.06
,
mom
.
height
)
mask
=
findall
(
x
>
x
>
0.06
,
mom
.
height
)
E
=
area

sum
(
θ
[
mask
])
E
=
area

sum
(
cospi
.
(
θ
[
mask
])
)
push!
(
surface
,
area
)
push!
(
surface
,
area
)
push!
(
energy
,
E
)
push!
(
energy
,
E
)
end
end
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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