CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   problem with C_VOF and C_UDSI (https://www.cfd-online.com/Forums/fluent/33467-problem-c_vof-c_udsi.html)

Paulina April 13, 2004 08:59

problem with C_VOF and C_UDSI
 
Hi all,

I have written an UDF,( a part of which, attached below), in order to calculate the third moment "mom3" of the distribution of the drop diameters. I would like to calculate that moment as a C_UDSI(c,t,2), which should be calculate from a volume fraction of the second phase C_VOF(c,t,1)divided by constant value 0.523. The value of the C_VOF(c,t,1) should be taken from calculation, which have been made using Eulerian approaches - ASM model in Fluent 5.5 or Mixture model in Fluent 6.1.18.

DEFINE_ADJUST(usrfn,domain)

{

cell_t c;

Thread *t;

real mom3;

thread_loop_c(t,domain)

{

begin_c_loop(c,t)

{

C_UDSI(c,t,2) = C_VOF(c,t,1)/0.523;

mom3 = C_UDSI(c,t,2);

}

}

}

The UDF was interpreted and compiled succesfully, but the probem is that, I cann't take the values of the volume fraction of the second phase and substitude at the C_UDSI(c,t,2). And all the time I have got an error: "Segmentation violation"

Does any one have a suggestion?

Thanks in advance. Paulina

ap April 13, 2004 11:14

Re: problem with C_VOF and C_UDSI
 
The proper syntax of C_VOF in FLUENT 6 is:

C_VOF (cell, pt[n])

where pt is an array of pointers to threads and n is the thread index.

C_UDSI is used for user-defined scalars, and the proper syntax is

C_UDSI(cell, thread, name_of_scalar)

See UDF manual for further info.

Hi :)

ap

Paulina April 16, 2004 05:25

Re: problem with C_VOF and C_UDSI
 
Dear Ap!

Thank you for your response.

I have read the UDF manual, but I can't find solution to my problem still.

Now I have changed my udf and after successful compiled, I got an error:

"Error: Set_THREAD_Variables: wta(real), Error Object: ((constant . 0) (profile " " " ")".

Below I attached two udfs, could you look at them and give me some advices?

DEFINE_ADJUST(usrfn, domain)

{ real vof; Thread **pt; Thread *thread; mp_thread_loop_c(thread,domain,pt) { cell_t cell; begin_c_loop_int(cell,thread) { vof = C_VOF(cell,pt[1])/0.523; C_UDSI(c,t,2) = vof; } end_c_loop_int(cell,thread) }

thread_loop_c (t,domain) { begin_c_loop (c,t) {

mom[1] = C_UDSI(c,t,0);

mom[2] = C_UDSI(c,t,1);

mom[3] = C_UDSI(c,t,2);

} end_c_loop (c,t) } }

I also have written the another udf, but the same message of the error has appeared:

DEFINE_ADJUST(usrfn, domain)

{ real vof; Thread *thread; Thread **pt = THREAD_SUB_THREAD(thread,1); begin_c_loop(c,pt[1]) { vof = C_VOF(c,pt[1])/0.523; C_UDSI(c,t,2) = vof; } end_c_loop(c,pt[1])

thread_loop_c (t,domain) { begin_c_loop (c,t) {

mom[1] = C_UDSI(c,t,0);

mom[2] = C_UDSI(c,t,1);

mom[3] = C_UDSI(c,t,2);

} end_c_loop (c,t) } }

Thanks for all sugestions Best regards Paulina


All times are GMT -4. The time now is 07:40.