CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   first time with UDMI (http://www.cfd-online.com/Forums/fluent-udf/32240-first-time-udmi.html)

Andrew Garrard October 1, 2003 10:31

first time with UDMI
 
I am trying to use UDM for the first time. I have written the part of the code shown below, where eta(f) is a function in another part of the code. I would have assumed the same value that is printed for over_pot in the printf line would be the value that appeared in my xy plots in fluent. When I make the xy plot I only get a value of 0.00000. Any reason why this is occuring?

DEFINE_PROFILE(tile_conc_spec, thread_sol, i)

{

face_t f;

begin_f_loop(f, thread_sol)

{

real over_pot = eta(f);

F_UDMI(f, thread_sol, 0) = over_pot;

printf ("\nover_pot = %g, at face %d", over_pot, f);

F_PROFILE(f, thread_sol, i) = c_bulk*concvar(f)/(concvar(f)+1);

} end_f_loop(f, thread_sol)

}

ap October 1, 2003 15:40

Re: first time with UDMI
 
You're saving your values only on the boundary where you define your profile, so you should be able to plot it only there, by selecting the boundary in the XY-plot panel.

Hi :)

ap

Andrew Garrard October 2, 2003 04:41

Re: first time with UDMI
 
The thread that I am defining the profile on "thread_sol" is the same one that I am applying the UDM to, it is also the one I am trying to XY plot in fluent. I still get 0.000 for all face values on that face thread. Is it because all the values are negative?

ap October 2, 2003 07:49

Re: first time with UDMI
 
I don't think this has to do with the sign of values.

Hi :)

ap

balki February 29, 2012 00:01

Hi Andrew, I hope you would have solved this problem. I'm also facing the same problem can you please let me know the solution?

Thanks
krishnan

Kanarya November 22, 2012 11:17

Quote:

Originally Posted by balki (Post 346804)
Hi Andrew, I hope you would have solved this problem. I'm also facing the same problem can you please let me know the solution?

Thanks
krishnan

Hi I have the same problem. the values are 0.did u solve the problem my code is:
#include "udf.h"
DEFINE_PROFILE(outlet_mf,t,i)
{
face_t f;
real flow;
begin_f_loop(f,t)
{
flow+=F_FLUX(f,t);
F_UDMI(f,t,0)=flow;
}
end_f_loop(f,th);

}

thanks in advance!!!

balki November 24, 2012 00:30

Hi Kanarya, I had the same problem. When I used C_UDMI instead of F_UDMI, it worked as expected. I dont know why.

Kanarya November 24, 2012 09:43

Quote:

Originally Posted by balki (Post 393923)
Hi Kanarya, I had the same problem. When I used C_UDMI instead of F_UDMI, it worked as expected. I dont know why.

Hi,
Thanks for the answer!
did you use the function F_FLUX(f,t)? how is it possible to read face and to save in cell?

thanks again...

balki November 25, 2012 05:24

Quote:

Originally Posted by Kanarya (Post 393957)
Hi,
Thanks for the answer!
did you use the function F_FLUX(f,t)? how is it possible to read face and to save in cell?

thanks again...

Hi, I didn't use F_FLUX.

how is it possible to read face and to save in cell? I have the same doubt, anyhow as I said earlier, C_UDMI solved the problem. If you find the answer, please let me know....

Balki

Kanarya November 25, 2012 19:49

Hi,

which function is suitable to save mass flow at outlet..do you think, is define_execute_at_end OK for it?

thanks for advance..!

Kanarya November 30, 2012 11:54

Quote:

Originally Posted by balki (Post 394034)
Hi, I didn't use F_FLUX.

how is it possible to read face and to save in cell? I have the same doubt, anyhow as I said earlier, C_UDMI solved the problem. If you find the answer, please let me know....

Balki

Hi Balki,
#include "udf.h"
DEFINE_EXECUTE_AT_END(measure_mass_flow)
{
real mass_flow;
real mass_flow_g;
Domain *d=Get_Domain(1);
cell_t c;
face_t f;
Thread *mixture_thread = Lookup_Thread(d,4);
Thread **pt = THREAD_SUB_THREADS(mixture_thread);
Thread *tp = pt[0];
Thread *ts = pt[1];

mass_flow=0.;
//mass_flow=0.;
mp_thread_loop_f(mixture_thread,d,pt)

if( THREAD_ID(mixture_thread) == 4 )

{
begin_f_loop(f,mixture_thread)

{
mass_flow+=F_FLUX(f,ts);

if(N_UDM > 0 && BOUNDARY_FACE_THREAD_P(ts))

C_UDMI(f,ts,0)=mass_flow;
}
end_f_loop(f,mixture_thread)
}


Message("mass_flow:%g/n",mass_flow);

}

I am trying to save mass flow at outlet. but it gives always zero, could you give me a hint? thanks a lot in advance!!!


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