CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   setting diffusivity in different domains (http://www.cfd-online.com/Forums/fluent/32844-setting-diffusivity-different-domains.html)

Andrew Garrard January 14, 2004 08:56

setting diffusivity in different domains
 
I am trying to set the diffusivity in a part of a flow domain. How do I identify on of the flows given the Boundary ID for example. say I have two volumes, flow1 and flow2, that are conncect and I wish to set the diffusivity diffently in each flow diffenetly. I can read the boundray ID for flow1 and flow2 from the fluent boundry panel and the thread pointer is passed in the udf. I am struggling to work out how to compare these. The psudo udf would look like this:

DEFINE_DIFFUSIVITY(name, c, t, i)

{

if (thread is in flow1) {return (value1);} if (thread is in flow2) {return (value2);)

}

DAE January 14, 2004 10:35

Re: setting diffusivity in different domains
 
My understanding is that diffusivity is a material property. Why would you want to set a different value in different parts of the domain?

DAE

Andrew Garrard January 14, 2004 11:23

Re: setting diffusivity in different domains
 
Thanks, but that dosent answer my question. To answer yours, material properties can vary. For example, vicosity changes with temperature. My material property could change when, say, entering a magnetic or electrical field.

DAE January 14, 2004 11:42

Re: setting diffusivity in different domains
 
Does this help?

/****************************************/ /* UDF that computes diffusivity */ /****************************************/

#include "udf.h"

DEFINE_DIFFUSIVITY(diffusivity, c, ct, i) {

Domain *domain = Get_Domain(1);

Thread *ct1 = Lookup_Thread(domain,90);

/* Declare ct1 as a pointer to a cell thread */

Thread *ct2 = Lookup_Thread(domain,91);

/* Declare ct2 as a pointer to a cell thread */

begin_c_loop(c,ct1)

{

return *****************

}

end_c_loop(c,ct1)

begin_c_loop(c,ct2)

{

return *****************

}

end_c_loop(c,ct2)

}

Volker Pawlik January 14, 2004 11:45

Re: setting diffusivity in different domains
 
you want to identify the zones locally (which is flow1 and which is 2?) is it that what causes your problem?

If yes, the easiest way is to create a surface zone of your fluid-zone, i.e. the boundary of the zone will form a new surface-zone which can be displayed by the display-grid panel.

Creating a zone is done by the /Surface/Zone menu.

Volker

Andrew Garrard January 17, 2004 10:12

Re: setting diffusivity in different domains
 
Thankyou for your comments. DAE: Your solution to the problem is a nice one, however, the problem is that in the UDF manual, it says:

"Note that diffusivity UDFs are called by FLUENT from within a loop on cell threads. Consequently, your UDF will not need to loop over cells in a thread since FLUENT is doing it outside of the function call."

So I believe that I cannot runn a cell loop in the UDF.

Volker: I really need to identify my fluid zones within a UDF.


All times are GMT -4. The time now is 09:32.