Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
lbmpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pycodegen
lbmpy
Commits
827fb289
Commit
827fb289
authored
6 years ago
by
Martin Bauer
Browse files
Options
Downloads
Patches
Plain Diff
Corrected angle computationw
parent
cf025024
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
methods/entropic_eq_srt.py
+3
-0
3 additions, 0 deletions
methods/entropic_eq_srt.py
phasefield/contact_angle_circle_fitting.py
+22
-16
22 additions, 16 deletions
phasefield/contact_angle_circle_fitting.py
with
25 additions
and
16 deletions
methods/entropic_eq_srt.py
+
3
−
0
View file @
827fb289
...
@@ -6,6 +6,9 @@ from lbmpy.methods.conservedquantitycomputation import DensityVelocityComputatio
...
@@ -6,6 +6,9 @@ from lbmpy.methods.conservedquantitycomputation import DensityVelocityComputatio
class
EntropicEquilibriumSRT
(
AbstractLbMethod
):
class
EntropicEquilibriumSRT
(
AbstractLbMethod
):
"""
Equilibrium from
'
Minimal entropic kinetic models for hydrodynamics
'
Ansumali, S. ; Karlin, I. V; Öttinger, H. C, (2003)
"""
def
__init__
(
self
,
stencil
,
relaxation_rate
,
force_model
,
conserved_quantity_calculation
):
def
__init__
(
self
,
stencil
,
relaxation_rate
,
force_model
,
conserved_quantity_calculation
):
super
(
EntropicEquilibriumSRT
,
self
).
__init__
(
stencil
)
super
(
EntropicEquilibriumSRT
,
self
).
__init__
(
stencil
)
...
...
This diff is collapsed.
Click to expand it.
phasefield/contact_angle_circle_fitting.py
+
22
−
16
View file @
827fb289
...
@@ -122,19 +122,25 @@ def liquid_lens_neumann_angles(concentration, drop_phase_idx=2, enclosing_phase1
...
@@ -122,19 +122,25 @@ def liquid_lens_neumann_angles(concentration, drop_phase_idx=2, enclosing_phase1
y1
,
y2
=
(
i
[
1
]
for
i
in
intersections
)
y1
,
y2
=
(
i
[
1
]
for
i
in
intersections
)
assert
np
.
abs
(
y1
-
y2
)
<
0.1
,
"
Liquid lens is not aligned in y direction (rotated?)
"
assert
np
.
abs
(
y1
-
y2
)
<
0.1
,
"
Liquid lens is not aligned in y direction (rotated?)
"
y_horizontal
=
(
y1
+
y2
)
/
2
left_intersection
=
sorted
(
intersections
,
key
=
lambda
e
:
e
[
0
])[
0
]
xs
=
np
.
sqrt
(
circles
[
0
].
radius
**
2
-
(
y_horizontal
-
circles
[
0
].
center
[
1
])
**
2
)
lower_circle
,
upper_circle
=
sorted
(
circles
,
key
=
lambda
c
:
c
.
center
[
1
])
angle
=
np
.
rad2deg
(
np
.
arctan
(
-
xs
/
np
.
sqrt
(
circles
[
0
].
radius
**
2
-
xs
**
2
)))
%
180
angle
=
180
-
angle
def
rotate90_ccw
(
vector
):
neumann3_upper
=
angle
return
np
.
array
([
-
vector
[
1
],
vector
[
0
]])
neumann1
=
180
-
neumann3_upper
def
rotate90_cw
(
vector
):
xs
=
np
.
sqrt
(
circles
[
1
].
radius
**
2
-
(
y_horizontal
-
circles
[
1
].
center
[
1
])
**
2
)
return
np
.
array
([
vector
[
1
],
-
vector
[
0
]])
angle
=
np
.
rad2deg
(
np
.
arctan
(
-
xs
/
np
.
sqrt
(
circles
[
1
].
radius
**
2
-
xs
**
2
)))
%
180
angle
=
180
-
angle
def
normalize
(
vector
):
neumann3_lower
=
angle
return
vector
/
np
.
linalg
.
norm
(
vector
)
neumann2
=
180
-
neumann3_lower
vector_20
=
normalize
(
rotate90_ccw
(
lower_circle
.
center
-
left_intersection
))
neumann3
=
neumann3_upper
+
neumann3_lower
vector_01
=
np
.
array
([
-
1
,
0
])
return
neumann1
,
neumann2
,
neumann3
vector_12
=
normalize
(
rotate90_cw
(
upper_circle
.
center
-
left_intersection
))
angles
=
[
np
.
rad2deg
(
np
.
arccos
(
np
.
dot
(
v1
,
v2
)))
for
v1
,
v2
in
[(
vector_20
,
vector_01
),
(
vector_01
,
vector_12
),
(
vector_12
,
vector_20
)]
]
return
angles
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment