... | ... | @@ -64,57 +64,31 @@ for xi,yi in zip(x,y): |
|
|
fluid = fluid.FluidProblem(2,g,[nu*rho],[rho],solver="petsc",solver_options="-pc_type lu", usolid=True, model_b=1)
|
|
|
fluid.load_msh("mesh.msh")
|
|
|
```
|
|
|
* Set the boundary conditions. Strong or weak ones can be prescribed. Walls without normal flux are the simplest case illustrated here.
|
|
|
* Set the boundary conditions. Strong or weak ones can be prescribed. Walls without normal flux are the simplest case illustrated [here](https://git.immc.ucl.ac.be/fluidparticles/migflow/blob/master/testcases/depot-2d/depot.py#L81), with ```set_wall_boundary()```.
|
|
|
|
|
|
|
|
|
* [Weak boundaries](https://git.immc.ucl.ac.be/fluidparticles/migflow/blob/master/testcases/depot-2d/depot.py#L107) specify the flux at each boundary. The flux terms added by these conditions come from the integration by part arising from the finite element methods and can be suppressed for some weak boundary type. For example, if you consider a wall, it is quite obvious that the velocity flux across the boundary is zero but the pressure could be specified. There are two types of weak boundaries _wall_ and _open_:
|
|
|
|
|
|
```python
|
|
|
fluid.set_wall_boundary(tag, pressure=None)
|
|
|
"""Set the weak boundaries (=normal fluxes) for the fluid problem.
|
|
|
|
|
|
Keyword arguments:
|
|
|
tag -- physical tag (or list of tags), set in the mesh.geo file, of the wall boundaries
|
|
|
pressure -- the pressure value if imposed (callback or number)
|
|
|
"""
|
|
|
|
|
|
fluid.set_open_boundary(tag, velocity=None, pressure=None, porosity=1, concentration=1)
|
|
|
"""Set the weak boundaries (=normal fluxes) for the fluid problem.
|
|
|
|
|
|
Keyword arguments:
|
|
|
tag -- physical tag (or list of tags), set in the mesh.geo file, of the wall boundaries
|
|
|
velocity -- the velocity vector if imposed (callback or number))
|
|
|
pressure -- the pressure value if imposed (callback or number)
|
|
|
porosity -- the volume fraction of fluid at aperture (work in progress - should be one)
|
|
|
concentration -- the volume fraction of the first continuous phase
|
|
|
|
|
|
Raises:
|
|
|
NameError -- If the specified porosity outside the boundary is too small
|
|
|
NameError -- If velocity and pressure are not specified or if they are both specified at the open boundary. It should be one or the other
|
|
|
NameError -- if the dimension of the velocity vector is not equal to the physical dimension of the problem
|
|
|
|
|
|
"""
|
|
|
fluid.set_wall_boundary("Bottom")
|
|
|
fluid.set_wall_boundary("Lateral")
|
|
|
fluid.set_wall_boundary("Top")
|
|
|
```
|
|
|
* Couple the fluid and the granular phases. This is done by setting the mechanical properties (the delassus operator and the volume), the positions and velocities and the contact forces of the grains.
|
|
|
```python
|
|
|
fluid.set_particles(p.delassus(), p.volume(), p.position(), p.velocity(), p.contact_forces())
|
|
|
```
|
|
|
|
|
|
For now, the open boundary condition only allow to specify velocity and concentration if two continuous phases are considered (inflow) or pressure and concentration if two continuous phases are considered (outflow).
|
|
|
|
|
|
5. Coupling between fluid and solid is mainly based on the detection of the mesh cells in which grains are. Computing fluid fraction in a cell or evaluating the fluid velocity at the grain position both imply to know where the grains are in the fluid. The tree structure based on mesh cells is used to locate them.
|
|
|
|
|
|
```python
|
|
|
fluid.set_particles(p.mass(), p.volume(), p.position(), p.velocity(),p.contact_forces(),init=True)
|
|
|
```
|
|
|
|
|
|
6. At this step, the initial state is completely defined and all the variables and parametres have been created. Then the computation can start. The [computational loop](https://git.immc.ucl.ac.be/fluidparticles/migflow/blob/master/testcases/depot-2d/depot.py#L117) contains the time integration method solving the fluid and the grains phase:
|
|
|
|
|
|
* Fluid equations solving
|
|
|
```python
|
|
|
while t < tEnd :
|
|
|
time_integration.iterate(fluid, p, dt, min_nsub=5, external_particles_forces=G)
|
|
|
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
|
|
|
G = p.mass()*g
|
|
|
mass = np.pi*p.r()**2*rhop
|
|
|
```
|
|
|
The complete documentation of the function and its parameters are given:
|
|
|
```python
|
... | ... | |