CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[swak4Foam] for faceZones

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 30, 2011, 09:07
Default for faceZones
  #1
Senior Member
 
Andrea Pasquali
Join Date: Sep 2009
Location: Germany
Posts: 142
Rep Power: 16
andrea.pasquali is on a distinguished road
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
__________________
Andrea Pasquali
andrea.pasquali is offline   Reply With Quote

Old   August 30, 2011, 09:27
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by andrea.pasquali View Post
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).
gschaider is offline   Reply With Quote

Old   August 30, 2011, 09:34
Default
  #3
Senior Member
 
Andrea Pasquali
Join Date: Sep 2009
Location: Germany
Posts: 142
Rep Power: 16
andrea.pasquali is on a distinguished road
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
__________________
Andrea Pasquali
andrea.pasquali is offline   Reply With Quote

Old   August 30, 2011, 11:24
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by andrea.pasquali View Post
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
gschaider is offline   Reply With Quote

Reply


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



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