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
d9667408
Commit
d9667408
authored
Jun 26, 2020
by
Nathan Coppin
Browse files
adapting valid
parent
e4b05067
Pipeline
#7806
failed with stages
in 2 minutes and 55 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
validation/weight/weight.py
View file @
d9667408
...
...
@@ -65,11 +65,11 @@ def genInitialPosition(filename, rmin, rmax, H, lx, ly, rhop) :
p
.
add_particle
((
x
[
i
],
y
[
i
]),
r
[
i
],
r
[
i
]
**
2
*
np
.
pi
*
rhop
)
p
.
write_vtk
(
filename
,
0
,
0
)
def
total_boundary_
impulsion
(
p
):
fn
,
ft
=
p
.
get_boundary_
impulsion
(
"left"
)
fn2
,
ft2
=
p
.
get_boundary_
impulsion
(
"right"
)
fn3
,
ft3
=
p
.
get_boundary_
impulsion
(
"bottom"
)
fn4
,
ft4
=
p
.
get_boundary_
impulsion
(
"top"
)
def
total_boundary_
force
(
p
):
fn
,
ft
=
p
.
get_boundary_
force
(
"left"
)
fn2
,
ft2
=
p
.
get_boundary_
force
(
"right"
)
fn3
,
ft3
=
p
.
get_boundary_
force
(
"bottom"
)
fn4
,
ft4
=
p
.
get_boundary_
force
(
"top"
)
return
fn
+
fn2
+
fn3
+
fn4
+
ft
+
ft2
+
ft3
+
ft4
class
Weight
(
unittest
.
TestCase
)
:
...
...
@@ -114,7 +114,7 @@ class Weight(unittest.TestCase) :
#
forces
=
g
*
p
.
mass
()
def
accumulate
(
bnd_forces
)
:
bnd_forces
+=
total_boundary_
impulsion
(
p
)
bnd_forces
+=
total_boundary_
force
(
p
)
while
t
<
tEnd
:
bnd_forces
=
np
.
zeros
((
2
,))
time_integration
.
iterate
(
None
,
p
,
dt
,
min_nsub
=
1
,
external_particles_forces
=
forces
,
...
...
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