CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Fluid-Zone-depending viscosity (https://www.cfd-online.com/Forums/fluent/48285-fluid-zone-depending-viscosity.html)

Dennis May 20, 2008 03:23

Fluid-Zone-depending viscosity
 
Hello everyone,

I am trying to write a UDF for a Fluid-Zone-depending viscosity. But I am new to UDF and so I am having problems.

To test the UDF I have a simple 3d Model which consists of 3 conneced cubes (size 100mm, 100mm, 100mm). Cube 1 is Fluent-Zone 1, Cube 2 Fluent-Zone 2 and Cube 3 Fluent-Zone 3.

I am using a 2-phase VOF Model. The UDF should change the viscosity of the 2nd phase depending on the Fluid-Zone. IF it is inside Fluid-Zone 1 the viscosity shall be for example 10Pa s, in zone 2 -> 20Pa s and in Zone 3 -> 30Pa s.

Thanks in advance

With kind regards Dennis

Dennis May 20, 2008 04:42

Fluid-Zone-depending viscosity UDF
 
I created a UDF which works for me, maybe someone is interested in it, too. So here it is:

#include "udf.h"

DEFINE_PROPERTY(cell_viscosity,c,t) { real mu_lam Domain *domain; domain = Get_Domain(3);

if (t == Lookup_Thread(domain,4)){

mu_lam = 10.; }

if (t == Lookup_Thread(domain,3)){

mu_lam = 20.; }

if (t == Lookup_Thread(domain,2)){

mu_lam = 30.; }

return mu_lam;

}

Greetings Dennis


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