CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

DEFINE_ON_DEMAND UDF: How to declare A[ND_ND], etc

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   November 5, 2003, 13:34
Default DEFINE_ON_DEMAND UDF: How to declare A[ND_ND], etc
  #1
jx
Guest
 
Posts: n/a
Hi, all,

I am trying to implement a UDF to calculate the mean temperature at the downstream boundary of a periodic boundary pairs.

First I'll explain reasons why I need to use this UDF:

1. It is not suitable to monitor an exist surface (I don't like this term as it confused me a bit at the beginning. In FLUENT, it can be a two-dimensional surface, a point, or a line, or even a three-dimensional geometry! May I here suggest FLUENT to use some other term, like "monitored zone", "monitored geometry", "monitored item", or something else less confused?), because the exist periodic boundary pair contains two boundaries but I am just interest in the downstream one.

2. It is not possible to create a new surface (a plane co-planed the downstream boundary), because in my case, I have both solid and fluid portions within that plane. The available approach to create a plane surface (or quadric surface) will result in a plane covered both the solid and fluid portions. Well, although I actually need the mean temperature at that plane, the actual calculations for mean temperature would be different from fluid to solid (facet average for solid and mass-weighted average for fluid). Hence I should create seperate plane surfaces to monitor them if I go this way, which is practically impossible. (at least I am not aware of. If somebody has an idea, please let me know. thanks!)

3. It is not good to use other DEFINE macros like DEFINE_EXCUTE_AT_END, because I only need to compute the mean temperature after convergence, not at every iteration step. Additionally if I use the surface monitor technique above-mentioned, I always get redundant information at every iteration step. Not a big problem though.

Therefore I choose to use the excute-on-demand UDF to do the job.

As the domain id and boundary face id are not passed by the solver to the UDF. I need to initialize them in the UDF. My questions here come:

1. How can I get boundary face id within the UDF? I know I can get the domain id with Get_Domain(1) function. Is there a similiar function for boundary surface?

2. How should I declare the facet area vector? I don't see a sample in FLUENT manuals. I tried "real A[ND_ND]" to declare it but I got "segmentation violation" error when excuting the UDF.

That's all for the moment. And many thanks for your suggestions.

jx
  Reply With Quote

 


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to declare a prism block in the blockMeshDict file callega OpenFOAM Pre-Processing 6 June 1, 2015 12:38
Sgimpi pere OpenFOAM 27 September 24, 2011 07:57
Ld_library_path scottneh OpenFOAM 9 November 21, 2009 09:15
how to declare pointscalarfield keishawillstone OpenFOAM Running, Solving & CFD 5 September 1, 2009 10:15
How to declare a symmetric tensor or calculate Huke formula haibinli OpenFOAM Running, Solving & CFD 0 July 28, 2006 10:24


All times are GMT -4. The time now is 23:29.