Walls

Walls are used to represent time-independent stationary boundary conditions for the flows. They are described in the form of a signed distance function, such that a zero-level isosurface defines the wall surface. No slip and no through boundary conditions are enforced on that surface by bouncing the particles off the wall surface.

In order to prevent undesired density oscillations near the walls, so called frozen particles are used. These non-moving particles reside inside the walls and interact with the regular liquid particles. If the density and distribution of the frozen particles is the same as of the corresponding liquid particles, the density oscillations in the liquid in proximity of the wall is minimal. The frozen particles have to be created based on the wall in the beginning of the simulation, see Mirheo.makeFrozenWallParticles.

In the beginning of the simulation all the particles defined in the simulation (even not attached to the wall by Mirheo) will be checked against all of the walls. Those inside the wall as well as objects partly inside the wall will be deleted. The only exception are the frozen PVs, created by the Mirheo.makeFrozenWallParticles or the PVs manually set to be treated as frozen by Wall.attachFrozenParticles

Summary

Box() Rectangular cuboid wall with edges aligned with the coordinate axes.
Cylinder() Cylindrical infinitely stretching wall, the main axis is aligned along OX or OY or OZ
MovingPlane() Planar wall that is moving along itself with constant velocity.
OscillatingPlane() Planar wall that is moving along itself with periodically changing velocity:
Plane() Planar infinitely stretching wall.
RotatingCylinder() Cylindrical wall rotating with constant angular velocity along its axis.
SDF() Arbitrary Signed Distance Function (SDF) defined in the simulation domain on a regular Cartesian grid.
Sphere() Spherical wall.
Wall() Base wall class.

Details

class Box

Bases: mmirheo.Walls.Wall

Rectangular cuboid wall with edges aligned with the coordinate axes.

__init__(name: str, low: real3, high: real3, inside: bool=False) → None
Parameters:
  • name – name of the wall
  • low – lower corner of the box
  • high – higher corner of the box
  • inside – whether the domain is inside the box or outside of it
attachFrozenParticles(arg0: ParticleVectors.ParticleVector) → None

Let the wall know that the following ParticleVector should be treated as frozen. As a result, its particles will not be removed from the inside of the wall.

class Cylinder

Bases: mmirheo.Walls.Wall

Cylindrical infinitely stretching wall, the main axis is aligned along OX or OY or OZ

__init__(name: str, center: real2, radius: float, axis: str, inside: bool=False) → None
Parameters:
  • name – name of the wall
  • center – point that belongs to the cylinder axis projected along that axis
  • radius – cylinder radius
  • axis – direction of cylinder axis, valid values are “x”, “y” or “z”
  • inside – whether the domain is inside the cylinder or outside of it
attachFrozenParticles(arg0: ParticleVectors.ParticleVector) → None

Let the wall know that the following ParticleVector should be treated as frozen. As a result, its particles will not be removed from the inside of the wall.

class MovingPlane

Bases: mmirheo.Walls.Wall

Planar wall that is moving along itself with constant velocity. Can be used to produce Couette velocity profile in combination with The boundary conditions on such wall are no-through and constant velocity (specified).

__init__(name: str, normal: real3, pointThrough: real3, velocity: real3) → None
Parameters:
  • name – name of the wall
  • normal – wall normal, pointing inside the wall
  • pointThrough – point that belongs to the plane
  • velocity – wall velocity, should be orthogonal to the normal
attachFrozenParticles(arg0: ParticleVectors.ParticleVector) → None

Let the wall know that the following ParticleVector should be treated as frozen. As a result, its particles will not be removed from the inside of the wall.

class OscillatingPlane

Bases: mmirheo.Walls.Wall

Planar wall that is moving along itself with periodically changing velocity:

\[\mathbf{u}(t) = cos(2*\pi * t / T);\]
__init__(name: str, normal: real3, pointThrough: real3, velocity: real3, period: float) → None
Parameters:
  • name – name of the wall
  • normal – wall normal, pointing inside the wall
  • pointThrough – point that belongs to the plane
  • velocity – velocity amplitude, should be orthogonal to the normal
  • period – oscillation period dpd time units
