CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Interpolation on a curved patch (http://www.cfd-online.com/Forums/openfoam/106705-interpolation-curved-patch.html)

fumiya September 5, 2012 21:58

Interpolation on a curved patch
 
Hi,

I want to calculate values at points on a patch by interpolation
using only the boundaryField values (not using internalField values at all).
My target patch is a *curved* surface (not a plane) and the values at
the nodal points on this patch are known.

Is it possible to do above interpolation in OpenFOAM?
If so, which utility should I use?

Regards,
Fumiya

bigphil September 6, 2012 03:29

Hi Fumiya,

you could use the primitivePatchInterpolation class. This class allows interpolation of data from patch face centre to patch points (and vice-versa).

Here is an example:
Code:

//- find label of patch
label patchID = mesh.boundaryMesh().findPatchID("patchOfInterest");
if(patchID == -1)
{
  FatalError << "Patch not found!" << exit(FatalaError);
}

//- create interpolator
primitivePatchInterpolation myPatchInterpolator(mesh.boundaryMesh()[patchID]);

//- perform interpolation of vectorField U from patch faces to points
vectorField patchUAtPoints = myPatchInterpolator.faceToPointInterpolate<vector>
      (
      U.boundaryField()[patchID]
      );

Place the line #include "primitivePatchInterpolation.H" at the top of your program under #included "fvCFD.H".

The primitivePatchInterpolation class uses the inverse-distance method to interpolate the data, so it is quite accurate on orthogonal grids but can have errors on meshes with considerably skewed/non-orthgonal faces/cells.

Hope it helps,
Philip

fumiya September 11, 2012 06:29

Hi Philip,

Thank you for your information. I'll give it a try.

Thanks,
Fumiya


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