# Problem with implicit equations in UDF

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 LinkBack Thread Tools Display Modes
 March 1, 2013, 16:31 Problem with implicit equations in UDF #1 New Member   Join Date: Sep 2012 Posts: 11 Rep Power: 6 Hi friends, I am a new user of FLUENT and UDF programming... I need a UDF that calculates a system of implicit equations, like: x1=a+b*(x1+x2+x3) x2=a+b*(x1+x2+x3) x3=a+b*(x1+x2+x3) I am sketching a code that, I think, could do this work. What I have is: DEFINE_ADJUST(my_adjust, domain) { Thread *thread; cell_t cell; thread_loop_c(thread, domain) { begin_c_loop_all(cell, thread) { C_UDMI(cell,thread,0) = 1. + C_UDMI(cell,thread,3); C_UDMI(cell,thread,1) = 2. + C_UDMI(cell,thread,3); C_UDMI(cell,thread,2) = 3. + C_UDMI(cell,thread,3); C_UDMI(cell,thread,3) = C_UDMI(cell,thread,0) + C_UDMI(cell,thread,1) + C_UDMI(cell,thread,2); } end_c_loop_all(cell, thread) } } I am able to compile it in FLUENT and initialize it, but when I run the iterations the program simply crashes... so, I think I am doing something pretty wrong. Could anyone please help me on this? Observation: This code is meant to be used in mass transfer in multiphase simulations. Best Regards, NPat

 March 2, 2013, 05:06 #2 Senior Member   SSL Join Date: Oct 2012 Posts: 227 Rep Power: 7 delete "_all" just use "begin_c_loop"

 March 2, 2013, 09:17 #3 New Member   Join Date: Sep 2012 Posts: 11 Rep Power: 6 Thank you, Sir. I was able to get this code working, but it seems to be sensitive of the constants, since large values lead to what seems to be an infinity loop and FLUENT crashes. However, small values for the constants allow for good results. Anyway, if someone else has another suggestion, it would be very approciated! BR NPat

 March 2, 2013, 09:26 #4 New Member   Join Date: Sep 2012 Posts: 11 Rep Power: 6 Just one more detail... The use of "begin_c_loop_all" or just "begin_c_loop" seems to don't have effect on the results. BR NPat

 March 3, 2013, 06:16 #5 Senior Member   SSL Join Date: Oct 2012 Posts: 227 Rep Power: 7 It should be checked precisely.

 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 Rizwan Fluent UDF and Scheme Programming 32 May 8, 2015 06:05 Demonwolf Main CFD Forum 1 June 15, 2009 14:21 akr FLUENT 3 August 22, 2007 07:14 speedcat FLUENT 1 May 16, 2005 03:09 Z FLUENT 0 February 16, 2005 04:34

All times are GMT -4. The time now is 00:56.

 Contact Us - CFD Online - Top