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

magSf() on boundaries

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

Like Tree2Likes
  • 2 Post By ngj

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 14, 2012, 10:53
Question magSf() on boundaries
  #1
New Member
 
Lorenzo A. Ricciardi
Join Date: Mar 2011
Posts: 27
Rep Power: 15
lichmaster is on a distinguished road
Hi FOAMers,

how do I get magSf() on bounday faces?

I noticed that mesh.magSf()[faceI] gives correct results on internal faces, but when faceI is on a face, it gives ~1e-320...

Code:
label startFace = mesh.boundaryMesh()[ib].start();
label nFaces    = mesh.boundaryMesh()[ib].size();
for (label faceI = startFace; faceI < startFace + nFaces; faceI++)
    {
...
vector normal = mesh.Sf()[faceI]/mesh.magSf()[faceI]; \\floating point error
      }
What's wrong ?
lichmaster is offline   Reply With Quote

Old   March 15, 2012, 05:22
Default
  #2
New Member
 
Lorenzo A. Ricciardi
Join Date: Mar 2011
Posts: 27
Rep Power: 15
lichmaster is on a distinguished road
I've solved this problem, simply taking

mag(mesh.Sf()[faceI]);

However, I really can't understand why there isn't a mesh.magSf() method for boundary faces when there is a mesh.Sf() method defined on them...
lichmaster is offline   Reply With Quote

Old   March 15, 2012, 05:30
Default
  #3
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Hi

You should be able to access the data in any of the following manners:

Code:
const scalarField magnitude0 = Foam::mag( mesh.Sf().boundaryField()[patchi] );
const scalarField & magnitude1 = mesh.magSf().boundaryField()[patchi];
This gives you the magnitude of the normal vectors on a given patch through its index patchi.

Best regards,

Niels
styleworker and SHUBHAM9595 like this.
ngj is offline   Reply With Quote

Reply

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
Setting Flow/Pressure Boundaries in Floworks Eran FloEFD, FloWorks & FloTHERM 3 August 11, 2009 05:23
periodic boundaries - flow through a net PK FLUENT 0 July 12, 2007 12:58
Periodic Boundaries in GAMBIT!! swetha FLUENT 1 November 26, 2006 23:02
mass flux correction at outflow boundaries Subhra Datta Main CFD Forum 2 November 24, 2003 14:11


All times are GMT -4. The time now is 17:42.