CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

sampledSurface: size mismatch issue

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Search this Thread Display Modes
Old   June 16, 2014, 05:28
Default sampledSurface: size mismatch issue
Join Date: Jan 2010
Posts: 91
Rep Power: 15
Ya_Squall2010 is on a distinguished road
Hi everyone,

The sampledSurface "size mismatch" problem has been bothering me for quite a while. Basically what I am trying to do is to get a sampled normal velocity field on a sampling surface defined by a STL file using the sampledTriSurfaceMesh class. The code is something like following. And from time to time I get error message: "size mismatch: field XXX != surface XXX", which is really annoying. Can anyone give a hint how to solve this issue. Thanks a lot in advance!


const sampledTriSurfaceMesh& pln = velTriSurf_[planeI];

label nFaces = pln.faces().size();
reduce(nFaces, sumOp<label>());

if (nFaces)
interpolationCellPoint<vector> UInterp(U);
scalarField UInterpPl(pln.project(pln.interpolate(UInterp)));

SubList<face> plnFaces(pln.faces(), pln.faces().size());
primitivePatch primitivePtch(plnFaces, pln.points());
primitivePatchInterpolation primPatchInterp(primitivePtch);

scalarField UInterpPlFaces(primPatchInterp.pointToFaceInterpol ate(UInterpPl));
massFlow = pln.integrate(UInterpPlFaces);

Ya_Squall2010 is offline   Reply With Quote

Old   June 17, 2014, 00:58
Join Date: Jan 2010
Posts: 91
Rep Power: 15
Ya_Squall2010 is on a distinguished road
the "interpolate" switch must be set to "false" to dismiss this annoying error. This way the sampling will be based on the surface triangle centers. Otherwise, it will be performed based on the surface points. By setting "interpolate" to "true", you have high chance to be hit by the "size mismatch" error. And there's no way to perform the "project" operation where a fieldSizeCheck will be performed. Can anyone explain why the sampledSurface has been designed this way? Thanks a lot!
Ya_Squall2010 is offline   Reply With Quote


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
catalogue size problem steven CFX 4 May 30, 2012 07:23
Problems in compiling paraview in Suse 10.3 platform chiven OpenFOAM Installation 3 December 1, 2009 07:21
[Commercial meshers] ST_Malloc: out of memory.malloc_storage: unable to malloc Velocity SA, cfdproject OpenFOAM Meshing & Mesh Conversion 0 April 14, 2009 15:45
Guides for calculation of mesh size for combustion Luk CFX 4 March 17, 2008 02:34
Gambit Size functions issue jon FLUENT 1 December 13, 2006 10:39

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