CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   CFX (http://www.cfd-online.com/Forums/cfx/)
-   -   how to access each cell of a face? (user fortran) (http://www.cfd-online.com/Forums/cfx/25103-how-access-each-cell-face-user-fortran.html)

Katariina January 25, 2008 09:57

how to access each cell of a face? (user fortran)
 
Hello all,

I have a problem of accessing face information. (CFX11, user fortran)

I am generating a general momentum source for a 3D-subdomain with user fortran. I need the normal vector components of the bottom face cells of the subdomain (each cell separately); each cell of the subdomain will use the information of the bottom face cell "below" it. I would like to use a Junction Box routine at the beginning of each iteration and store the bottom face normal vector components then for the actual user CEL routine. The code should work also in a parallel run.

USER_GET_GVAR (with area_x/y/z as USER_OPER) gives the integrated normal area vector components of the whole face, right? Not each cell separately? But if it does give the information for each cell separately then how do I find the number of cells (or the NLOC)?

I can't find a way to do this so if someone could help me I would be most grateful!!


opaque January 25, 2008 12:57

Re: how to access each cell of a face? (user fortr
 
Dear Katariina,

Not sure what you really want to do, but I would clear the following:

1 - USER_GET_GVAR is meant for G(lobal)VAR(iables, i.e. integrated, minmax, averaging operation on regions of space. Therefore, it would not be able to return an array of faces or the like. Of course, if your subdomain faces are flat the global value may help.

2 - You can access the normal vectors to a 2D region via CEL expressions, i.e Normal X, Normal Area X and so on. You could also pass these values to a UserCEL Function.

3 - The use of Junction Boxes eliminates a few utilities at your disposal. Therefore, are you sure you need a JunctionBox for all your modifications.

Hope it helps,

Opaque


Katariina January 28, 2008 07:41

Re: how to access each cell of a face? (user fortr
 
Thank you Opaque for your answer!

If you could still clarify one thing: I can't give the Normal X as an argument to my User Function in CFX-Pre because the function is called in a 3D region and Normal X is therefore not defined (or so the Solver says). How do I get the same information from inside my User Fortran subroutine?

A Junction Box would be nice but not necessary, so maybe I'll just forget it and avoid some problems. :)

-Katariina-


opaque January 28, 2008 10:16

Re: how to access each cell of a face? (user fortr
 
Dear Katariina,

The Normal X is defined for 2d Regions only. You will have the same problem within User Fortran, though.

If you use the USER_GET_MESHDATA utility you can get normal vectors as well. However, you must know on which element group, or faces you need your data on.

I still do not understand what you are trying to do. Therefore, a bunch of isolated tips may not be helpful.

Opaque



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