|
[Sponsors] |
June 8, 2005, 05:51 |
udfs'
|
#1 |
Guest
Posts: n/a
|
Hi all,
I wrote an udf: # include "udf.h" DEFINE_ADJUST(adjust_temp2, domain) { Thread *f_thread; face_t f; thread_loop_f(f_thread, domain) { Thread *t; begin_f_loop(f,t) { F_UDMI(f,t,0) = F_T(f,t); } end_f_loop(f,t) } } It was compiled and run successfully, but when I checked the result, the udm-0 is zero everywhere. I'm sure that the Energy Equation is enabled. Could somebody tell me why this happend? Best regards! Benny |
|
June 8, 2005, 07:42 |
Re: udfs'
|
#2 |
Guest
Posts: n/a
|
Hi Benny
you need to store the values using C_UDMI(c,t,i). Fluent stores all variables at cell centres not at faces. So change your UDF to cell loop and should work |
|
June 8, 2005, 22:13 |
Re: udfs'
|
#3 |
Guest
Posts: n/a
|
hi Alec Eiffel,
I'm sorry to say that I feel doubt what you said. In the definition of F_UDMI(f,t,i), it reads: stores data in user-defined face memory location for given index. But I thank you very much for your suggestion! Best regards! Benny |
|
June 9, 2005, 06:23 |
Re: udfs'
|
#4 |
Guest
Posts: n/a
|
yes but it also reads: Note that F_UDMI is available for boundary and wall faces, only.
It wont work for faces inside the domain only at boundarys |
|
June 9, 2005, 12:33 |
Re: udfs'
|
#5 |
Guest
Posts: n/a
|
What I want to know is temperature on the wall. But I found that the udm-0 is equal to 0 everywhere. How could get it?
|
|
June 9, 2005, 14:34 |
Re: udfs'
|
#6 |
Guest
Posts: n/a
|
In this case, you need to specify the address of that wall in your udf. Use following in your UDF at the beginning to get the same. domain = Get_Domain(domain_ID);
Also, put begin_loop inside thread_loop_f(t,domain) loop to perform begin loop operation on threads of perticular domain. Regards, -US |
|
June 9, 2005, 21:57 |
Re: udfs'
|
#7 |
Guest
Posts: n/a
|
dear us, Thank you very much for your suggestion! But what kind of looping macro 'begin_loop' is? Should it be begin_f_loop or others? Thank you!
Regards! Benny |
|
June 9, 2005, 23:40 |
Re: udfs'
|
#8 |
Guest
Posts: n/a
|
BTW, if my case is single phase, is the domain_ID equal to 1?
|
|
June 10, 2005, 11:25 |
Re: udfs'
|
#9 |
Guest
Posts: n/a
|
DEFINE_ADJUST(read_ur_file, domain) {
Thread *t; face_t f; t = Lookup_Thread(domain,wall_thread_ids["n ???"]); begin_f_loop(f,t) { F_UDMI(f,t,0) = F_T(f,t); } end_f_loop(f,t) } } |
|
June 10, 2005, 11:26 |
Re: udfs'
|
#10 |
Guest
Posts: n/a
|
Domain ID is the ID that is assigned to each zone. For example, wall, velocity inlet, velocity outlet etc each has unique domain ID. So when you open boundary condition panel and select the wall you are interested in, you will see its domain id at the bottom of right hand part of the same panel.
Yes, with 'begin_loop', i meant with that was begin_f_loop.Sorry about that. begin_f_loop(f, f_thread) /* loops over faces in a face thread */ { } end_f_loop(f, f_thread) Regards, -US |
|
June 13, 2005, 09:19 |
Re: udfs'
|
#11 |
Guest
Posts: n/a
|
|
|
June 13, 2005, 23:21 |
Re: udfs'
|
#12 |
Guest
Posts: n/a
|
Dear all,
Now I have no diea. I followed what you said to write the udf, but udm-o is still equal to 0. What should I do? Could soembody write a udf for me to check a variable , suych as temperature, on the wall? Thank you ahead! Benny |
|
June 14, 2005, 12:08 |
Re: udfs'
|
#13 |
Guest
Posts: n/a
|
Hi Benny,
One more suggestion to try. I looked at your UDF. You use DEFINE_ADJUST. I would say you better use following UDF. You may want to know the reason why? DEFINE_ADJUST udf is executed at the start of iteration. Or in the case of unsteady problem, at the start of new time timestep. While, DEFINE_EXECUTE_AT_END udf is executed at the end of iteration(means after the calculation is complete). So what i think is, when you try to store values in UDM using DEFINE_ADJUST, there is probably no value of temperature to be stored in your UDM since it is the start of iteration or new timestep. So try using following UDF. Hope this works out. In my openion it should definitely work out. ------------------ #include "udf.h" DEFINE_EXECUTE_AT_END(execute_at_end) { Domain *d; Thread *t; face_t f; d = Get_Domain(wall_domain_no); /* wall domain for yr temp*/ thread_loop_f(t,d) { begin_f_loop(f,t) F_UDMI(f,t,0) = F_T(f,t); end_f_loop(f,t) } } ----------------- |
|
June 19, 2005, 23:48 |
Re: udfs'
|
#14 |
Guest
Posts: n/a
|
Dear us, I follow your suggestion, and write the udf as following:
# include "udf.h" DEFINE_EXECUTE_AT_END(execute_at_end) { Domain *d; Thread *f_thread; face_t f; d = Get_Domain(3); /* the wall zone ID is 3*/ thread_loop_f(f_thread,d) { begin_f_loop(f,f_thread) { F_UDMI(f,f_thread,0) = F_T(f,f_thread); } end_f_loop(f,f_thread) } } But when I run it, it gives error message and cease to run. Do you know why? |
|
June 20, 2005, 14:50 |
Re: udfs'
|
#15 |
Guest
Posts: n/a
|
UDF seems ok. Are you able to compile it and load the same successfully? or you get the compilation error. What error? One more question, you want to know the temp. at wall. Now, wall is the solid boundary of your domain, right? So what kind of boundary condition you hv specified there for temp or energy eqn? Just trying to understand your case.
|
|
June 20, 2005, 21:27 |
Re: udfs'
|
#16 |
Guest
Posts: n/a
|
Yes, I have compiled it and loaded it successfully. But when I run it, it reads: Error: FLUENT received fatal signal (ACCESS_VIOLATION) 1. Note exact events leading to error. 2. Save case/data under new name. 3. Exit program and restart to continue. 4. Report error to your distributor. Error Object: () I think it's common error message, so I found nothing useful info. My case is simple, a circular duct with heat flux on its wall, and the thickness of the wall is zero.
|
|
June 21, 2005, 11:34 |
Re: udfs'
|
#17 |
Guest
Posts: n/a
|
Have you activated UDM in Define/User-defined/Memory panel? You require to set it to 1. I hope you haven't forgotten to do so. Sometimes when we forget to do so we come up with such error. Just to confirm, you run your UDF through Define/User-defined/Function-hook panel, third drop-down text, named 'Execute at End', from the top. right? If all these things are ok, then UDF should be working. -US
|
|
June 21, 2005, 21:57 |
Re: udfs'
|
#18 |
Guest
Posts: n/a
|
I have done all of your suggestion, but it doesn't work. Can the udf be run on your computer?
|
|
June 22, 2005, 11:49 |
Re: udfs'
|
#19 |
Guest
Posts: n/a
|
I'll give a try today.
|
|
June 22, 2005, 22:52 |
Re: udfs'
|
#20 |
Guest
Posts: n/a
|
Dear us,
Thank you very much! Benny |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
problem using property udfs in parallel mode | EllenW | Fluent UDF and Scheme Programming | 5 | July 10, 2009 05:31 |
problem using property udfs in parallel mode | EllenW | FLUENT | 0 | June 23, 2009 18:18 |
Unsteady and Flux UDFs for UDSs | tom | FLUENT | 0 | February 13, 2009 11:27 |
Multiple UDFs | Graeme | FLUENT | 4 | August 28, 2004 16:47 |
Experimental Repository for UDFs, Journal Files and Scheme Scripts | Jonas Larsson | FLUENT | 0 | March 5, 2000 16:36 |