Commit cb1ff3d2 by Nathan Coppin

### Better drag.py

parent f21448e9
Pipeline #7042 passed with stage
in 2 minutes and 19 seconds
 ... ... @@ -21,10 +21,11 @@ def _advance_particles(particles, f, dt, min_nsub,contact_tol,momentum=None,iter else: vmax = np.max(np.hypot(vn[:, 0], vn[:, 1])) # Estimation of the solid sub-time steps print("VMAX",vmax) nsub = max(min_nsub, int(np.ceil((vmax * dt * 8)/min(particles.r())))) print("NSUB", nsub,"VMAX",vmax, "VMAX * dt", vmax * dt, "r", min(particles.r())) #If time step was split too many times, ignore the convergence and move the grains if iteration == 3: if iteration == 1: for i in range(nsub) : particles.iterate(dt/nsub, f, tol=contact_tol,force_motion=1) return ... ...
 ... ... @@ -714,6 +714,7 @@ if (fabs(vt)> ((p->a+1)/p->a)*mu*dp) vt *= ((p->a+1)/p->a)*mu*dp/fabs(vt); #if DIMENSION==2 coordAdd(&p->velocity[c->o1 * DIMENSION], -ct*(p->a/(p->a+1))*c->a1, t); p->omega[c->o1] -= (1/p->particles[c->o1].r)*(1/((p->a+1)))*ct*c->a1; #else cs -= c->cs; coordAdd(&p->velocity[c->o1 * DIMENSION], -ct*(p->a/(p->a+1))*c->a1, t); ... ...