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

F_UDMI how to postprocess?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 10, 2006, 07:01
Default F_UDMI how to postprocess?
  #1
Kasper Skriver
Guest
 
Posts: n/a
Hello everybody

I'm working on a case where I need to store some face values using F_UDMI. I also need to use C_UDMI to store some cell center values.

My questions are:

- does the index in the C_UDMI and F_UDMI need to be different from each other. (will it conflict if I use C_UDMI(c,t,0) and F_UDMI(f,t,0) different from F_UDMI(f,t,1)) ?

- is it correct understood that the F_UDMI only applies for boundary faces?

- and finally, how do I access the F_UDMI values once done with the iterations? How do I postprocess(plot) it?

Regards Kasper Skriver FLS Airtech - Denmark

-------------------------------------------------------- Some initializing code

#include "udf.h"

DEFINE_INIT( initialize, d) {

Thread *t;

cell_t c;

face_t f;

thread_loop_c(t,d)

{

begin_c_loop(c,t)

{

/* INITIALISERER C_UDMI'ER OG C_UDSI'ER */

C_UDMI(c,t,0) = 2; /* Vey FOR CELLER */

//C_UDSI(c,t,0) = 1; /* POTENTIALET */

//C_UDSI(c,t,1) = 1; /* KONCENTRATIONEN C */

}

end_c_loop(c,t)

}

thread_loop_f(t,d)

{

if (BOUNDARY_FACE_THREAD_P(t))

{

begin_f_loop(f,t)

{

/* INITIALISERER F_UDMI'ER */

F_UDMI(f,t,1) = 1; /* Vey FOR FACES */

Message("f_udmi(f,t,1)=%g\n",F_UDMI(f,t,1));

}

end_f_loop(f,t)

}

else

{

}

} }
  Reply With Quote

Old   April 20, 2006, 10:55
Default Re: F_UDMI how to postprocess?
  #2
Ugur
Guest
 
Posts: n/a
Have you compiled this code and does it work? If I'm not mistaken, you cannot modify F_UDMI but they are interpolated from C_UDMI values. Therefore, there is a possibility that this code gives you a SEGMENTATION VIOLATION or ACCESS VIOLATION type of error.
  Reply With Quote

Old   April 20, 2006, 11:09
Default Re: F_UDMI how to postprocess?
  #3
Kasper Skriver
Guest
 
Posts: n/a
Yes, I have compiled it and it works fine.

I don't think that F_UDMI is interpolated from C_UDMI, and it works for the same index i in both F_UDMI and C_UDMI.

I can even check the values with Message('blabla',F_UDMI(f,t,0)); and it prints what I previously set it to be - no interpolation!

Im confused about the indexing, so are my FLUENT supporter in Sweden. Also confused about why you can't assign values to the F_UDMI inside the domain - here I think you are right about the interpolation. On boundaries it's different.

Kasper
  Reply With Quote

Old   April 20, 2006, 15:54
Default Re: F_UDMI how to postprocess?
  #4
Ugur
Guest
 
Posts: n/a
I meant just like any other face values they are not accessible inside the domain. The boundary faces are a different story. I think when you use F_UDMI(f,t,*), it should work when t is a pointer for face thread. For any other faces inside the domain, I don't think it will work.
  Reply With Quote

Old   March 24, 2009, 03:17
Default
  #5
New Member
 
liuxiao
Join Date: Mar 2009
Posts: 10
Rep Power: 17
lx33101128 is on a distinguished road
Quote:
Originally Posted by Kasper Skriver
;131457
Yes, I have compiled it and it works fine.

I don't think that F_UDMI is interpolated from C_UDMI, and it works for the same index i in both F_UDMI and C_UDMI.

I can even check the values with Message('blabla',F_UDMI(f,t,0)); and it prints what I previously set it to be - no interpolation!

Im confused about the indexing, so are my FLUENT supporter in Sweden. Also confused about why you can't assign values to the F_UDMI inside the domain - here I think you are right about the interpolation. On boundaries it's different.

Kasper
does it work? in my systerm it can be complied, but when it works, there will be an error?
lx33101128 is offline   Reply With Quote

Old   March 24, 2009, 03:59
Default
  #6
Senior Member
 
Max
Join Date: Mar 2009
Posts: 133
Rep Power: 17
coglione is on a distinguished road
Hi Kasper,

1) as soon as you define a UDM with index i memory gets allocated for it in each cell and on boundary face threads. Thus there is no need to define two different UDMI's if the purpose is to store a single quantity in cells and on boundaries.

2) to postprocess F_UDMI: i understand it as follows: if you plot contours on a boundary surface with node values on you will see actually F_UDMI, with node values off you get the value of C_UDMI in the adjacent cell to your boundary.

cheers
coglione is offline   Reply With Quote

Old   November 25, 2009, 11:50
Default
  #7
Senior Member
 
isabel
Join Date: Apr 2009
Location: Spain
Posts: 171
Rep Power: 16
isabel is on a distinguished road
Hello everybody,

