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
8ff1d2cb
Commit
8ff1d2cb
authored
6 years ago
by
Martin Bauer
Browse files
Options
Downloads
Patches
Plain Diff
boyer n-phase model: analytical tests + bugfix in interfacial term
parent
725b4a8c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
phasefield/n_phase_boyer.py
+20
-10
20 additions, 10 deletions
phasefield/n_phase_boyer.py
with
20 additions
and
10 deletions
phasefield/n_phase_boyer.py
+
20
−
10
View file @
8ff1d2cb
...
...
@@ -65,15 +65,6 @@ def psi(k, c, f):
return
result
def
psi2
(
k
,
c
,
f
):
n
=
len
(
c
)
assert
k
<=
n
result
=
0
for
s
in
range
(
1
,
k
+
1
):
result
+=
(
-
1
)
**
(
k
-
s
)
*
sp
.
binomial
(
n
-
s
,
k
-
s
)
*
capital_s
(
s
,
c
,
f
)
return
result
def
h
(
u
,
v
):
return
sp
.
Abs
(
v
)
*
v
/
(
sp
.
Abs
(
v
)
+
u
**
2
)
...
...
@@ -98,8 +89,10 @@ def l_bar(free_energy, alpha_bar, c):
def
free_energy_interfacial
(
c
,
surface_tensions
,
a
,
epsilon
):
n
=
len
(
c
)
# this is different than in the paper: the sum is under the condition i < j, not i != j
# otherwise the model does not correctly reduce to equation 1.5
return
-
epsilon
*
a
/
2
*
sum
(
surface_tensions
[
i
,
j
]
*
Diff
(
c
[
i
])
*
Diff
(
c
[
j
])
for
i
in
range
(
n
)
for
j
in
range
(
n
))
for
i
in
range
(
n
)
for
j
in
range
(
i
))
def
free_energy_bulk
(
capital_f
,
b
,
epsilon
):
...
...
@@ -127,6 +120,23 @@ def capital_f0(c, surface_tension, f=lambda c: c ** 2 * (1 - c) ** 2):
return
result
def
free_energy
(
c
,
epsilon
,
surface_tensions
,
stabilization_factor
):
alpha
,
_
=
diffusion_coefficients
(
surface_tensions
)
capital_f
=
(
capital_f0
(
c
,
surface_tensions
)
+
correction_g
(
c
,
surface_tensions
)
+
stabilization_factor
*
stabilization_term
(
c
,
alpha
))
def
f
(
x
):
return
x
**
2
*
(
1
-
x
)
**
2
a
,
b
=
compute_ab
(
f
)
f_bulk
=
free_energy_bulk
(
capital_f
,
b
,
epsilon
)
f_if
=
free_energy_interfacial
(
c
,
surface_tensions
,
a
,
epsilon
)
return
f_if
+
f_bulk
def
symbolic_surface_tensions
(
num_phases
):
def
creation_func
(
i
,
j
):
if
i
==
j
:
...
...
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