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
880a1eec
Commit
880a1eec
authored
Jan 08, 2019
by
Matthieu Constant
Browse files
inject testcase
parent
9a36dd3e
Changes
2
Hide whitespace changes
Inline
Side-by-side
testcases/injectionWGrains/Q0.05Lyon/inject2fGrains.py
View file @
880a1eec
...
...
@@ -30,7 +30,7 @@ import time
import
shutil
import
random
outputdir
=
"output"
outputdir
=
"output
1
"
if
not
os
.
path
.
isdir
(
outputdir
)
:
os
.
makedirs
(
outputdir
)
...
...
@@ -42,10 +42,10 @@ def genInitialPosition(filename, N, r, lx, ly, rhop) :
p
=
scontact
.
ParticleProblem
(
2
)
#Loading of the mesh.msh file specifying physical boundaries name
p
.
load_msh_boundaries
(
"mesh.msh"
,
[
"Top"
,
"Bottom"
,
"Lateral"
,
"Injection"
])
p
.
load_msh_boundaries
(
"mesh.msh"
,
[
"Top"
,
"Bottom"
,
"Lateral"
])
#Definition of the points where the grains are located
Ra
=
0.
9
*
r
Rb
=
1.1
*
r
Ra
=
0.
8
*
r
Rb
=
0.9
*
r
radii
=
pre
.
granulo_Random
(
N
,
Ra
,
Rb
)
[
nb_laid_particles
,
coors
]
=
pre
.
depositInBox2D
(
radii
,
lx
,
ly
)
for
i
in
range
(
nb_laid_particles
):
...
...
@@ -70,7 +70,7 @@ rhop = 1059
dt
=
.
001
# time step
shutil
.
copy
(
"mesh.msh"
,
outputdir
+
"/mesh.msh"
)
genInitialPosition
(
outputdir
,
N
,
r
,
lx
,
ly
,
rhop
)
#
genInitialPosition(outputdir, N, r, lx, ly, rhop)
if
use_lmgc
:
friction
=
0.3
lmgc90Interface
.
scontactTolmgc90
(
outputdir
,
2
,
0
,
friction
)
...
...
@@ -80,29 +80,34 @@ else:
p
=
scontact
.
ParticleProblem
(
2
)
p
.
read_vtk
(
outputdir
,
0
)
fluid
=
fluid
.
FluidProblem
(
2
,
g
,[
nu0
*
rho0
,
nu1
*
rho1
],[
rho0
,
rho1
])
fluid
.
load_msh
(
"mesh.msh"
)
Q
=
5e-5
/
60
w
=
2e-3
l
=
8e-3
L
=
0.136
sc_v
=
Q
/
(
l
*
w
)
# number of iterations between output files
outf
=
25
ii
=
0
t
=
0
def
outerBndV
(
x
)
:
v
=
0.06631457341797832
*
4
return
v
#0.265258#*min((6*t**5-15*t**4+10*t**3),1)
v
=
np
.
ndarray
((
len
(
x
[:,
0
])))
v
[:]
=
0
v
[
np
.
abs
(
x
[:,
0
]
-
L
/
2
)
<
l
/
2
]
=
sc_v
return
v
fluid
=
fluid
.
FluidProblem
(
2
,
g
,[
nu0
*
rho0
,
nu1
*
rho1
],[
rho0
,
rho1
])
fluid
.
load_msh
(
"mesh.msh"
)
fluid
.
set_wall_boundary
(
"Bottom"
,
pressure
=
None
)
fluid
.
set_wall_boundary
(
"Lateral"
,
pressure
=
None
)
fluid
.
set_open_boundary
(
"Top"
,
pressure
=
0
,
porosity
=
1
,
concentration
=
1
)
fluid
.
set_open_boundary
(
"
Injection
"
,
velocity
=
[
0
,
outerBndV
],
porosity
=
1
,
concentration
=
1
)
fluid
.
set_open_boundary
(
"
Bottom
"
,
velocity
=
[
0
,
outerBndV
],
porosity
=
1
,
concentration
=
1
)
#fluid.set_strong_boundary("Injection",1,outerBndV)
fluid
.
set_particles
(
p
.
mass
(),
p
.
volume
(),
p
.
position
(),
p
.
velocity
())
#set initial_condition
c
=
np
.
zeros_like
(
fluid
.
coordinates
()[:,
1
])
for
i
in
range
(
len
(
fluid
.
coordinates
()[:,
1
])):
c
[
i
]
=
max
(
min
(
100
*
fluid
.
coordinates
()[
i
,
1
]
-
18
,
1
),
0
)
#fluid.solution()[:,3] = c
fluid
.
set_concentration_cg
(
c
)
fluid
.
export_vtk
(
outputdir
,
0
,
0
)
...
...
testcases/injectionWGrains/Q0.05Lyon/mesh.geo
View file @
880a1eec
L = .136;
H = .
25
;
H = .
18
;
l = 4e-3;
lc = 0.01;
f =
4
;
f =
8
;
Point(1) = {0, H, 0};
Point(2) = {0, 0, 0};
Point(3) = {L/2-l/2,0,0};
Point(4) = {L/2+l/2,0,0};
Point(5) = {L,0,0};
Point(6) = {L,H,0};
Point(9) = {L/2,0,0};
Point(10) = {L/2,H,0};
Point(1) = {0, H, 0,2*lc/f};
Point(2) = {0, 0, 0,lc/f};
Point(3) = {L,0,0,lc/f};
Point(4) = {L,H,0,2*lc/f};
Line(1) = {1, 2};
Line(2) = {2, 3};
Line(3) = {3, 4};
Line(4) = {4, 5};
Line(5) = {5, 6};
Line(6) = {6, 1};
Line(9) = {9,10};
Line(4) = {4, 1};
Line Loop(1) = {1:
6
};
Line Loop(1) = {1:
4
};
Plane Surface(1) = {1};
Physical Line("Bottom") = {2,4};
Physical Line("Lateral") = {1,5};
Physical Line("Top") = {6};
Physical Line("Injection") = {3};
Physical Line("Bottom") = {2};
Physical Line("Lateral") = {1,3};
Physical Line("Top") = {4};
Physical Surface("Domain") = {1};
Physical Point("PtFix") = {1};
Field[1] = Attractor;
Field[1].EdgesList = {9};
Field[1].NNodesByEdge = 200;
Field[2] = Threshold;
Field[2].DistMax = 10*l;
Field[2].DistMin = l;
Field[2].LcMax = lc/f;
Field[2].LcMin = lc/f;
Field[2].IField = 1;
Background Field = 2;
Mesh.MshFileVersion = 2;
Mesh.MshFileVersion = 2;
\ No newline at end of file
Write
Preview
Markdown
is supported
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