CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   swak4Foam for faceZones (http://www.cfd-online.com/Forums/openfoam/92018-swak4foam-facezones.html)

andrea.pasquali August 30, 2011 09:07

swak4Foam for faceZones
 
Hi,
I'd like to calculate the mass flow throgh a faceZone.

I tried first the function in OpenFOAM 2.0 sum(phi) but it calculates the mass flow adding the flux phi without taking in account the normal of the face. I think it is not correct.

After I tried swak4Foam, which does sum(phi*flip()). This is correct but my problem is:
- I got the faceZones whit the snappy
- the faceZones are written into faceZones file directly after snapppy. For some I can find the flip field written, for other no...
- if I use also the swak4Foam I got the correct mass flow for some faceZones and incorrect for others

My question are:
- is it possible to have the correct normals by OpenFOAM?
- I tried also to rewrite the faceZones set, and then to rewirte the file faceZones with the command setsToZones (without the -noFlipMap flag), but I got error and suggestion to use -noFlipMap

Now I solved the problem calculating the faces normals myself, but I'id be very glad if someone can suggest me the correct way to use the OpenFOAM / swak4Foam functions.

Thanks

gschaider August 30, 2011 09:27

Quote:

Originally Posted by andrea.pasquali (Post 322278)
Hi,
I'd like to calculate the mass flow throgh a faceZone.

I tried first the function in OpenFOAM 2.0 sum(phi) but it calculates the mass flow adding the flux phi without taking in account the normal of the face. I think it is not correct.

After I tried swak4Foam, which does sum(phi*flip()). This is correct but my problem is:
- I got the faceZones whit the snappy
- the faceZones are written into faceZones file directly after snapppy. For some I can find the flip field written, for other no...
- if I use also the swak4Foam I got the correct mass flow for some faceZones and incorrect for others

My question are:
- is it possible to have the correct normals by OpenFOAM?
- I tried also to rewrite the faceZones set, and then to rewirte the file faceZones with the command setsToZones (without the -noFlipMap flag), but I got error and suggestion to use -noFlipMap

Now I solved the problem calculating the faces normals myself, but I'id be very glad if someone can suggest me the correct way to use the OpenFOAM / swak4Foam functions.

Thanks

Calculating the flip-map is not completely trivial (although doable - I did something similar in calcMassFlow back in the day) and not even necessarily an operation that gives a unique result.

If you have a cellZone/cellSet that is on either side of the faceSet/faceZone then you might be in business. The convention of setsToZones is that if it finds a cellSet fooSlaveCells then it uses those to calculate the flip-map of the faceZone foo. You'll just have to provide that cellSet (by renaming, converting from faceZone etc).

andrea.pasquali August 30, 2011 09:34

Hi Bernhard,
Thank you for your reply.
I don't know if I understood well... but during my snappy I use some opened stl as internalFaces (or faceZones) to have then the flux phi on those.
The snappy routine create also a cellZone with the same name of the faceZone but it's empty!
How could I do? If I use a closed stl the mass flow would be 0

Andrea

gschaider August 30, 2011 11:24

Quote:

Originally Posted by andrea.pasquali (Post 322285)
Hi Bernhard,
Thank you for your reply.
I don't know if I understood well... but during my snappy I use some opened stl as internalFaces (or faceZones) to have then the flux phi on those.
The snappy routine create also a cellZone with the same name of the faceZone but it's empty!
How could I do? If I use a closed stl the mass flow would be 0

Andrea

I'm not a snappy-expert, but my guess is that it creates an empty cellZone either because the shape ist not closed or because it has not been defined which side of the shape is "inside".

Maybe you "splitMeshRegions -makeCellZones -blockedFaces" helps you


All times are GMT -4. The time now is 04:16.