... | @@ -33,7 +33,7 @@ p.load_msh_boundaries("mesh.msh", ["Top", "Lateral","Bottom"]) |
... | @@ -33,7 +33,7 @@ p.load_msh_boundaries("mesh.msh", ["Top", "Lateral","Bottom"]) |
|
|
|
|
|
```
|
|
```
|
|
|
|
|
|
* Add the grains at their initial positions. In most test cases, this is achieved by defining a [function](https://git.immc.ucl.ac.be/fluidparticles/migflow/blob/master/testcases/depot-2d/depot.py#L37) in which the positions of the centres are defined. The [arguments](https://git.immc.ucl.ac.be/fluidparticles/migflow/blob/master/testcases/depot-2d/depot.py#L67) of the function correspond to the dimension of the regular grid on which the grains will be placed.
|
|
* Define the initial positions of the grains and add them to the particle problem. In most test cases, the positions definition is achieved by defining a [function](https://git.immc.ucl.ac.be/fluidparticles/migflow/blob/master/testcases/depot-2d/depot.py#L37) in which the positions of the centres are defined. The [arguments](https://git.immc.ucl.ac.be/fluidparticles/migflow/blob/master/testcases/depot-2d/depot.py#L67) of the function correspond to the dimension of the regular grid on which the grains will be placed. Once this is done, the grains are added to the particle problem with ```python add_particle()```
|
|
```python
|
|
```python
|
|
def gen_rect(origin, w, h, step):
|
|
def gen_rect(origin, w, h, step):
|
|
""" Generate coordinates on a rectangular grid
|
|
""" Generate coordinates on a rectangular grid
|
... | @@ -48,10 +48,6 @@ def gen_rect(origin, w, h, step): |
... | @@ -48,10 +48,6 @@ def gen_rect(origin, w, h, step): |
|
y = np.arange(-step, -h+step, -2*step) + origin[1]
|
|
y = np.arange(-step, -h+step, -2*step) + origin[1]
|
|
x, y = np.meshgrid(x,y)
|
|
x, y = np.meshgrid(x,y)
|
|
return x.reshape(-1), y.reshape(-1)
|
|
return x.reshape(-1), y.reshape(-1)
|
|
|
|
|
|
```
|
|
|
|
The grains are then added to the particle problem as follows:
|
|
|
|
```python
|
|
|
|
x, y = gen_rect([0, H/2], w, h, r)
|
|
x, y = gen_rect([0, H/2], w, h, r)
|
|
for xi,yi in zip(x,y):
|
|
for xi,yi in zip(x,y):
|
|
p.add_particle((xi, yi), r, r**2*np.pi*rhop)
|
|
p.add_particle((xi, yi), r, r**2*np.pi*rhop)
|
... | @@ -59,6 +55,7 @@ for xi,yi in zip(x,y): |
... | @@ -59,6 +55,7 @@ for xi,yi in zip(x,y): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3. Create the fluid structure and specify the computational domain (i.e. give the mesh to the fluid class). At this step, all the variables (velocity, pressure...) of the fluid problem and the properties of the fluid are stored in the fluid structure. The arguments for the fluid structure builder are the dimension of the problem, the gravity, the dynamic viscosity and the density of the fluid.
|
|
3. Create the fluid structure and specify the computational domain (i.e. give the mesh to the fluid class). At this step, all the variables (velocity, pressure...) of the fluid problem and the properties of the fluid are stored in the fluid structure. The arguments for the fluid structure builder are the dimension of the problem, the gravity, the dynamic viscosity and the density of the fluid.
|
|
```python
|
|
```python
|
|
fluid = fluid.FluidProblem(2,g,[nu*rho],[rho])
|
|
fluid = fluid.FluidProblem(2,g,[nu*rho],[rho])
|
... | | ... | |