I want to program a F_UDMI with the value of 10*temperature. First, I programmed it as a C_UDMI and it worked Ok. But when I program it as a F_UDMI, I have this error:

Error: FLUENT received fatal signal (ACCESS_VIOLATION)
  • Note exact events leading to error.
  • Savee case/data under new name.
  • Exit program and restart to continue.
  • Report error to your distributor.
Error Object: ()

The C++ program as C_UDMI (which works Ok) is this:

#include "udf.h"
DEFINE_ON_DEMAND(function)
{
Domain *d;
Thread *t;
cell_t c;
d=Get_Domain(1);
thread_loop_c(t,d)
{
begin_c_loop(c,t)
{
C_UDMI(c,t,0)=10*C_T(c,t);
}
end_c_loop(c,t)
}
}



The C++ program as F_UDMI (which fives the violation error) is this:

#include "udf.h"
DEFINE_ON_DEMAND(function)
{
Domain *d;
Thread *t;
face_t f;
d=Get_Domain(1);
thread_loop_f(t,d)
{
begin_f_loop(f,t)
{
F_UDMI(f,t,0)=10*F_T(f,t);
}
end_f_loop(f,t)
}
}



Does anybody know why the code runs Ok as a C_UDMI and not as a F_UDMI ???
isabel is offline   Reply With Quote

Old   November 26, 2009, 03:37
Default
  #8
New Member
 
Agnieszka
Join Date: Jul 2009
Posts: 4
Rep Power: 16
Agnieszka is on a distinguished road
Hello,
I have also problem with postprocessing. In detail, I need write some date from Fluent to Microsoft Excel. Those data: axial velocity, radial velocity and tangential velocity dependent on dimenssionless radius r/R. I don't know where I can find those data and how I can read them. Please help me.
Best regards,
Agnieszka
Agnieszka is offline   Reply With Quote

Old   November 26, 2009, 05:59
Default
  #9
Senior Member
 
dmoroian's Avatar
 
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20
dmoroian is on a distinguished road
Quote:
Originally Posted by isabel View Post
I want to program a F_UDMI with the value of 10*temperature. First, I programmed it as a C_UDMI and it worked Ok. But when I program it as a F_UDMI, I have this error:

Error: FLUENT received fatal signal (ACCESS_VIOLATION)
  • Note exact events leading to error.
  • Savee case/data under new name.
  • Exit program and restart to continue.
  • Report error to your distributor.
Error Object: ()

...


Does anybody know why the code runs Ok as a C_UDMI and not as a F_UDMI ???
Hi Isabel,
In the UDF Manual, it is specified that F_UDMI is defined only on boundary faces, and not interior! If you try to use the interior faces you will get the kind of errors you see above.
As a general note, not all the variables are defined on the faces.

Dragos
dmoroian is offline   Reply With Quote

Old   November 26, 2009, 06:04
Default
  #10
Senior Member
 
dmoroian's Avatar
 
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20
dmoroian is on a distinguished road
Quote:
Originally Posted by Agnieszka View Post
Hello,
I have also problem with postprocessing. In detail, I need write some date from Fluent to Microsoft Excel. Those data: axial velocity, radial velocity and tangential velocity dependent on dimenssionless radius r/R. I don't know where I can find those data and how I can read them. Please help me.
Best regards,
Agnieszka
Hi Agnieszka,
You don't really need to write a udf for this purpose. There is a menu option (File->Export) that lets you export the data in many different formats.
Try that first!
dmoroian is offline   Reply With Quote

Old   November 26, 2009, 06:14
Default
  #11
Senior Member
 
isabel
Join Date: Apr 2009
Location: Spain
Posts: 171
Rep Power: 16
isabel is on a distinguished road
I only want the temperature on the face, so I defined 10*F_T(f,t).
This code is to take values at the faces. It compiles Ok, but when I try to iterate it gives a violation error.

#include "udf.h"
DEFINE_ON_DEMAND(function)
{
Domain *d;
Thread *t;
face_t f;
d=Get_Domain(1);
thread_loop_f(t,d)
{
begin_f_loop(f,t)
{
F_UDMI(f,t,0)=10*F_T(f,t);
}
end_f_loop(f,t)
}
}
isabel is offline   Reply With Quote

Old   November 26, 2009, 06:35
Default
  #12
Senior Member
 
dmoroian's Avatar
 
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20
dmoroian is on a distinguished road
You are looping over the faces in the entire domain, not only on the boundaries, whereas the F_UDMI is defined only on the boundary faces. If you intended to set the values only on the boundaries, then a quick fix should be to replace:
Code:
F_UDMI(f,t,0)=10*F_T(f,t); 
with:
Code:
if(N_UDM > 0 && BOUNDARY_FACE_THREAD_P(t))
   F_UDMI(f,t,0)=10*F_T(f,t); 
It is very important to understand the difference (check the UDF Manual section 3.2.4), otherwise you will end-up with segmentation faults, all the time.
dmoroian is offline   Reply With Quote

Old   November 26, 2009, 07:09
Default
  #13
Senior Member
 
