CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   magSf: which surface? (https://www.cfd-online.com/Forums/openfoam-post-processing/77288-magsf-surface.html)

maximeg June 18, 2010 10:15

magSf: which surface?
 
Hello!
I'd like to know how I can access/choose the area (of only one of the 6 faces) of a internal cubical finite volume (not near a patch).
I know I have to use the magSf command, but I don't know which face area (or which direction) of the finite volume it gives me.
Thanking you in advance,
Maxime

olesen June 21, 2010 02:27

Quote:

Originally Posted by maximeg (Post 263603)
Hello!
I'd like to know how I can access/choose the area (of only one of the 6 faces) of a internal cubical finite volume (not near a patch).
I know I have to use the magSf command, but I don't know which face area (or which direction) of the finite volume it gives me.
Thanking you in advance,
Maxime

Sf gives you the area and direction, magSf gives you the area of the corresponding global face number. If you want to work with primitive cell types (eg, tet, hex, etc), you'll need the mesh.cellShapes(). From there you can get the list of faces for this primitive shape.
Either read the user documentation or look at the etc/cellModels to see what the face order means for any particular primitive cell shape.

maximeg July 6, 2010 16:08

Quote:

Originally Posted by olesen (Post 263808)
Sf gives you the area and direction, magSf gives you the area of the corresponding global face number. If you want to work with primitive cell types (eg, tet, hex, etc), you'll need the mesh.cellShapes(). From there you can get the list of faces for this primitive shape.
Either read the user documentation or look at the etc/cellModels to see what the face order means for any particular primitive cell shape.

Hello,
Excuse my incomprehension but is it possible to have a code example? I don't know what you mean. How can I get the face number and how do I use it to get the face surface? Someone else has the same problem (cf. http://www.cfd-online.com/Forums/ope...tml#post266026).
Can you also give me an Internet address where I can find such examples (ideally on "how to use magSf() and Sf()", and not just huge lists of commands and enormous graphs like the ones on the pages you advised me to look at on a similar post I wrote) please? I'm sure it's not hard (at least it shouldn't be), but if the user documentation was more detailed/clear it would've helped everyone better.
Thank you.
Maxime

olesen July 7, 2010 10:35

Quote:

Originally Posted by maximeg (Post 266032)
Hello,
Excuse my incomprehension but is it possible to have a code example? I don't know what you mean. How can I get the face number and how do I use it to get the face surface? Someone else has the same problem (cf. http://www.cfd-online.com/Forums/ope...tml#post266026).
Can you also give me an Internet address where I can find such examples (ideally on "how to use magSf() and Sf()", and not just huge lists of commands and enormous graphs like the ones on the pages you advised me to look at on a similar post I wrote) please? I'm sure it's not hard (at least it shouldn't be), but if the user documentation was more detailed/clear it would've helped everyone better.

I don't understand your difficulty, but most especially I don't understand your tone. The forum is a place to help each other, not to demand that someone solve your problems.
Writing some sample code would not be difficult, but I'm unwilling to accept abuse in exchange to trying to help ... especially when you are apparently not willing to examine the existing documentation (doxygen + source code).
Besides which, any sample code that I could provide would certainly not meet your exact needs anyhow and then you are back to where you started.

AlmostSurelyRob January 10, 2011 05:54

I have looked through documentation and through various pieces of code that actually use magSf and I have to say that I am still uncertain how to access the values of magSf.

magSf returns a surfaceScalarField. This object has a method boundaryField() which allows to access values on each patch by boundaryField()[patchId].

Following olesen suggestion, I looked at etc/cellModels and I can clearly see cell shape definitions. The same thing seems to be described here in section 5.1.3:
http://www.openfoam.com/docs/user/mesh-description.php

For my purposes I am actually happy to use patch values. But out of curiosity I was wondering if you could give some additional suggestions on how to access the internal field of surface scalar field and extract the values in one direction only.


I am looking at this function
http://foam.sourceforge.net/doc/Doxy...ce.html#l00033
which seems to be just using magSf()[faceID].


All times are GMT -4. The time now is 02:21.