Commit 34975859 authored by Frédéric Dubois's avatar Frédéric Dubois
Browse files

bug fix

parent 3d2a5e3a
Pipeline #8458 failed with stages
in 1 minute and 12 seconds
......@@ -313,8 +313,11 @@ class ParticleProblem(object):
self.dump_state()
# keep the Vbeg
self._vsnap = self.velocity()
self._vsnap = self.velocity().copy()
# for i in range(self._vsnap.shape[0]):
# chipy.utilities_logMes("v0 = %g %g\n" % (self._vsnap[i,0],self._vsnap[i,1]))
# previous step contact resultant on particles
if self._old_fc is None:
self._old_fc = np.zeros_like(self.velocity())
......@@ -324,7 +327,7 @@ class ParticleProblem(object):
self._fc = np.zeros_like(self.velocity())
# shift
self._old_fc = self._fc
self._old_fc = self._fc.copy()
def write_vtk_lmgc(self, filemame, i, t) :
......@@ -344,6 +347,13 @@ class ParticleProblem(object):
return(self._old_fc)
else:
self._fc = (self.velocity()-self._vsnap)*self.mass()/dt - drag_forces
# for i in range(self._fc.shape[0]):
# chipy.utilities_logMes("v0 = %g %g\n" % (self._vsnap[i,0],self._vsnap[i,1]))
# chipy.utilities_logMes("v = %g %g\n" % (self.velocity()[i,0],self.velocity()[i,1]))
# chipy.utilities_logMes("f = %g %g\n" % (drag_forces[i,0],drag_forces[i,1]))
# chipy.utilities_logMes("Rc = %g %g\n" % (self._fc[i,0],self._fc[i,1]))
return(self._fc)
#fd totalement bidon
......
......@@ -93,6 +93,9 @@ def predictor_corrector_iterate(fluid, particles, dt, min_nsub=1, contact_tol=1e
# freeze a lmgc90/particles state
particles.snapshot()
# for i in range(external_particles_forces.shape[0]):
# chipy.utilities_logMes("g = %g %g\n" % (external_particles_forces[i,0],external_particles_forces[i,1]))
chipy.utilities_logMes("+++ prediction - getting state0 +++")
state0 = particles.state()
......@@ -108,6 +111,11 @@ def predictor_corrector_iterate(fluid, particles, dt, min_nsub=1, contact_tol=1e
# Compute the fluid solution and keep a copy of this solution and the forces applied by the fluid on the grains
fluid.implicit_euler(dt)
sf1 = np.copy(fluid.solution())
# for i in range(external_particles_forces.shape[0]):
# chipy.utilities_logMes("drag0 = %g %g\n" % (fluid.compute_node_force(dt)[i,0],fluid.compute_node_force(dt)[i,1]))
f0 = np.copy(fluid.compute_node_force(dt))+external_particles_forces
_advance_particles(particles,f0,dt,min_nsub,contact_tol,max_split=max_split)
......@@ -131,6 +139,9 @@ def predictor_corrector_iterate(fluid, particles, dt, min_nsub=1, contact_tol=1e
# Fluid solution is a weighted average of the predicted one and the corrected one.
# The alpha parametre is the weight
fluid.solution()[:,:] = (alpha*fluid.solution()+(1-alpha)*sf1)
# for i in range(external_particles_forces.shape[0]):
# chipy.utilities_logMes("drag1 = %g %g\n" % (fluid.compute_node_force(dt)[i,0],fluid.compute_node_force(dt)[i,1]))
f1 = np.copy(fluid.compute_node_force(dt))+external_particles_forces
# For two fluids flows, advance the concentration field with the fluid velocity.
# The number of sub-time steps for the advection is automatically computed.
......
Markdown is supported
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