CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   Help on accessing volume fraction in mixture model (http://www.cfd-online.com/Forums/fluent/63806-help-accessing-volume-fraction-mixture-model.html)

 achuneka April 20, 2009 14:14

Help on accessing volume fraction in mixture model

I am writing a UDF that involves volume fraction for Unsteady RANS simulation with cavitation model turned on.

I define a user defined memory variable and use the following snippet of code to access it.

DEFINE_EXECUTE_AT_END(udf_name)
{
........ /* All the definitions */

d=Get_Domain(3); /* Vapor Phase domain

{
begin_c_loop(c,t)
{
C_UDMI(c,t,1)=C_VOF(c,t);
}
}
end_c_loop(c,t)
}
}
(This is just to show how I access C_VOF.. I perform some other operations on it)

I get the value of C_UDMI(c,t,1) as 0 everywhere when the volume fraction of phase 2 varies from 0 to 0.4.

 achuneka April 20, 2009 15:03

I think the problem is with C_UDMI, since I can modify the values of volume fraction using C_VOF variable.

I guess the problem is def of C_UDMI for the mixture domain. Is there any way to define a C_UDMI for a phase ?

 achuneka April 20, 2009 15:57

I found something strange.
The initial contours of void fraction show the values in the range of 0 to 0.4

{
begin_c_loop(c,t)
{
if(index==1)
{
C_UDMI(c,t,1)=C_VOF(c,t); /* >>>>> Over here C_VOF(c,t) is approx 0
C_VOF(c,t) = 1 ; /** Some arbit modification
}
}
end_c_loop(c,t)
}

Now if I check out the contours of volume fraction for phase 2 it shows 1 everywhere... !

So somehow C_VOF does not get the initial data on void fraction....
Am i doing something obviuosly wrong ? pls let me know ..

 cfdpinku April 21, 2009 11:30

i hope you are aware that there are some special multiphase macros avaialble.
i am sure your required domain is not passing with get_domain.
can you please try once with domain_sub_domain.... you can find more details on this in UDF manual.

 achuneka April 21, 2009 13:02

Thanks,
But the fact that I am able to modify the value of volume fraction of phase 2 through the same loop means that I am passing the phase domain to the loop. Somehow the current values are not being accessed.

I have contacted Fluent support.. Hope they help me on it

 cfdpinku April 22, 2009 11:42

i hope domain_id =3 what you have used is picked from define->phases, for vapour phase. since domain id are not necessarily sequential. if this is correct, would you mind sharing sample case with me. i can help you on that. i have tested at my end it works fine.

 achuneka April 23, 2009 13:30

cfdpinku,

Cannot upload the file over here. Exeeds the file limit
Can you please pm me your email ed ? The total size is around 4 mb