CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Pre-Processing (
-   -   Surface interpolation of tensors (

andebjor August 15, 2007 05:29

I am trying to interpolate a t
I am trying to interpolate a tensor that is used in the laplacian.

The first problem I encountered was that the weight in the interpolation is a scalar, which limits me to interpolate all elements in the tensor in the same way, something that is too limiting for my application.

The second problem I discovered was that it is in fact not possible to specify your own interpolation scheme for tensors, only scalars.

The questions are as follows:

1. Am I correct in the above?

2. Does anyone have a solution to the above problems, or lacking that, pointers on how to go about to solve them?


hjasak August 22, 2007 12:54

Hello Bjorn, 1) You are cor
Hello Bjorn,

1) You are correct in the above: the standard interpolation classes will interpolate all components of a vector or a tensor in an identical manner. Doing anything else would probably violate Galilean invariance, but ultimately that depends on your model.

2) Solutions are easy. Basically, create a surfaceTensorField of any kind you wish and create a number of interpolators (I take it some elements of your tensor will be bounded and others won't).

You can now use the .component(...) function to access components one at a time and a .replace(...) function to put the result into the surface field component by component.

This should allow you to perform the interpolation in any way you can imagine.



andebjor August 23, 2007 03:08

Thanks for your answer. You
Thanks for your answer.

Your solution is close to what I ended up doing. I simply copied the interpolate function and added a loop over the components and calculated the weights locally in the function.


All times are GMT -4. The time now is 07:44.