isabel
Join Date: Apr 2009
Location: Spain
Posts: 171
Rep Power: 16
isabel is on a distinguished road
Sorry, but I have added the line you suggested to me but I have the violation error when I do the define-->user defined --> execute on demand

My new code is as follows:

#include "udf.h"
DEFINE_ON_DEMAND(function)
{
Domain *d;
Thread *t;
face_t f;
d=Get_Domain(1);
thread_loop_f(t,d)
{
begin_f_loop(f,t)
{
if(N_UDM > 0 && BOUNDARY_FACE_THREAD_P(t))
F_UDMI(f,t,0)=10*F_T(f,t);
}
end_f_loop(f,t)
}
}
isabel is offline   Reply With Quote

Old   November 27, 2009, 02:41
Default
  #14
Senior Member
 
dmoroian's Avatar
 
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20
dmoroian is on a distinguished road
I don't see anything wrong with the last udf, so probably you are executing the old one. Try to erase the directory "libudf" and compile again.
dmoroian is offline   Reply With Quote

Old   November 30, 2012, 10:35
Default
  #15
Senior Member
 
Join Date: May 2011
Posts: 231
Rep Power: 15
Kanarya is on a distinguished road
Quote:
Originally Posted by dmoroian View Post
Hi Isabel,
In the UDF Manual, it is specified that F_UDMI is defined only on boundary faces, and not interior! If you try to use the interior faces you will get the kind of errors you see above.
As a general note, not all the variables are defined on the faces.

Dragos
Hi,
Hi,
it seems like F_UDMI doesnt save anything! value is always "0"!
is there any one who can explain this?
thanks in advance!
Kanarya is offline   Reply With Quote

Old   December 1, 2012, 04:21
Default
  #16
Senior Member
 
dmoroian's Avatar
 
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20
dmoroian is on a distinguished road
Please give more details, in order for the rest of the community to be able to help you. F_UDMI is just a storage place, and you have to put something in it before you want to see any change.
dmoroian is offline   Reply With Quote

Old   December 1, 2012, 06:33
Default
  #17
Senior Member
 
Join Date: May 2011
Posts: 231
Rep Power: 15
Kanarya is on a distinguished road
Quote:
Originally Posted by dmoroian View Post
Please give more details, in order for the rest of the community to be able to help you. F_UDMI is just a storage place, and you have to put something in it before you want to see any change.
Hi Dmoroian,
thanks for the answer. this program is reading outlet solid mass flow and I would like to save it and then use it in the inlet profile but it seems F_UDMI doesnt save anything. thanks for the help
#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);


F_UDMI(f,t,0)=mass_flow;
}
end_f_loop(f,mixture_thread)
}


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

}
Kanarya is offline   Reply With Quote

Old   December 8, 2012, 20:15
Default
  #18
Senior Member
 
dmoroian's Avatar
 
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20
dmoroian is on a distinguished road
I think that the mass flux is defined only at mixture level. Consequently, you should use
mass_ flow += F_ FLUX(f,mixture_ thread);
and weigh the value with a vof value averaged between the 2 cells sharing the face "f".
dmoroian is offline   Reply With Quote

Old   January 18, 2013, 04:24
Default C_udmi
  #19
Senior Member
 
Join Date: May 2011
Posts: 231
Rep Power: 15
Kanarya is on a distinguished road
Hi Dmoroian,

I saved massflow rate at outlet and I want to use it like inlet it seems doesnt work. inlet always is zero?

begin_f_loop(f,t)
{
c0 = F_C0(f, t);
t0 = THREAD_T0(t);
mass_flow +=F_FLUX(f,pt[SOLID_PHASE_ID]);
C_UDMI(c0,t0,0)=mass_flow;
}
end_f_loop(f,t)

and my inlet profile is:

DEFINE_PROFILE(B0, t, i)
{ cell_t c0; face_t f; Thread *ct;
begin_f_loop(f, t)
{ c0 = F_C0(f,t); ct = t->t0;
F_PROFILE(f,t,i) = C_UDMI(c0,ct,0); }
end_f_loop(f,t) }

but it doesnt work

thanks in advance!!!
Kanarya is offline   Reply With Quote

Old   January 19, 2013, 19:00
Default
  #20
Senior Member
 
dmoroian's Avatar
 
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20
dmoroian is on a distinguished road
You store values in C_ UDMI's next to the outlet, and then use other C_ UDMI's next to the inlet to set the inlet b.c. The two sets of C_ UDMI's are different, so there is no surprise that it ' does not work'.
dmoroian is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CFX results postprocess in Tecplot seaharrier CFX 5 April 18, 2019 01:01
SOS, postprocess aspect ratio hedonist FLUENT 3 September 1, 2010 10:02
How to make Disproportional Figures - Postprocess. mrt FLUENT 2 December 29, 2007 08:13
does FIDAP support other postprocess software? ztdep FLUENT 0 April 13, 2006 10:35
about transient postprocess problems limingtiger Siemens 0 September 10, 2005 20:37


All times are GMT -4. The time now is 16:33.