|
[Sponsors] |
April 10, 2006, 08:01 |
F_UDMI how to postprocess?
|
#1 |
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 { } } } |
|
April 20, 2006, 11:55 |
Re: F_UDMI how to postprocess?
|
#2 |
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.
|
|
April 20, 2006, 12:09 |
Re: F_UDMI how to postprocess?
|
#3 |
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 |
|
April 20, 2006, 16:54 |
Re: F_UDMI how to postprocess?
|
#4 |
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.
|
|
March 24, 2009, 04:17 |
|
#5 | |
New Member
liuxiao
Join Date: Mar 2009
Posts: 10
Rep Power: 17 |
Quote:
|
||
March 24, 2009, 04:59 |
|
#6 |
Senior Member
Max
Join Date: Mar 2009
Posts: 133
Rep Power: 17 |
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 |
|
November 25, 2009, 12:50 |
|
#7 |
Senior Member
isabel
Join Date: Apr 2009
Location: Spain
Posts: 171
Rep Power: 17 |
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)
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 ??? |
|
November 26, 2009, 04:37 |
|
#8 |
New Member
Agnieszka
Join Date: Jul 2009
Posts: 4
Rep Power: 17 |
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 |
|
November 26, 2009, 06:59 |
|
#9 | |
Senior Member
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20 |
Quote:
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 |
||
November 26, 2009, 07:04 |
|
#10 | |
Senior Member
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20 |
Quote:
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! |
||
November 26, 2009, 07:14 |
|
#11 |
Senior Member
isabel
Join Date: Apr 2009
Location: Spain
Posts: 171
Rep Power: 17 |
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) } } |
|
November 26, 2009, 07:35 |
|
#12 |
Senior Member
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20 |
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); Code:
if(N_UDM > 0 && BOUNDARY_FACE_THREAD_P(t)) F_UDMI(f,t,0)=10*F_T(f,t); |
|
November 26, 2009, 08:09 |
|
#13 |
Senior Member
isabel
Join Date: Apr 2009
Location: Spain
Posts: 171
Rep Power: 17 |
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) } } |
|
November 27, 2009, 03:41 |
|
#14 |
Senior Member
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20 |
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.
|
|
November 30, 2012, 11:35 |
|
#15 | |
Senior Member
Join Date: May 2011
Posts: 231
Rep Power: 16 |
Quote:
Hi, it seems like F_UDMI doesnt save anything! value is always "0"! is there any one who can explain this? thanks in advance! |
||
December 1, 2012, 05:21 |
|
#16 |
Senior Member
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20 |
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.
|
|
December 1, 2012, 07:33 |
|
#17 | |
Senior Member
Join Date: May 2011
Posts: 231
Rep Power: 16 |
Quote:
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); } |
||
December 8, 2012, 21:15 |
|
#18 |
Senior Member
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20 |
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". |
|
January 18, 2013, 05:24 |
C_udmi
|
#19 |
Senior Member
Join Date: May 2011
Posts: 231
Rep Power: 16 |
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!!! |
|
January 19, 2013, 20:00 |
|
#20 |
Senior Member
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20 |
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'.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
CFX results postprocess in Tecplot | seaharrier | CFX | 5 | April 18, 2019 02:01 |
SOS, postprocess aspect ratio | hedonist | FLUENT | 3 | September 1, 2010 11:02 |
How to make Disproportional Figures - Postprocess. | mrt | FLUENT | 2 | December 29, 2007 09:13 |
does FIDAP support other postprocess software? | ztdep | FLUENT | 0 | April 13, 2006 11:35 |
about transient postprocess problems | limingtiger | Siemens | 0 | September 10, 2005 21:37 |