CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   How to recover the cells create with the setsToZones utility into the C source file (http://www.cfd-online.com/Forums/openfoam-solving/77366-how-recover-cells-create-setstozones-utility-into-c-source-file.html)

Cyp June 21, 2010 11:59

How to recover the cells create with the setsToZones utility into the C source file
 
Hello!

I splitted my domain (for the moment a mere square) into 2 subdomains with the setsToZones utility. The cellZones file is well created and the my subdomains are named "phase1" and "phase2".

In my calculations, I need to integrate a field over the domain "phase1" and then over the domain "phase2". (My solver is an adapted version of the scalarTransportFoam solver with variable transport properties defined by the setFields utility). How can I recover the domain "phase1" (and then "phase2") into my main solver C source file in order to integrate my field over this domain.

Thank you for your help,
Cyprien

olesen June 22, 2010 02:46

Quote:

Originally Posted by Cyp (Post 263895)
Hello!

I splitted my domain (for the moment a mere square) into 2 subdomains with the setsToZones utility. The cellZones file is well created and the my subdomains are named "phase1" and "phase2".

In my calculations, I need to integrate a field over the domain "phase1" and then over the domain "phase2". (My solver is an adapted version of the scalarTransportFoam solver with variable transport properties defined by the setFields utility). How can I recover the domain "phase1" (and then "phase2") into my main solver C source file in order to integrate my field over this domain.

The mesh has a cellZones() member:
http://foam.sourceforge.net/doc/Doxy...f55a4fcb32dfd2
that you can use to access the cell zones.

Try "git grep cellZones" to find lots of examples in the source code of how it is used.
If this is provides too much information for you, take a look at porousZone/porousZones ... I know it is used there and the classes are fairly small and should be easy enough to understand.

Cyp June 22, 2010 10:01

Thank you for your answer !

I think I could find out a solution to my problem.


All times are GMT -4. The time now is 13:15.