attachFrozenParticles(arg0: ParticleVectors.ParticleVector) → None

Let the wall know that the following ParticleVector should be treated as frozen. As a result, its particles will not be removed from the inside of the wall.

class Plane

Bases: mmirheo.Walls.Wall

Planar infinitely stretching wall. Inside is determined by the normal direction .

__init__(name: str, normal: real3, pointThrough: real3) → None
Parameters:
  • name – name of the wall
  • normal – wall normal, pointing inside the wall
  • pointThrough – point that belongs to the plane
attachFrozenParticles(arg0: ParticleVectors.ParticleVector) → None

Let the wall know that the following ParticleVector should be treated as frozen. As a result, its particles will not be removed from the inside of the wall.

class RotatingCylinder

Bases: mmirheo.Walls.Wall

Cylindrical wall rotating with constant angular velocity along its axis.

__init__(name: str, center: real2, radius: float, axis: str, omega: float, inside: bool=False) → None
Parameters:
  • name – name of the wall
  • center – point that belongs to the cylinder axis projected along that axis
  • radius – cylinder radius
  • axis – direction of cylinder axis, valid values are “x”, “y” or “z”
  • omega – angular velocity of rotation along the cylinder axis
  • inside – whether the domain is inside the cylinder or outside of it
attachFrozenParticles(arg0: ParticleVectors.ParticleVector) → None

Let the wall know that the following ParticleVector should be treated as frozen. As a result, its particles will not be removed from the inside of the wall.

class SDF

Bases: mmirheo.Walls.Wall

Arbitrary Signed Distance Function (SDF) defined in the simulation domain on a regular Cartesian grid. Requires the SDF data from a custom format .sdf file, that has the following structure:

The first two lines (header) contain the meta-data: three real numbers separated by spaces govern the size of the domain where the SDF is defined, and next three integer numbers (\(Nx\,\,Ny\,\,Nz\)) define the resolution. Next the \(Nx \times Ny \times Nz\) single precision real point values are written (in binary representation). The elements are ordered following the C convention (the x axis is the fast running index).

Negative SDF values correspond to the domain, and positive – to the inside of the wall. The boundary is defined by the zero-level isosurface.

__init__(name: str, sdfFilename: str, h: real3=real3(0.25, 0.25, 0.25), margin: real3=real3(5.0, 5.0, 5.0)) → None
Parameters:
  • name – name of the wall
  • sdfFilename – name of the .sdf file
  • h – resolution of the resampled SDF. In order to have a more accurate SDF representation, the initial function is resampled on a finer grid. The lower this value is, the more accurate the wall will be represented, however, the more memory it will consume and the slower the execution will be.
  • margin – Additional margin to store on each rank. This is used to e.g. bounce-back particles that are on the local rank but outside the local domain.
attachFrozenParticles(arg0: ParticleVectors.ParticleVector) → None

Let the wall know that the following ParticleVector should be treated as frozen. As a result, its particles will not be removed from the inside of the wall.

class Sphere

Bases: mmirheo.Walls.Wall

Spherical wall.

__init__(name: str, center: real3, radius: float, inside: bool=False) → None
Parameters:
  • name – name of the wall
  • center – sphere center
  • radius – sphere radius
  • inside – whether the domain is inside the sphere or outside of it
attachFrozenParticles(arg0: ParticleVectors.ParticleVector) → None

Let the wall know that the following ParticleVector should be treated as frozen. As a result, its particles will not be removed from the inside of the wall.

class Wall

Bases: object

Base wall class.

__init__()

Initialize self. See help(type(self)) for accurate signature.

attachFrozenParticles(arg0: ParticleVectors.ParticleVector) → None

Let the wall know that the following ParticleVector should be treated as frozen. As a result, its particles will not be removed from the inside of the wall.