CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Fluent UDF and Scheme Programming

first time with UDMI

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   October 1, 2003, 10:31
Default first time with UDMI
  #1
Andrew Garrard
Guest
 
Posts: n/a
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)

}
  Reply With Quote

Old   October 1, 2003, 15:40
Default Re: first time with UDMI
  #2
ap
Guest
 
Posts: n/a
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
  Reply With Quote

Old   October 2, 2003, 04:41
Default Re: first time with UDMI
  #3
Andrew Garrard
Guest
 
Posts: n/a
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?
  Reply With Quote

Old   October 2, 2003, 07:49
Default Re: first time with UDMI
  #4
ap
Guest
 
Posts: n/a
I don't think this has to do with the sign of values.

Hi

ap
  Reply With Quote

Old   February 29, 2012, 00:01
Default
  #5
New Member
 
Balakrishnan
Join Date: Feb 2012
Posts: 5
Rep Power: 5
balki is on a distinguished road
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
balki is offline   Reply With Quote

Old   November 22, 2012, 11:17
Default
  #6
Senior Member
 
rkhr
Join Date: May 2011
Posts: 211
Rep Power: 7
Kanarya is on a distinguished road
Quote:
Originally Posted by balki View Post
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!!!
Kanarya is offline   Reply With Quote

Old   November 24, 2012, 00:30
Default
  #7
New Member
 
Balakrishnan
Join Date: Feb 2012
Posts: 5
Rep Power: 5
balki is on a distinguished road
Hi Kanarya, I had the same problem. When I used C_UDMI instead of F_UDMI, it worked as expected. I dont know why.
balki is offline   Reply With Quote

Old   November 24, 2012, 09:43
Default
  #8
Senior Member
 
rkhr
Join Date: May 2011
Posts: 211
Rep Power: 7
Kanarya is on a distinguished road
Quote:
Originally Posted by balki View Post
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...
Kanarya is offline   Reply With Quote

Old   November 25, 2012, 05:24
Default
  #9
New Member
 
Balakrishnan
Join Date: Feb 2012
Posts: 5
Rep Power: 5
balki is on a distinguished road
Quote:
Originally Posted by Kanarya View Post
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
balki is offline   Reply With Quote

Old   November 25, 2012, 19:49
Default
  #10
Senior Member
 
rkhr
Join Date: May 2011
Posts: 211
Rep Power: 7
Kanarya is on a distinguished road
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 is offline   Reply With Quote

Old   November 30, 2012, 11:54
Default
  #11
Senior Member
 
rkhr
Join Date: May 2011
Posts: 211
Rep Power: 7
Kanarya is on a distinguished road
Quote:
Originally Posted by balki View Post
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!!!
Kanarya is offline   Reply With Quote

Old   July 24, 2015, 10:12
Default
  #12
New Member
 
Farzin
Join Date: Jul 2014
Posts: 28
Rep Power: 3
FarzinD is on a distinguished road
Quote:
Originally Posted by balki View Post
Hi Kanarya, I had the same problem. When I used C_UDMI instead of F_UDMI, it worked as expected. I dont know why.
I also came up with this problem. I think its just not enough to have only Face User-Defined memory of a cell to make plots. Considering that Fluent calculates and stores variables on cell Centers, it is needed to store the value of both Cell and it's Face within a single User-Defined Memory Location.
FarzinD is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
TimeVaryingMappedFixedValue irishdave OpenFOAM Running, Solving & CFD 28 May 28, 2015 13:37
Time step size and max iterations per time step pUl| FLUENT 27 May 12, 2015 20:04
calculation diverge after continue to run zhajingjing OpenFOAM 0 April 28, 2010 04:35
Problems with simulating TurbFOAM barath.ezhilan OpenFOAM 13 July 16, 2009 05:55
Modeling in micron scale using icoFoam m9819348 OpenFOAM Running, Solving & CFD 7 October 27, 2007 00:36


All times are GMT -4. The time now is 10:08.