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

 December 15, 2011, 09:56 udf to adjust pressure #1 New Member   Join Date: Dec 2011 Posts: 9 Rep Power: 6 I'm presently analyzing fluid flow in hydrodynamic bearings. As some people know at some points the pressure drops below zero. I'm good at fluent but I don't have much idea about UDF's. What I need is a UDF which can analyze pressures in all cells after each iteration and make those pressure values equal to zero which are < 0. I'm going through the tutorials but i can't find relevant example which would be similar to this problem so that I can start working on it. Any suggestions and help would be of great help!

 December 15, 2011, 23:42 #2 Member     Join Date: Apr 2009 Posts: 46 Rep Power: 9 Why not using Solution Limits? Set Minimum Pressure.

 December 16, 2011, 11:45 #3 New Member   Join Date: Dec 2011 Posts: 9 Rep Power: 6 I have tried that but somehow there seems to be no effect of that on end solution.

 December 20, 2011, 13:36 #4 New Member   Join Date: Dec 2011 Posts: 9 Rep Power: 6 anybody some suggestions please , it would be of great help!!

 December 23, 2011, 04:50 #5 Senior Member   duri Join Date: May 2010 Posts: 160 Rep Power: 8 There is nothing wrong with negative pressure for a pressure based solver. If you try to adjust the pressure it may end up in wrong results. Whatever it is, this udf does the job what you need. you can put some print statements to check pressure values in the udf. After building udf hook it to adjust. #include "udf.h" DEFINE_ADJUST(pres_cor,d) { Thread *t; cell_t c; printf("inside pres_cor"); thread_loop_c(t,d) { begin_c_loop(c,t) { if(C_P(c,t)<0) C_P(c,t)=0; }end_c_loop(c,t) } }

 December 23, 2011, 13:51 #6 New Member   Join Date: Dec 2011 Posts: 9 Rep Power: 6 Thanks for the reply.I have tried something like your udf only but still it left some parts with -ve pressure. Tried your udf its the same result again some parts still have -ve pressure. The thing is while calculating the load carrying capacity the -ve pressures are to be ignored and all +ve pressures need to be integrated. I have standard values of load carrying capacities from diff texts for bench marking. Previously I solved slider bearings on FLUENT, the results were 99% in tune with textbook values but journal is giving me hard time since the pressure is +ve for 1st half and -ve for second half so practically load carrying capacity becomes zero! In theory -ve pressures are ignored for some reason! I hope u understand my problem fully now. Define Adjust doesn't seem to solve the problem but it has some effect. Last edited by chandu143; December 23, 2011 at 14:07.

 December 23, 2011, 16:14 #7 Senior Member   duri Join Date: May 2010 Posts: 160 Rep Power: 8 I don't know how loads are calculated in bearings. In general, for eg., when you are calculating load along x-direction it is P*mag(A). Integral of P.A will not work because P is tensor and direction of p is relative to the area normal. When p is +ve on one half and -ve on other half with a flip in area vector then you need to add the load on both half they won't cancel each other. I am very curious to know why do you ignore negative pressure. ok now to the udf, if you want to change pressure values for post processing. I hope the same routine should work under execute_on_demand. In this case after convergence simply run the udf once manually and update the pressure distribution for post processing.

 January 2, 2012, 14:24 #8 New Member   Join Date: Dec 2011 Posts: 9 Rep Power: 6 Sorry I got it wrong about the pressures actually what I had to do was take pressure value from last iteration and calculate error by comparing with present pressure . So I have a new doubt now :P How a value from last iteration can be passed on to present iteration? For example if I had to calculate difference between last iteration pressure and preset pressure, how can it be done?

 January 3, 2012, 00:01 #9 Senior Member   duri Join Date: May 2010 Posts: 160 Rep Power: 8 you can do it by using an user defined memory. Store the pressure value in UDM and then use it for next iteration. But, why do you want to do this way, upon convergence last and new pressure values will be same. Difference will go like continuity residuals.

February 27, 2012, 09:07
#10
New Member

