AQUAgpusph 4.1.2
Loading...
Searching...
No Matches
Functions
Mirror.cl File Reference

Mirroring process for the symmetry boundary condition. More...

#include "resources/Scripts/types/types.h"
Include dependency graph for Mirror.cl:

Functions

__kernel void drop (__global int *imove, __global vec *r, unsigned int N, vec symmetry_r, vec symmetry_n, vec domain_max)
 Remove the particles at the other side of the mirror.
 
__kernel void detect (const __global int *imove, const __global vec *r_in, __global unsigned int *imirror, unsigned int N, vec symmetry_r, vec symmetry_n)
 Detect the particles to be mirrored.
 
vec_xyz reflection (vec_xyz u, vec_xyz n)
 
__kernel void feed (__global int *imove, __global int *iset, __global unsigned int *imirror, __global unsigned int *imirror_invperm, __global float *m, __global vec *normal, __global vec *tangent, __global vec *r_in, __global vec *u_in, __global vec *dudt_in, __global float *rho_in, __global float *drhodt_in, unsigned int N, unsigned int nbuffer, vec symmetry_r, vec symmetry_n)
 Mirror the particles marked with a flag imirror = 1.
 

Detailed Description

Mirroring process for the symmetry boundary condition.

Function Documentation

◆ detect()

__kernel void detect ( const __global int *  imove,
const __global vec r_in,
__global unsigned int *  imirror,
unsigned int  N,
vec  symmetry_r,
vec  symmetry_n 
)

Detect the particles to be mirrored.

The mirroring particles (the ones close enough to the symmetry plane) will be marked with imirror = 1.

Parameters
imoveMoving flags.
  • imove > 0 for regular fluid particles.
  • imove = 0 for sensors.
  • imove < 0 for boundary elements/particles.
r_inPosition \( \mathbf{r} \).
imirror0 if the particle has not been mirrored, 1 otherwise.
NNumber of particles.
symmetry_rPosition of the symmetry plane.
symmetry_nNormal of the symmetry plane. It is assumed as normalized.

◆ drop()

__kernel void drop ( __global int *  imove,
__global vec r,
unsigned int  N,
vec  symmetry_r,
vec  symmetry_n,
vec  domain_max 
)

Remove the particles at the other side of the mirror.

Parameters
imoveMoving flags.
  • imove > 0 for regular fluid particles.
  • imove = 0 for sensors.
  • imove < 0 for boundary elements/particles.
rPosition \( \mathbf{r} \).
NNumber of particles.
symmetry_rPosition of the symmetry plane.
symmetry_nNormal of the symmetry plane. It is assumed as normalized.
domain_maxTop-right-back corner of the computational domain.

◆ feed()

__kernel void feed ( __global int *  imove,
__global int *  iset,
__global unsigned int *  imirror,
__global unsigned int *  imirror_invperm,
__global float *  m,
__global vec normal,
__global vec tangent,
__global vec r_in,
__global vec u_in,
__global vec dudt_in,
__global float *  rho_in,
__global float *  drhodt_in,
unsigned int  N,
unsigned int  nbuffer,
vec  symmetry_r,
vec  symmetry_n 
)

Mirror the particles marked with a flag imirror = 1.

Parameters
imoveMoving flags.
  • imove > 0 for regular fluid/solid particles.
  • imove = 0 for sensors.
  • imove < 0 for boundary elements/particles.
isetIndex of the set of particles.
imirror0 if the particle should not be mirrored, 1 otherwise.
imirror_invpermPermutation to find the index of the particle in the list of particles to become split.
mMass, \( m \).
normalNormal, \( \mathbf{n} \).
tangentTangent, \( \mathbf{t} \).
r_inPosition \( \mathbf{r} \).
u_inVelocity \( \mathbf{u} \).
dudt_inVelocity rate of change \( \frac{d \mathbf{u}}{d t} \).
rho_inDensity \( \rho \).
drhodt_inDensity rate of change \( \frac{d \rho}{d t} \).
NNumber of particles.
nbufferNumber of available buffer particles.
symmetry_rPosition of the symmetry plane.
symmetry_nNormal of the symmetry plane. It is assumed as normalized.
Here is the call graph for this function:

◆ reflection()

vec_xyz reflection ( vec_xyz  u,
vec_xyz  n 
)

Reflection vector.

The deflection vector is defined as follows:

\( \mathbf{v}(\mathbf{u}, \mathbf{n}) = -2 \left( \mathbf{u} \cdot \mathbf{n} \right) \mathbf{n} \)

where \(\mathbf{u}\) is the vector to become deflected, \(\mathbf{n}\) is the reflection plane normal, and \(\mathbf{v}\) is the deflection vector, which added to the original vector returns its reflected version.

Note
The input vector should be relative to the symmetry plane. That's important in case of position vectors, from which an arbitrary point of the plane should be substracted