Commit b88caba9 authored by Nathan Coppin (nathan.coppin@uclouvain.be)'s avatar Nathan Coppin (nathan.coppin@uclouvain.be)
Browse files

intensive script hopper

parent c77308a6
Pipeline #7566 passed with stage
in 1 minute and 49 seconds
......@@ -19,7 +19,6 @@ def _advance_particles(particles, f, dt, min_nsub,contact_tol,iteration=0,after_
# Estimation of the solid sub-time steps
if particles.r() is not None and particles.r().size != 0:
vn = particles.velocity() + f*dt / particles.mass()
print(vn,particles.r())
vmax = np.max(np.linalg.norm(vn,axis=1))
nsub = max(min_nsub, int(np.ceil((vmax * dt * 8)/min(particles.r()))))
else:
......
......@@ -26,7 +26,12 @@ from migflow import fluid
from migflow import time_integration
import numpy as np
import os
num = "05"
import sys
liste = ["02","03","04","05","06","07","08","09","10","11","12","13","14"]
inter = int(sys.argv[1])
index = int(inter/5)
numM = liste[index]
num = inter%5
def genInitialPosition(filename, r, rhop) :
"""Set all the particles centre positions and create the particles objects to add in the computing structure.
......@@ -40,9 +45,7 @@ def genInitialPosition(filename, r, rhop) :
#Particles structure builder
p = scontact.ParticleProblem(3, friction_enabled = True,rotation_enabled=True)
#Load mesh.msh file specifying physical boundaries names
p.load_msh_boundaries("mesh" + num + ".msh", ["Inner"], material = "Steel")
p.load_msh_boundaries("mesh" + num + ".msh", ["Right","Left","Front","Rear"], material = "Plexi")
p.load_msh_boundaries("mesh" + num + ".msh", ["LockDown"], material = "Steel")
p.load_msh_boundaries("mesh" + numM + ".msh", ["Inner","Right","Left","Front","Rear","Lockdown"], material = "Steel")
#Particles centre are placed on a regular grid
# Add a grain at each centre position
for y in np.arange(1+r, 2, 2*r*1.05):
......@@ -62,7 +65,7 @@ tEnd = 35 #final time
ii = 0 #iteration number
outf = 100 #iterations between data frames
# Define output directory
outputdir = "test" + num
outputdir ="CECI/home/ucl/mema/ncoppin/hopper" + numM + "/" + str(num)
if not os.path.isdir(outputdir) :
os.makedirs(outputdir)
#Creating file for drag data
......@@ -86,12 +89,9 @@ p2.remove_particles_flag((p2.position()[:,0] + p2.r()[:,0] <0.18))
p2.remove_particles_flag((p2.position()[:,0] + p2.r()[:,0] >-0.18))
p2.position()[:,1] -= 0.5
p.clear_boundaries()
p.load_msh_boundaries("mesh" + num + ".msh", ["Inner"], material = "Steel")
p.load_msh_boundaries("mesh" + num + ".msh", ["Right","Left","RightUp","RightDown","LeftUp","LeftDown","Front","Rear"], material = "Plexi")
p.load_msh_boundaries("mesh" + num + ".msh", ["LockDown"], material = "Steel")
p.load_msh_boundaries("mesh" + numM + ".msh", ["Inner","Right","Left","RightUp","RightDown","LeftUp","LeftDown","Front","Rear","LockDown"], material = "Steel")
p.set_friction_coefficient(0.15,"Sand","Sand")
p.set_friction_coefficient(0.2,"Sand","Steel")
p.set_friction_coefficient(0.2,"Sand","Plexi")
p.set_friction_coefficient(0.3,"Sand","Steel")
p.write_vtk(outputdir, 0, 0)
#
# COMPUTATION LOOP
......@@ -103,8 +103,7 @@ while t < tEnd :
if t>=5 and opened == 0:
opened = 1
p.clear_boundaries()
p.load_msh_boundaries("mesh" + num + ".msh", ["Inner"],material="Steel")
p.load_msh_boundaries("mesh" + num + ".msh", ["Right","Left","RightUp","RightDown","LeftUp","LeftDown","Front","Rear"],material="Plexi")
p.load_msh_boundaries("mesh" + numM + ".msh", ["Inner","Right","Left","RightUp","RightDown","LeftUp","LeftDown","Front","Rear"],material="Steel")
#Adding new particles
if (max(p.position()[:,1])+max(p.r()) <0.6) and t > 5 and t < 25:
p.add_particles(p2.position(),p2.r(),p2.mass(),v=p2.velocity(),tag="Sand",forced=p2.forced_flag(),contact_forces=p2.contact_forces())
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment