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
45cb5578
Commit
45cb5578
authored
Nov 05, 2018
by
Frédéric Dubois
Browse files
wip lmgc90 interface
parent
d94bed4d
Pipeline
#4530
failed with stage
in 20 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
testcases/reduction2d/fd_depot-fluid.py
View file @
45cb5578
#!/usr/bin/env python
use_lmgc
=
False
#True
use_lmgc
90
=
False
#True
from
migflow
import
fluid
from
migflow
import
scontact
if
use_lmgc
:
from
migflow
import
lmgc
2
Interface
if
use_lmgc
90
:
from
migflow
import
lmgc
90
Interface
import
numpy
as
np
import
os
...
...
@@ -51,10 +51,11 @@ lypart = 150*r
lxpart
=
50
*
r
genInitialPosition
(
outputdir
,
r
,
x0part
,
y0part
,
lxpart
,
lypart
,
rhop
)
if
use_lmgc
:
friction
=
0.1
# friction coefficient
lmgc2Interface
.
scontactToLmgc90
(
outputdir
,
0
,
friction
)
p
=
lmgc2Interface
.
LmgcInterface
()
if
use_lmgc90
:
# friction coefficient
friction
=
0.1
lmgc90Interface
.
scontactTolmgc90
(
outputdir
,
2
,
0
,
friction
)
p
=
lmgc90Interface
.
ParticleProblem
(
2
)
else
:
p
=
scontact
.
ParticleProblem
(
2
)
p
.
read_vtk
(
outputdir
,
0
)
...
...
@@ -66,8 +67,6 @@ print("r = %g, m = %g\n" % (p.r()[0], p.mass()[0]))
print
(
"RHOP = %g"
%
rhop
)
outf
=
20
#000
fluid
=
fluid
.
FluidProblem
(
2
,
g
,
nu
*
rho
,
rho
)
fluid
.
load_msh
(
"mesh.msh"
)
fluid
.
set_strong_boundary
(
"Box"
,
0
,
0
)
...
...
@@ -75,7 +74,7 @@ fluid.set_strong_boundary("Box",1,0)
fluid
.
set_strong_boundary
(
"Left"
,
0
,
0.001
)
fluid
.
set_strong_boundary
(
"Right"
,
2
,
0
)
fluid
.
set_weak_boundary
(
"Left"
,
"Inflow"
)
fluid
.
set_weak_boundary
(
"Right"
,
"Outlow"
)
fluid
.
set_weak_boundary
(
"Right"
,
"Out
f
low"
)
fluid
.
set_particles
(
p
.
mass
(),
p
.
volume
(),
p
.
position
(),
p
.
velocity
())
fluid
.
export_vtk
(
outputdir
,
0
,
0
)
...
...
@@ -95,8 +94,7 @@ while t < tEnd :
t
+=
dt
if
ii
%
outf
==
0
:
ioutput
=
int
(
ii
/
outf
)
+
1
if
not
use_lmgc
:
p
.
write_vtk
(
outputdir
,
ioutput
,
t
)
#if not use_lmgc : p.write_boundary_vtk(outputdir, ioutput, t)
if
not
use_lmgc90
:
p
.
write_vtk
(
outputdir
,
ioutput
,
t
)
fluid
.
export_vtk
(
outputdir
,
t
,
ioutput
)
ii
+=
1
print
(
"%i : %.2g/%.2g (cpu %.6g)"
%
(
ii
,
t
,
tEnd
,
time
.
time
()
-
tic
))
...
...
testcases/sablier-2d/sablier.py
View file @
45cb5578
...
...
@@ -25,7 +25,7 @@
# Falling particles in a sandglass
from
migflow
import
fluid
from
migflow
import
scontact
from
migflow
import
lmgc
2
Interface
from
migflow
import
lmgc
90
Interface
import
numpy
as
np
import
os
...
...
@@ -71,14 +71,14 @@ lxpart = 0.015 # semi-width of the grains
dt
=
1e-3
# time step
#Enable the use of lmgc90
use_lmgc
=
True
use_lmgc
90
=
True
#Object particles creation
genInitialPosition
(
outputdir
,
r
,
0.
,
y0part
,
lxpart
,
lypart
,
rhop
)
if
use_lmgc
:
if
use_lmgc
90
:
friction
=
0.1
# friction coefficient
lmgc
2
Interface
.
scontactTo
L
mgc90
(
outputdir
,
0
,
friction
)
p
=
lmgc
2
Interface
.
LmgcInterface
(
)
lmgc
90
Interface
.
scontactTo
l
mgc90
(
outputdir
,
2
,
0
,
friction
)
p
=
lmgc
90
Interface
.
ParticleProblem
(
2
)
else
:
p
=
scontact
.
ParticleProblem
(
2
)
p
.
read_vtk
(
outputdir
,
0
)
...
...
testcases/vortices/vortices.py
View file @
45cb5578
...
...
@@ -22,7 +22,7 @@
#!/usr/bin/env python
from
migflow
import
fluid
from
migflow
import
scontact
from
migflow
import
lmgc
2
Interface
from
migflow
import
lmgc
90
Interface
import
numpy
as
np
import
os
...
...
@@ -58,12 +58,12 @@ for i in range(len(p1.position()[:,0])):
p
.
add_particle
((
p1
.
position
()[
i
,
0
],
p1
.
position
()[
i
,
1
]),
p1
.
r
()[
i
],
p1
.
r
()[
i
]
**
2
*
np
.
pi
*
rhop
)
p
.
write_vtk
(
outputdir
,
0
,
0
)
#Use lmgc for friction or not without friction
use_lmgc
=
True
if
use_lmgc
:
#Use lmgc
90
for friction or not without friction
use_lmgc
90
=
True
if
use_lmgc
90
:
friction
=
0.3
#friction coefficient
lmgc
2
Interface
.
scontactTo
L
mgc90
(
outputdir
,
0
,
friction
)
p
=
lmgc
2
Interface
.
LmgcInterface
(
)
lmgc
90
Interface
.
scontactTo
l
mgc90
(
outputdir
,
2
,
0
,
friction
)
p
=
lmgc
90
Interface
.
ParticleProblem
(
2
)
else
:
p
=
scontact
.
ParticleProblem
(
2
)
p
.
read_vtk
(
outputdir
,
0
)
...
...
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