|
[Sponsors] |
November 4, 2016, 16:56 |
Interpolation on staggered grid
|
#1 |
New Member
Join Date: Nov 2016
Posts: 4
Rep Power: 10 |
Hi,
I'm a beginner trying to implement a basic/trivial 2D PIC simulation. I have a question regarding bilinear interpolation of a quantity (e.g. velocities) on staggered grid (the grid is on the picture below); I use two 2D arrays to store the velocities - one array for x-component and the other for y-component. One of the steps in the PIC algorithm is transfering velocities from particles to grid(s). Let's consider transfering the x-component of velocity from particles to the x-grid: for each particle I need to find 4 surrounding staggered points (green bars in the image above) to perform the (inverse) bilinear interpolation. Here's my question: how do I interpolate the x-velocity on the top and bottom boundary cells where there are no staggered points (green bars) below my particle (blue dot in the image)? How would you interpolate the blue particle's x-velocity component to the grid in the image above? My attempts to solution:
|
|
November 4, 2016, 17:19 |
|
#2 | |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,896
Rep Power: 73 |
Quote:
Consider that you know the velocity on the boundary... for example, if the boundary is a wall and you work with viscous flows, you have zero x-component velocity so that you can add two values in the black nodes and using the bi-linear interpolation taking into account that you have a rectangular grid the height being a half of the upper. |
||
November 4, 2016, 19:42 |
|
#3 | ||
New Member
Join Date: Nov 2016
Posts: 4
Rep Power: 10 |
Quote:
I'm sorry, but I think I don't understand the following part of your answer: Quote:
Another question: Should the 12 boundary grid-cells be marked as a wall? Then there could not be a particle in the 12 boundary cells and thus there would always be some green bars below my particle to store the velocity on (that would mean that particles are allowed only in the 4 cells inside the grid from the image). Is such an approach correct? |
|||
November 5, 2016, 04:26 |
|
#4 |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,896
Rep Power: 73 |
Yes, you can use the two lower black nodes (lower boundary) to complete the interpolation region. Setting wall or not as BC depends on your physical problem, is not a matter of interpolation.
|
|
November 5, 2016, 06:28 |
|
#5 | |
New Member
Join Date: Nov 2016
Posts: 4
Rep Power: 10 |
Quote:
given a 4x4 array of cells (like in the image) I create:
The 2 added rows of black nodes at the top and bottom rows for x-component grid (in the case of the y-component-grid it'd be the leftmost and the rightmost columns of black nodes) are used ONLY for interpolation when transfering velocities from particles to grid and in the opposite direction. When solving the Poisson equation to get divergence-free field, I'd ignore the 2 rows of black nodes and I'd use just the green bars. Is the above right? |
||
November 5, 2016, 07:02 |
|
#6 |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,896
Rep Power: 73 |
The pressure equation requires only red and green values for computing the source term but it is solved on the centre of the cells
|
|
Tags |
implementation, pic, staggered grid |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Discretization of mass conservation equation in a 2D staggered grid | kiwiguigou | Main CFD Forum | 4 | April 16, 2016 16:57 |
Face interpolation in a quadtree grid (or non-conformal grid) in openfoam | banji | OpenFOAM Programming & Development | 2 | October 31, 2015 15:13 |
SIMPLE co-located grid vs Staggered grid | Thamali | OpenFOAM Pre-Processing | 2 | September 2, 2013 01:59 |
Grid Independent Solution | Chuck Leakeas | Main CFD Forum | 2 | May 26, 2000 12:18 |
Incompressible flow solver (staggered grid) | J. Ehrhard | Main CFD Forum | 1 | October 8, 1998 20:47 |