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
fluidparticles
MigFlow
Commits
e357c467
Commit
e357c467
authored
Jan 07, 2022
by
Michel Henry
Browse files
add leidenfrost
parent
d6572087
Pipeline
#10099
failed with stages
in 3 minutes and 23 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
testcases/leidenfrost/leidenfrost.py
0 → 100644
View file @
e357c467
import
numpy
as
np
import
os
import
time
from
migflow
import
fluid
from
migflow
import
time_integration
outputdir
=
"output"
if
not
os
.
path
.
isdir
(
outputdir
)
:
os
.
makedirs
(
outputdir
)
outf
=
5
g
=
np
.
array
([
0
,
-
9.81
])
rho
=
1000
nu
=
1e-6
dt
=
1e-2
tEnd
=
100
fluid
=
fluid
.
FluidProblem
(
2
,
g
,
nu
*
rho
,
rho
,
order
=
[
2
,
2
,
1
],
solver
=
"petsc4py"
,
solver_options
=
"-pc_type lu"
)
fluid
.
load_msh
(
"mesh.msh"
)
c
=
np
.
array
([
0.5
,
0.5
])
r
=
0.1
fluid
.
set_open_boundary
(
"Lateral"
,
velocity
=
[
0
,
0
])
fluid
.
set_open_boundary
(
"Top"
,
pressure
=
0
)
fluid
.
set_wall_boundary
(
"Bottom"
,
velocity
=
[
0
,
0
])
fluid
.
set_wall_boundary
(
"Bubble"
,
velocity
=
[
lambda
x
:
(
x
[:,
0
]
-
c
[
0
])
/
r
,
lambda
x
:
(
x
[:,
1
]
-
c
[
1
])
/
r
])
fluid
.
set_strong_boundary
(
"Bubble"
,
0
,
lambda
x
:
x
[:,
0
]
-
c
[
0
])
fluid
.
set_strong_boundary
(
"Bubble"
,
1
,
lambda
x
:
x
[:,
1
]
-
c
[
1
])
t
=
0
ii
=
0
fluid
.
write_vtk
(
outputdir
,
t
,
ii
)
tic
=
time
.
time
()
while
(
t
<
tEnd
):
fluid
.
implicit_euler
(
dt
,
1e-2
)
fboundary
=
fluid
.
boundary_force
()[
3
,:]
print
(
fboundary
)
t
+=
dt
if
ii
%
outf
==
0
:
ioutput
=
int
(
ii
/
outf
)
+
1
fluid
.
write_vtk
(
outputdir
,
ioutput
,
t
)
ii
+=
1
print
(
"%i : %.2g/%.2g (cpu %.6g)"
%
(
ii
,
t
,
tEnd
,
time
.
time
()
-
tic
))
testcases/leidenfrost/mesh.geo
0 → 100644
View file @
e357c467
H = 1;
L = 1;
Cx = 0.5;
Cy = 0.5;
r = 0.1;
lc = 0.1;
lc_circle = lc/10;
Point(1) = {0,0,0,lc};
Point(2) = {L,0,0,lc};
Point(3) = {L,H,0,lc};
Point(4) = {0,H,0,lc};
Line(1) = {1,2};
Line(2) = {2,3};
Line(3) = {3,4};
Line(4) = {4,1};
Line Loop(1) = {1:4};
Point(5) = {Cx,Cy,0,lc_circle};
Point(6) = {Cx-r,Cy,0,lc_circle};
Point(7) = {Cx+r,Cy,0,lc_circle};
Point(8) = {Cx,Cy-r,0,lc_circle};
Point(9) = {Cx,Cy+r,0,lc_circle};
Circle(5) = {7, 5, 9};
Circle(6) = {9, 5, 6};
Circle(7) = {6, 5, 8};
Circle(8) = {8, 5, 7};
Line Loop(2) = {5,6,7,8};
Plane Surface(1) = {1,2};
Physical Line("Bottom") = {1};
Physical Line("Lateral") = {2,4};
Physical Line("Top") = {3};
Physical Line("Bubble") = {5:8};
Physical Surface("Domain") = {1};
Mesh.MshFileVersion = 4.1;
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