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

finiteArea mapToSurface

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By akabat

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 20, 2018, 13:59
Default finiteArea mapToSurface
  #1
Member
 
Andrew Coughtrie
Join Date: May 2011
Posts: 51
Rep Power: 15
Andrew.Coughtrie is on a distinguished road
Hi Everyone,

Does anyone have any experience using the finiteArea mapToSurface function in OpenFoam 1712?

I was expecting the following to work (as was the case in foam-extend 4.0):

Us.internalField() = vsm.mapToSurface(U.boundaryField());

It doesn't compile complaining that about no matching function call, below is what i'm giving it and what it's expecting and I can see the difference (I think) I just can't work out what I'm doing incorrectly.

The error:
Code:
no matching function for call to ‘Foam::volSurfaceMapping::mapToSurface(const Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>::Boundary&)’
         Us.internalField() = vsm.mapToSurface(U.boundaryField());

Code:
candidate: template<class Type> Foam::tmp<Foam::Field<Type> > Foam::volSurfaceMapping::mapToSurface(const typename Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>::Boundary&) const
         tmp<Field<Type>> mapToSurface
Anyone got any suggestions please?

Thanks,

Andy
Andrew.Coughtrie is offline   Reply With Quote

Old   March 5, 2018, 09:21
Default
  #2
New Member
 
A.KvJ
Join Date: Feb 2012
Posts: 3
Rep Power: 14
akabat is on a distinguished road
Hello Andrew,

try:

Us.primitiveFieldRef() = vsm.mapToSurface<vector>(U.boundaryField());

Regards
Alex
Andrew.Coughtrie likes this.
akabat is offline   Reply With Quote

Old   March 5, 2018, 09:37
Default
  #3
Member
 
Andrew Coughtrie
Join Date: May 2011
Posts: 51
Rep Power: 15
Andrew.Coughtrie is on a distinguished road
Thanks Alex,

That works, though I'm curious as to why it is that way and if it was intentional (the mapToVolume function has no such complexities and works the same way as in foam-extend).

Any ideas?

Andrew
Andrew.Coughtrie is offline   Reply With Quote

Old   March 6, 2018, 04:26
Default
  #4
New Member
 
A.KvJ
Join Date: Feb 2012
Posts: 3
Rep Power: 14
akabat is on a distinguished road
Hello Andrew,

the template definition of the function has changed. Maybe due to the use of the field ref mechanism the type information can not directly be provided to the function call and the new call was the least intrusive modification when porting the fa functionality from the ext version.

Regards
Alex
akabat is offline   Reply With Quote

Old   March 6, 2018, 05:31
Default
  #5
Member
 
Andrew Coughtrie
Join Date: May 2011
Posts: 51
Rep Power: 15
Andrew.Coughtrie is on a distinguished road
Makes sense, could possibly do with this info on how to use in the comments since there are no places where it is used at the moment for reference.

Andrew
Andrew.Coughtrie is offline   Reply With Quote

Reply

Tags
finitearea, maptosurface


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
1712 finiteArea Parallel bug? Andrew.Coughtrie OpenFOAM Bugs 1 February 14, 2018 12:02
[Other] How to use finite area method in official OpenFOAM 2.2.0? Detian Liu OpenFOAM Meshing & Mesh Conversion 4 November 3, 2015 04:04
New finiteArea Boundary Condition cutty4sark OpenFOAM Programming & Development 1 January 24, 2013 09:47
Gradients on surfaces or how to find neighbour faces for face on a patch tehache OpenFOAM Running, Solving & CFD 21 May 25, 2010 08:08


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