
[Sponsors] 
September 13, 2009, 06:33 
boundary mesh and interpolation questions

#1 
New Member
Paul Schiefer
Join Date: Sep 2009
Posts: 25
Rep Power: 9 
Dear all,
The boundary mesh handling of the fvMesh and GeometricField classes does not work quite as I expect. I believe the implementation makes sense, but I'll need some support to loop over boundaries faces and get field values on those face centers or vertices. For example, if I run a modified solidDisplacementFoam on the plateHole tutorial (OF 1.5), I observe that the D.boundaryField() has 140 faces, while mesh.boundary() has 2140 faces. (D is the volVectorField related to deformation). It looks like D.boundaryField() does not include the 2x1000 faces of patch "frontAndBack" which is defined with "type empty". 1) What is the natural procedure to loop over the values of D on *all* boundary faces (including the "frontAndBack" patch)? Right now I think I need to first interpolate D onto the face centers, then for each face check whether it is touching only one (>boundary face) or two cells (>internal face). I'm sure, OpenFOAM has functions for this purpose. Can you point me to the right functions in the class documentation? I didn't find enough information in the user guide or in the programming guide. 2) How do I get the face label of a Foam::face? For example, setting Foam::face fc=D.boundaryField()[patchIndex][faceIndex]; gives me a face fc, which I would like find in mesh.faces(). Without getting the label of fc, I can only compare the geometric coordinates, which is very expensive. 3) Does a function exist which returns the values of a vol(Scalar/Vector)Field on the vertices of the cells? Or do I first have to interpolate onto the face centers and from the face centers onto the vertices? Thank you Paul 

September 13, 2009, 11:17 

#2  
Senior Member
Matvey Kraposhin
Join Date: Mar 2009
Location: Moscow, Russian Federation
Posts: 330
Rep Power: 12 
Hi, Paul
Quote:
Moreover, if field value is uniform across the boundary, then values are not printed, but used spicifier 'uniform' and 'value' to show this. See fixedValue, fixedGardient, zeroGradient (grad(psi) = 0) Quote:
forAll(psi, celli) { psi[celli] = ... } to iterate through all faces (values at all face centers at all patches) forAll(psi.boundaryField(), patchi) { forAll(psi.boundaryField()[patchi], facei) { psi.boundaryField()[patchi][facei] = .... } } or forAll(psi.boundaryField(), patchi) { fvPatchScalarField &ppsi = psi.boundaryField()[patchi] forAll(ppsi, facei) { ppsi[facei] = .... } } Quote:
Quote:
pointScalar(Vector, Tensor, etc)Field, defined as typedef GeometricField< scalar, pointPatchField, pointMesh > pointScalarField defined at line 45 of file pointFields.H To volume field vField to point file pField (both of them define on fvMesh mesh), use (for example) volPointInterpolation::New(mesh).interpolate ( vField, pField ); As you see, the key function here is volPointInterpolation::interpolate(...) member of class volPointInterpolation hope, this helps you 

September 13, 2009, 14:22 

#3  
New Member
Paul Schiefer
Join Date: Sep 2009
Posts: 25
Rep Power: 9 
Dear Matjev,
thank you for the explanations. But some of your suggestions are not helpful, as I had already tried them, and they don't provide a solution to my questions. Quote:
Quote:
Quote:
Paul 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Field interpolation in mesh points code  jzlam  OpenFOAM PostProcessing  2  December 14, 2010 17:48 
interpolation in unstructured FV mesh  ehsan  Main CFD Forum  2  January 5, 2008 05:06 
Has anyone successfully used transition modell..p2  PetrK  CFX  12  May 26, 2006 16:27 
periodic Boundary Condition for unstructured grid  MLJ  Main CFD Forum  2  June 16, 2000 05:57 
3d elliptic generation mesh  Gang Sun  Main CFD Forum  5  September 16, 1998 00:24 