# UDF problems

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

 August 12, 2005, 12:09 Re: UDF problems #2 pUl| Guest   Posts: n/a hmm, they (fluent) recommend running some ScalarReconstruction routine to allocate memory internally when calculating the gradients of volume fraction. I'm not sure whether this is applicable to temperature gradients as well but it is worth a try. If you have access to the OTS, please check solution 982 to see what I mean.

 August 12, 2005, 12:32 Re: UDF problems #3 Winnie Guest   Posts: n/a Thank you! Forgive my ignorance, what is OTS? Winnie

 August 12, 2005, 12:33 Re: UDF problems #4 pUl| Guest   Posts: n/a Online Technical Support (http://clarify.fluent.com/eSupport)

 August 12, 2005, 12:47 Re: UDF problems #5 Winnie Guest   Posts: n/a Thanks. I tried the reconstruction gradient and it still doesn't work. I don't have an account of OTS since I am a student. Can you provide more information? Thanks again. Winnie

 August 12, 2005, 12:48 Re: UDF problems #6 pUl| Guest   Posts: n/a Here is an example: #include "udf.h" #define CON 1 DEFINE_ADJUST(store_gradient, domain) { Thread *t; Thread **pt; cell_t c; int phase_domain_index = 0.; Domain *pDomain = DOMAIN_SUB_DOMAIN(domain,phase_domain_index); { Alloc_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_N ULL); Scalar_Reconstruction(pDomain, SV_VOF,-1,SV_VOF_RG,NULL); Scalar_Derivatives(pDomain,SV_VOF,-1,SV_VOF_G,SV_VOF_RG, Vof_Deriv_Accumulate); } mp_thread_loop_c (t,domain,pt) if (FLUID_THREAD_P(t)) { Thread *ppt = pt[phase_domain_index]; begin_c_loop (c,t) { C_UDMI(c,t,0) = C_VOF_G(c,ppt)[0]; } end_c_loop (c,t) } Free_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_NU LL); } Arjun Jayakumar likes this.

 August 12, 2005, 12:55 Re: UDF problems #7 dirk Guest   Posts: n/a The temperature gradient is not stored by default. In the TUI go to "solve set expert" and disable "keep temporary solver memory from being freed". Then you should be able to use temperature gradients. Dirk

 August 12, 2005, 12:57 Re: UDF problems #8 Winnie Guest   Posts: n/a Hi, Thanks a lot! I think this case is quite more complex than mine since I am working on single phase flow. I have got a converged solution for my problem, but I need know the intersection angle, therefore, I used UDF. I allocate a user defined memory, and compiles this code into FLUENT. Is DEFINE_ADJUST macro used right? Can you give me some other advices other than the method I used? Thank you. Winnie

 August 12, 2005, 13:00 Re: UDF problems #9 pUl| Guest   Posts: n/a Try what dirk says first. When you use the UDF, are you also hooking up the adjust function to the solver?

 August 12, 2005, 13:03 Re: UDF problems #10 Winnie Guest   Posts: n/a Do you mean 'disable'? I checked it, it is 'no'. Any more suggestions? Thank you Winnie

 August 12, 2005, 13:08 Re: UDF problems #11 dirk Guest   Posts: n/a Sorry, it has to be "enable", so you have to set it to "yes".

 August 12, 2005, 13:10 Re: UDF problems #12 Winnie Guest   Posts: n/a No, it didn't work. I didn't change the default set in FLUENT. I think adjust function is not hookedto the solver. Winnie

 August 12, 2005, 13:12 Re: UDF problems #13 Winnie Guest   Posts: n/a I tried both. But it didn't work. What does that mean? If I disabled it, then the temperature gradient will not be calcualted by solver? Thanks. Winnie

 August 12, 2005, 13:19 Re: UDF problems #14 dirk Guest   Posts: n/a The temperature gradient is calculated but you can only access it while energy equation is solved. If you let Fluent store the gradients with the command I told then you can access the gradients at any time. But you have to make at least one iteration after you set that command and then execute your UDF. It should work then in my opinion. Dirk

 August 12, 2005, 13:44 Re: UDF problems #15 Winnie Guest   Posts: n/a Thanks, dirk I have tried. And still can not solve the problem. What do you think of my code? Do you think it is OK for calculating the intersection angle between the velocity and the temperature gradient? Thank you for the help. Winnie

 August 12, 2005, 17:03 Re: UDF problems #16 dirk Guest   Posts: n/a I just tried your UDF. It seems to work as I get non zero values for UDM 0. By the way, what is the physical sense of this intersection angle ?

 August 13, 2005, 04:53 UDF problems #17 Firas Guest   Posts: n/a Hi iam just starting with UDF i used unsteady BC for velocity inlet that mentioned in manual i stored the file at C:\ when asking program to cpompile the file he cant read first line #include "udf.h" the qustion should i have cpp compiler to do calaculation and if not what to do. Best regards

 August 13, 2005, 05:33 Re: UDF problems #18 Firas Guest   Posts: n/a dear all when i run on of the manual example i have the following at line 1 that is include udf.h should i have c++ or what to do. thanks cpp -IC:\FLUENT.INC\fluent6.0/src -IC:\FLUENT.INC\fluent6.0/cortex/src -IC:\FLUENT.INC\fluent6.0/client/src -IC:\FLUENT.INC\fluent6.0/multiport/src -I. -DUDFCONFIG_H="" unsteadyError: unsteady: line 1: parse error.

 August 14, 2005, 06:29 Re: UDF problems #19 Winnie Guest   Posts: n/a I am trying to do the optomization to enhance the convective heat transfer. And lower this angle, the better the heat transfer rate. I still can't get the code work in my case, can you please tell me the detailed procedure you did? And does it have any relationship with the mesh? my mesh is irregular. Thank you. dirk. Winnie

 August 16, 2005, 07:47 Re: UDF problems #20 dirk Guest   Posts: n/a I took your file, hooked it as interpreted UDF, enabled the storage of the gradients, set the UDF as an adjust function, set the number of UDM to 1 and iterated. Maybe you should define it as an execute-on-demand, so it doesn't have to be executed after every iteration.

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Qureshi FLUENT 7 March 23, 2017 08:37 Kristin Fluent UDF and Scheme Programming 3 March 15, 2012 07:43 shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14 poiuy219 Main CFD Forum 0 April 30, 2009 10:43 S.Whitney FLUENT 0 October 15, 2007 11:29

All times are GMT -4. The time now is 03:27.