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

Interpolation between faces and points of a polyPatch

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By hjasak

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 2, 2005, 15:49
Default Hello, for the calculation
  #1
Senior Member
 
Markus Hartinger
Join Date: Mar 2009
Posts: 102
Rep Power: 17
hartinger is on a distinguished road
Hello,

for the calculation of the movement of some boundary points I am doing some calulations on a polyPatch, and I would like to store that data(scalar) somewhere.
I guess, a "surfaceScalarField" would be appropriate, although I only need to store the data for that patch. A "surfaceScalarField" stores the data at the face centres, right?

From there I'd like to interplate those values to the points of the boundary and store that data as well. What is the class to use to store data in boundary points? And how do I do the interpolation, if it's already implemented?

Thank you
markus
hartinger is offline   Reply With Quote

Old   May 2, 2005, 17:36
Default If you are storing data for a
  #2
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 22
henry is on a distinguished road
If you are storing data for a single patch and are not concerned about the patch field type fvPatchField should be used for face-centre data and pointPatchField for vertex data. Both are templated on the type but there are also convenient typedefs for the common types e.g. fvPatchScalarField and pointPatchScalarField.
henry is offline   Reply With Quote

Old   May 3, 2005, 08:55
Default If I am using a fvPatchScalarF
  #3
Senior Member
 
Markus Hartinger
Join Date: Mar 2009
Posts: 102
Rep Power: 17
hartinger is on a distinguished road
If I am using a fvPatchScalarField it would be constructed with a fvPatch and an internal Field. Where do I get the internal Field from and why does it need one anyways?
thanks
markus
hartinger is offline   Reply With Quote

Old   May 3, 2005, 09:00
Default A patch field needs an interna
  #4
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 22
henry is on a distinguished road
A patch field needs an internal field from which to evaluate the boundary condition. If you do not have a corresponding internal field then you probably should be using scalarField rather than fvPatchScalarField to store your patch data.
henry is offline   Reply With Quote

Old   May 3, 2005, 09:37
Default Ah, I don't have an correspond
  #5
Senior Member
 
Markus Hartinger
Join Date: Mar 2009
Posts: 102
Rep Power: 17
hartinger is on a distinguished road
Ah, I don't have an corresponding internal field, then I'll use a scalarField for the face centered values.
I could use another scalarField for the corresponding point values and do the interpolation myself. But I would obviously prefer an existing solution for the interpolation. Is there something?
thanks
markus
hartinger is offline   Reply With Quote

Old   May 3, 2005, 09:41
Default All done for you and ready to
  #6
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33
hjasak will become famous soon enough
All done for you and ready to use - isn't FOAM wonderful! :-)

Make an object of type primitivePatchInterpolation (or templated PrimitivePatchInterpolation). The functions are in:

~/OpenFOAM/OpenFOAM-1.1/src/OpenFOAM/lnInclude/PrimitivePatchInterpolation.H

and you've got:

//- Interpolate from faces to points
template<class>
tmp<field<type> > faceToPointInterpolate
(
const Field<type>& ff
) const;


//- Interpolate from points to faces
template<class>
tmp<field<type> > pointToFaceInterpolate
(
const Field<type>& pf
) const;

//- Interpolate from faces to edges
template<class>
tmp<field<type> > faceToEdgeInterpolate
(
const Field<type>& ff
) const;

Enjoy (in enery sense of the word!),

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   May 3, 2005, 10:24
Default I'll try that thank you mark
  #7
Senior Member
 
Markus Hartinger
Join Date: Mar 2009
Posts: 102
Rep Power: 17
hartinger is on a distinguished road
I'll try that
thank you
markus
hartinger is offline   Reply With Quote

Old   January 27, 2015, 06:33
Default
  #8
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Quote:
Originally Posted by hjasak View Post
//- Interpolate from faces to points
template<class>
tmp<field<type> > faceToPointInterpolate
(
const Field<type>& ff
) const;
Hello Jasak,

just one question. Is there some publication of how to interpolate from faces to points? Otherwise I will check it out in the source code but a reference would be very nice.

Kind regards
Tobi
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   January 27, 2015, 18:55
Default
  #9
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hello all, I figured it out myself from the source code
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   March 3, 2016, 17:01
Default
  #10
Senior Member
 
Join Date: Jan 2010
Location: Stuttgart
Posts: 150
Rep Power: 16
Chrisi1984 is on a distinguished road
Hi,

can you please explain how to do the interpolation?

Kind regards
Chrisi
Chrisi1984 is offline   Reply With Quote

Old   March 3, 2016, 17:35
Default
  #11
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Yes, o can publish it in monday
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   March 6, 2016, 11:24
Default
  #12
Senior Member
 
Join Date: Jan 2010
Location: Stuttgart
Posts: 150
Rep Power: 16
Chrisi1984 is on a distinguished road
Oh that's nice!

So my idea is to write a utility that interpolates a volScalarField to the patches (bc: zeroGradient) writing out the node values on every patch.

Kind regards
Chrisi
Chrisi1984 is offline   Reply With Quote

Old   March 7, 2016, 14:08
Default
  #13
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi Chris and all other,

here you find the face-to-point interpolation that is used by OpenFOAM: http://holzmann-cfd.de/index.php/en/publications
__________________
Keep foaming,
Tobias Holzmann
Tobi 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
Field interpolation in mesh points code jzlam OpenFOAM Post-Processing 2 December 14, 2010 17:48
interpolation on faces and wall boundaries ca Main CFD Forum 0 September 2, 2008 13:42
[Technical] Mapping cell faces to other cell faces doug OpenFOAM Meshing & Mesh Conversion 5 March 30, 2007 03:43
Mesh to points cells faces and boundaries files billy OpenFOAM Pre-Processing 19 April 18, 2006 16:38
Mesh hard points on faces Ashton Peters FLUENT 4 March 15, 2005 16:43


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