CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

Interpolation on a curved patch

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 5, 2012, 22:58
Default Interpolation on a curved patch
  #1
Senior Member
 
fumiya's Avatar
 
Fumiya Nozaki
Join Date: Jun 2010
Location: Yokohama, Japan
Posts: 266
Blog Entries: 1
Rep Power: 19
fumiya is on a distinguished road
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
fumiya is offline   Reply With Quote

Old   September 6, 2012, 04:29
Default
  #2
Super Moderator
 
bigphil's Avatar
 
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,097
Rep Power: 34
bigphil will become famous soon enoughbigphil will become famous soon enough
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
bigphil is offline   Reply With Quote

Old   September 11, 2012, 07:29
Default
  #3
Senior Member
 
fumiya's Avatar
 
Fumiya Nozaki
Join Date: Jun 2010
Location: Yokohama, Japan
Posts: 266
Blog Entries: 1
Rep Power: 19
fumiya is on a distinguished road
Hi Philip,

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

Thanks,
Fumiya
fumiya is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Commercial meshers] Using starToFoam clo OpenFOAM Meshing & Mesh Conversion 33 September 26, 2012 05:04
[Other] StarToFoam error Kart OpenFOAM Meshing & Mesh Conversion 1 February 4, 2010 05:38
CheckMeshbs errors ivanyao OpenFOAM Running, Solving & CFD 2 March 11, 2009 03:34
[Gmsh] Import gmsh msh to Foam adorean OpenFOAM Meshing & Mesh Conversion 24 April 27, 2005 09:19
Multicomponent fluid Andrea CFX 2 October 11, 2004 06:12


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