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
e9882d20
Commit
e9882d20
authored
May 28, 2019
by
Matthieu Constant
Browse files
predictor-corrector for drag in stab
parent
82f5a7e4
Pipeline
#5387
passed with stage
in 26 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
testcases/depot-2d/depotPredCorr.py
View file @
e9882d20
...
...
@@ -75,7 +75,7 @@ nu = 1e-6 # kinematic viscosity
# Numerical parameters
outf
=
1
# number of iterations between output files
dt
=
0.25
e-
2
# time step
dt
=
1
e-
3
# time step
tEnd
=
100
# final time
# Geometrical parameters
...
...
@@ -116,11 +116,10 @@ fluid.set_strong_boundary("Bottom",0,0)
fluid
.
set_strong_boundary
(
"Bottom"
,
1
,
0
)
fluid
.
solution
()[:,
2
]
=
(
fluid
.
coordinates
()[:,
1
]
-
0.6
)
*
rho
*
g
# Set location of the particles in the mesh and compute the porosity in each computation cell
fluid
.
set_particles
(
p
.
mass
(),
p
.
volume
(),
p
.
position
(),
p
.
velocity
(),
p
.
contact_forces
())
fluid
.
set_particles
(
p
.
mass
(),
p
.
volume
(),
p
.
position
(),
p
.
velocity
(),
p
.
contact_forces
()
,
init
=
True
)
fluid
.
export_vtk
(
outputdir
,
0
,
0
)
tic
=
time
.
time
()
fluid
.
set_particles
(
p
.
mass
(),
p
.
volume
(),
p
.
position
(),
p
.
velocity
(),
p
.
contact_forces
())
#
# COMPUTATION LOOP
#
...
...
@@ -132,8 +131,9 @@ while t < tEnd :
fluid
.
implicit_euler
(
dt
)
# Computation of the new velocities
forces
=
fluid
.
compute_node_force
(
dt
)
p
.
velocity
()[:,:]
=
p
.
velocity
()
+
forces
*
dt
/
p
.
mass
()
p
.
velocity
()[:,:]
=
p
.
velocity
()
+
forces
*
dt
/
p
.
mass
()
fluid
.
set_particles
(
p
.
mass
(),
p
.
volume
(),
p
.
position
(),
p
.
velocity
(),
p
.
contact_forces
())
### corrector
fluid
.
solution
()[:,:]
=
s
[:,:]
# Fluid solver
...
...
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