... | ... | @@ -86,13 +86,10 @@ while t < tEnd : |
|
|
time_integration.iterate(fluid, p, dt, min_nsub=5, external_particles_forces=g*mass)
|
|
|
t += dt
|
|
|
```
|
|
|
This function can be used to solve problem with fluid only, or grains only, or fluid and grains. The external_particle_forces argument contains the external forces that are applied on the grains. For instance, if the grains are falling under falling, this force will be set as:
|
|
|
```python
|
|
|
mass = np.pi*p.r()**2*rhop
|
|
|
```
|
|
|
This function can be used to solve problem with fluid only, or grains only, or fluid and grains. The external_particle_forces argument contains the external forces that are applied on the grains. For instance, if the grains are falling under falling, this force will be set as ```g*mass```.
|
|
|
The complete documentation of the function and its parameters are given:
|
|
|
```python
|
|
|
def iterate(fluid, particles, dt, min_nsub=1, contact_tol=1e-8, external_particles_forces=None, fixed_grains=False) :
|
|
|
def iterate(fluid, particles, dt, min_nsub=1, contact_tol=1e-8, external_particles_forces=None, fixed_grains=False, after_sub_iter=None,max_nsub=None,check_residual_norm=-1, use_predictor_corrector=True) :
|
|
|
"""Migflow solver: the solver type depends on the fluid and particles given as arguments.
|
|
|
|
|
|
Keyword arguments:
|
... | ... | @@ -103,13 +100,22 @@ def iterate(fluid, particles, dt, min_nsub=1, contact_tol=1e-8, external_particl |
|
|
contact_tol -- tolerance for the contact solver
|
|
|
external_particles_forces -- vector of external forces applied on the particles
|
|
|
fixed_grains -- boolean variable specifying if the grains are fixed in the fluid
|
|
|
after_sub_iter -- callback to execute once a sub iteration has been made
|
|
|
max_split -- maximum number of times the time step can be further split if convergence is not reached
|
|
|
|
|
|
Raises:
|
|
|
ValueError -- fluid and particles cannot be both None
|
|
|
ValueError -- external_particles_forces must have shape (number of particles,dimension)
|
|
|
"""
|
|
|
```
|
|
|
The loop also contains instruction to write output files. It is important to note that after moving the grains in the computational loop you have to use the _set_particles()_ function to search the new location of the grains in the mesh.
|
|
|
7. Finally, the output is written in the given directory every ```outf``` iteration.
|
|
|
```python
|
|
|
if ii %outf == 0 :
|
|
|
p.write_mig(outputdir, t)
|
|
|
fluid.write_mig(outputdir, t)
|
|
|
ii += 1
|
|
|
```
|
|
|
|
|
|
|
|
|
#### Optional Arguments
|
|
|
|
... | ... | |