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
432c36a8
Commit
432c36a8
authored
6 years ago
by
Martin Bauer
Browse files
Options
Downloads
Patches
Plain Diff
Bugfixes in lbm phasefield module
parent
447111eb
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
phasefield/eos.py
+3
-3
3 additions, 3 deletions
phasefield/eos.py
phasefield/phasefieldstep.py
+4
-7
4 additions, 7 deletions
phasefield/phasefieldstep.py
phasefield/scenarios.py
+0
-1
0 additions, 1 deletion
phasefield/scenarios.py
with
7 additions
and
11 deletions
phasefield/eos.py
+
3
−
3
View file @
432c36a8
...
...
@@ -50,11 +50,12 @@ def maxwell_construction(eos, tolerance=1e-4):
max_rho
,
min_rho
,
_
=
critical_points
max_p
,
min_p
=
eos
.
subs
(
rho
,
max_rho
),
eos
.
subs
(
rho
,
min_rho
)
shift_max
=
max_p
*
0.999
shift_min
=
max
_p
*
0.0001
shift_min
=
max
(
0
,
min_p
)
c
=
(
shift_max
+
shift_min
)
/
2
deviation
=
tolerance
*
2
while
abs
(
deviation
)
>
tolerance
:
print
(
"
Deviation
"
,
deviation
,
"
Shift
"
,
c
)
zeros
=
sp
.
solve
(
eos
-
c
)
integral_bounds
=
(
min
(
zeros
),
max
(
zeros
))
deviation
=
get_deviation
(
float
(
integral_bounds
[
0
]),
float
(
integral_bounds
[
1
]),
float
(
c
))
...
...
@@ -87,4 +88,3 @@ def carnahan_starling_eos(density, gas_constant, temperature, a, b):
def
carnahan_starling_critical_temperature
(
a
,
b
,
gas_constant
):
return
0.3773
*
a
/
b
/
gas_constant
This diff is collapsed.
Click to expand it.
phasefield/phasefieldstep.py
+
4
−
7
View file @
432c36a8
...
...
@@ -309,13 +309,10 @@ class PhaseFieldStep:
last_index
=
None
phi
=
self
.
phi_slice
(
slice_obj
)
if
self
.
order_parameters_to_concentrations
is
None
:
return
phi
else
:
result
=
self
.
order_parameters_to_concentrations
(
phi
)
if
last_index
is
not
None
:
result
=
result
[...,
last_index
]
return
result
result
=
self
.
order_parameters_to_concentrations
(
phi
)
if
self
.
order_parameters_to_concentrations
else
phi
if
last_index
is
not
None
:
result
=
result
[...,
last_index
]
return
result
def
mu_slice
(
self
,
slice_obj
=
None
):
return
self
.
_get_slice
(
self
.
mu_field_name
,
slice_obj
)
...
...
This diff is collapsed.
Click to expand it.
phasefield/scenarios.py
+
0
−
1
View file @
432c36a8
...
...
@@ -36,7 +36,6 @@ def create_three_phase_model(alpha=1, kappa=(0.015, 0.015, 0.015), include_rho=T
return
PhaseFieldStep
(
free_energy
,
order_parameters
,
density_order_parameter
=
None
,
transformation_matrix
=
transformation_matrix
,
order_parameters_to_concentrations
=
order_parameters_to_concentrations
,
cahn_hilliard_gammas
=
[
1
,
1
,
1
/
3
],
**
kwargs
)
...
...
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