CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   Need help on undocumented Fluent Intrinsic Functio (http://www.cfd-online.com/Forums/fluent/28155-need-help-undocumented-fluent-intrinsic-functio.html)

Wilson January 18, 2001 12:55

Need help on undocumented Fluent Intrinsic Functio
 
1) I am currently doing drug delivery to a brain tumor. In my geometry, I have 11 fluid zones (1 tissue zone, 1 tumor zone, 1 cavity zone and 8 wafers zones), whose individual ID ranges from 1 to 11. I wanted to set up my problem such that the drug will have different diffusivity parameter in different zones. Specifically, my code would look something like this: DEFINE_DIFFUSIVITY(set_diffusivity, cell, thread, index) { if <thread is tumor zone> return 1234 if <thread is tissue zone> return 2345 ...... } those instruction in <> is pseudo code. Is there a Macro in Fluent to do this?

(2) Currently under boundary conditions, the viscous resistance of a porous fluid (accessible through DEFINE -> BOUNDARY CONDITIONS -> POROUS -> VISCOUS RESISTANCE) can only be set a constant value. Is there anyway to change this through UDF? Specifically, during run time, I hope to be able to do the following: { ... if <some conditions> Viscous_Resistance = <some values> ... }

Greg Perkins January 18, 2001 19:19

Re: Need help on undocumented Fluent Intrinsic Fun
 
(1) try the function

Thread *your_thread; int thread_index_id = xxx;

your_thread = Lookup_Thread(domain,thread_index_id)

where thread_index_id is the thread id number. I think same as gambit zone - but if not you can try some numbers until you determine the right ones.

I've used this for getting a face thread, I imagine it also works for getting a cell thread. I think then you'd test on your_thread vs the thread passed to DEFINE_DIFFUSIVITY to determine what value to return.

(2) Not sure - DEFINE_PROFILE ??????

Regards Greg

Wilson January 18, 2001 23:21

Re: Need help on undocumented Fluent Intrinsic Fun
 
Thanks for your prompt reply. However, I have a problem here.

The macro, DEFINE_DIFFUSIVITY, does not pass any domain pointer but rather it passes cell_t and thread pointer to the code. So even if I wanted to use LookUp_Thread, how do I pass the current domain to the function???

Greg Perkins January 18, 2001 23:27

Re: Need help on undocumented Fluent Intrinsic Fun
 
yeah no worries just make sure you have the line

extern Domain *domain;

defined - then you'll be able to access everything in the domain without needing to have it passed from Fluent.

Greg

Wilson January 19, 2001 04:05

Re: Need help on undocumented Fluent Intrinsic Fun
 
By the way, can I compare two threads??? As you know, when I use DEFINE_DIFFUSIVITY macros, what I am actually doing is the following:

DEFINE_DIFFUSIVITY(set_d, cell, thread, species) { if <at thread id 1> return 12345; if <at thread id 2> return 23456; ..... }

So now what I have is as follows:

DEFINE_DIFFUSIVITY(set_d, cell, thread, species) { extern Domain *domain; Thread *t1 = Lookup_Thread(domain, 1); Thread *t2 = Lookup_Thread(domain, 2); ....

if (thread == t1) return 12345; if (thread == t2) return 23456; ..... }

Greg Perkins January 19, 2001 04:20

Re: Need help on undocumented Fluent Intrinsic Fun
 
Yeah - why not?? They are just pointers. I think what you have should work.

However another way is to test the ID of the thread passed. I haven't used this function/macro but there is a macro called

THREAD_ID(t)

which returns the id number of t. Its defined in mem.h.

So you could test on that.

By the way to find out about these things you need to hunt around in Fluent.Inc/Fluent5.x/src folder. If you grep this folder with things you're looking for you can work out some of this stuff. It takes time and then you need to test it - that means try it on some simple cases. You'll find that its not that hard. But can be a bit frsutrating at times.

Greg


Wilson January 19, 2001 13:49

Re: Need help on undocumented Fluent Intrinsic Fun
 
Thanks Greg! You are a great help in this forum. I will keep you posted if it is successful.

Btw, for curiousity sake, how long have you been dabbling with Fluent???

Wilson.

Greg Perkins January 20, 2001 00:20

Re: Need help on undocumented Fluent Intrinsic Fun
 
About 18 months


All times are GMT -4. The time now is 02:39.