Join Date: Dec 2011
Posts: 9
Rep Power: 6
Quote:
 Originally Posted by duri When p is +ve on one half and -ve on other half with a flip in area vector then you need to add the load on both half they won't cancel each other. I am very curious to know why do you ignore negative pressure.
Ya the problem is the basic definition of liquids. We can compress them to very high pressure with negligible compressibility. But we cannot go decreasing pressure of a liquid forever. Liquids have vapor pressures and when the negative pressure here reaches to that level cavitation sets in and there is no further change in pressure. For some reason fluent doesn't care about it and goes on decreasing pressure, here up to the maximum pressure created at least area of cross section. In theory we can neglect all negative pressures because the vapor pressure is very less compared to the pressures generated in fluid flow of journal bearings.

 May 1, 2012, 05:12 Use DEFINE_EXECUTE_AT_END #11 New Member   Luca Gorasso Join Date: Oct 2011 Location: Harbin, China Posts: 24 Rep Power: 7 I analyze Journal bearing too, and of course negative pressure is negligible, I use an UDF type DEFINE_EXECUTE_AT_END that loops around the cells and the faces at if the pressure is negative is changed in 0. #include "udf.h" DEFINE_EXECUTE_AT_END(RBC) { Domain *d; Thread *t; cell_t c; face_t f; d = Get_Domain(1); thread_loop_c(t,d) { begin_c_loop(c,t) { if (C_P(c,t)<=0.0) C_P(c,t)=0.0; } end_c_loop(c,t) } thread_loop_f(t,d) { begin_f_loop(c,t) { if (C_P(c,t)<=0.0) C_P(c,t)=0.0; } end_f_loop(c,t) } } If u analyse this bearings can u help me with some thing like meshing and boundary conditions, I will appreciate it so much. Thanks! sozen likes this.

 May 1, 2012, 10:59 #12 New Member   Join Date: Dec 2011 Posts: 9 Rep Power: 6 Well I mostly concentrated on inclined slider bearings. If you think I can help PM me i'll be more than happy to share my thoughts!

 May 1, 2012, 11:02 my email #13 New Member   Luca Gorasso Join Date: Oct 2011 Location: Harbin, China Posts: 24 Rep Power: 7 luca.gorasso@gmail.com very intersted.... i think we can share many things

June 8, 2014, 13:40
#14
New Member

Marco Dc
Join Date: Feb 2014
Location: Italy
Posts: 20
Rep Power: 4
Quote:
 Originally Posted by elcino I analyze Journal bearing too, and of course negative pressure is negligible, I use an UDF type DEFINE_EXECUTE_AT_END that loops around the cells and the faces at if the pressure is negative is changed in 0. #include "udf.h" DEFINE_EXECUTE_AT_END(RBC) { Domain *d; Thread *t; cell_t c; face_t f; d = Get_Domain(1); thread_loop_c(t,d) { begin_c_loop(c,t) { if (C_P(c,t)<=0.0) C_P(c,t)=0.0; } end_c_loop(c,t) } thread_loop_f(t,d) { begin_f_loop(c,t) { if (C_P(c,t)<=0.0) C_P(c,t)=0.0; } end_f_loop(c,t) } } If u analyse this bearings can u help me with some thing like meshing and boundary conditions, I will appreciate it so much. Thanks!
I have some problems with your udf, I've tryed to build mine udf and Access Violation error occured. Then I've tryed yours but i've got the same error.
I'm analysing Tilting Pad Bearings and i want to analyse differences between using Half Sommerfeld condition and using a Cavitation Model with cavitation pressure at patm value.
Can you give me an hint?
__________________
Marco

 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 kokoory Fluent UDF and Scheme Programming 0 August 17, 2011 08:20 kokoory FLUENT 0 August 17, 2011 02:07 Mohsen Keshavarzian FLUENT 2 August 20, 2008 04:22 Jubs FLUENT 3 February 12, 2007 07:00 Antech Main CFD Forum 0 April 25, 2006 02:15

All times are GMT -4. The time now is 23:36.