CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Problem with InterpolationScheme on cell faces? (https://www.cfd-online.com/Forums/openfoam-programming-development/137511-problem-interpolationscheme-cell-faces.html)

gary7 June 18, 2014 01:00

Problem with InterpolationScheme on cell faces?
 
Dear All,

I'm using an interpolation on the fly on a point in my field As:

Code:

autoPtr<interpolation<vector> > Uinterpol =interpolation<vector>::New(interpolationScheme, U);
vector pos(200,40,200);
label cellI = mesh_.findCell(pos);
vector Ui = Uinterpol_->interpolate(pos, cellI);


As long as the ponit (pos here) is on a cell face, If I choose interpolationScheme either "cellPoint" or "cellPointFace" it'll give me wrong interpolated value at the point, however, choosing "cell" works but the problem is that using "cell" is not accurate as it assumes constant value in each cell equal to cell center.
I was wondering how I can make the "cellPoint" or "cellPointFace" to work when the point may lay on the cell face?
I'd appreciate any input.

Cheers,
Kasra.

gary7 June 19, 2014 10:40

I found out that the problem is not just on cell faces it happens even inside a cell. if I choose "cell" as interpolationScheme, I'll get Ui which is a rough estimate at the desired point in the cell, since it assumes cell center value constant over cell. But if I use any other schemes e.g. "cellPoint", "cellPointFace", "ponitMVC", ... I'll get wrong values to have an idea let me give you an example: the position I have given in previous post, is for a point which is on the hexagonal cell vertex of a cell next to the top boundary, i.e. the top wall of couette flow (moving wall being a y-plane at y=41 ) which moving at velocity of V=(1,0,0), so the value at the specified point should be something close to (1,0,0) here are the values that I get using different interpolation schemes:

  • "cell" ----> (0.920479, -5.41529e-11, 2.61042e-13)
  • "cellPoint" ----> (0.5, 0, 0)
  • "cellPointFace" ----> (0.5, 0, 0)


Or if I use pos(200,40.75,200) then it's the same result for "cell" (which is right as it's still in the same cell) but for the rest it's:

  • "cellPoint" ----> (0.75, 0, 0)
  • "cellPointFace" ----> (0.75, 0, 0)


I have no clue what's happening and how to solve this issue:/. I'd be really appreciate it if you can help me to solve this issue.

Cheers,
Kasra.


All times are GMT -4. The time now is 11:01.