|
Many test cases are given to help users to understand how to use the different features offered by the MigFlow Software. Test cases are in the ~/MigFlow/testcases directory. They are given to provide users basic tools in order to build computation script for their own applications.
|
|
Many test cases are given to help users to understand how to use the different features offered by the MigFlow Software. Test cases are in the ~/MigFlow/testcases directory. They are given to provide users basic tools in order to build computation scripts for their own applications.
|
|
|
|
|
|
### Test Cases Structure
|
|
### Test Cases Structure
|
|
|
|
|
|
Let us illustrate the structure of the executable python files with a two dimensional deposit of grains in fluid. This test case is provided in the [testcases/depo-2d/dep.py](https://git.immc.ucl.ac.be/fluidparticles/migflow/blob/oneFluid/testcases/depot-2d/dep.py) file.
|
|
Let us illustrate the structure of the executable python files with a two dimensional deposit of grains in a fluid. This test case is provided in the [testcases/depo-2d/dep.py](https://git.immc.ucl.ac.be/fluidparticles/migflow/blob/oneFluid/testcases/depot-2d/dep.py) file.
|
|
|
|
|
|
Some steps have to be followed in order to define properly the application you want to solve with the MigFlow Software.
|
|
Some steps have to be followed in order to properly define the application you want to solve with the MigFlow Software.
|
|
|
|
|
|
1. Set the problem parametres
|
|
1. Set the problem parametres
|
|
In application you have to define a lot of variables that are used to define:
|
|
In an application, many variables are required to define :
|
|
* [fluid and grains properties](https://git.immc.ucl.ac.be/fluidparticles/migflow/blob/oneFluid/testcases/depot-2d/depot.py#L69)
|
|
* [fluid and grains properties](https://git.immc.ucl.ac.be/fluidparticles/migflow/blob/oneFluid/testcases/depot-2d/depot.py#L69)
|
|
```python
|
|
```python
|
|
g = -9.81 # gravity
|
|
g = -9.81 # gravity
|
... | @@ -30,9 +30,9 @@ lx = 4e-1 # grains area widht |
... | @@ -30,9 +30,9 @@ lx = 4e-1 # grains area widht |
|
H = 1.2 # domain height
|
|
H = 1.2 # domain height
|
|
```
|
|
```
|
|
|
|
|
|
2. Define the positions of the grains matrix and create grains at these positions
|
|
2. Define the matrix of the grains positions and actually create the grains at these positions
|
|
|
|
|
|
* Setting the initial situation require to define the initial positions of the grains. In test cases, this is often achieved by defining a [function](https://git.immc.ucl.ac.be/fluidparticles/migflow/blob/oneFluid/testcases/depot-2d/depot.py#L37) in which centre positions are defined. The arguments of the function are related to the grains properties and the grains area geometry defined previously. The physical surfaces defined in your mesh.geo file are used to specify the solid boundaries for the grains. Grain objects are created locally and all the information about the innitial condition of the grains are written in an output file.
|
|
* Setting the initial situation requires to define the initial positions of the grains. In test cases, this is often achieved by defining a [function](https://git.immc.ucl.ac.be/fluidparticles/migflow/blob/oneFluid/testcases/depot-2d/depot.py#L37) in which the positions of the centres are defined. The arguments of the function are related to the grains properties and the grains area geometry defined previously. The physical surfaces defined in your mesh.geo file are used to specify the solid boundaries for the grains. Grain objects are created locally and all the information about the initial conditions of the grains are written in an output file.
|
|
```python
|
|
```python
|
|
def genInitialPosition(filename, r, H, ly, lx, rhop) :
|
|
def genInitialPosition(filename, r, H, ly, lx, rhop) :
|
|
"""Set all the particles centre positions and create the particles objects to add in the computing structure
|
|
"""Set all the particles centre positions and create the particles objects to add in the computing structure
|
... | @@ -91,7 +91,7 @@ fluid.set_strong_boundary(Physical boundary tag, field variable item, field valu |
... | @@ -91,7 +91,7 @@ fluid.set_strong_boundary(Physical boundary tag, field variable item, field valu |
|
fluid.set_weak_boundary(Physical boundary tag, Weak boundary type)
|
|
fluid.set_weak_boundary(Physical boundary tag, Weak boundary type)
|
|
```
|
|
```
|
|
|
|
|
|
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 imply to know where the grains are in the fluid. The tree structure based on mesh cells is used to locate the grains in the fluid.
|
|
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
|
|
```python
|
|
fluid.set_particles(p.mass(), p.volume(), p.position(), p.velocity())
|
|
fluid.set_particles(p.mass(), p.volume(), p.position(), p.velocity())
|
... | @@ -116,7 +116,7 @@ for i in range(nsub) : |
... | @@ -116,7 +116,7 @@ for i in range(nsub) : |
|
p.iterate(dt/nsub, forces, tol)
|
|
p.iterate(dt/nsub, forces, tol)
|
|
|
|
|
|
```
|
|
```
|
|
The loop also contained instruction to write output files. It is important to note that after moving the grains in computational loop you have to use the _set_particles()_ function to search the new location og the grains in the mesh.
|
|
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.
|
|
|
|
|
|
|
|
|
|
__The handy test cases are:__
|
|
__The handy test cases are:__
|
... | | ... | |