|
[Sponsors] |
December 15, 2011, 09:56 |
udf to adjust pressure
|
#1 |
New Member
Join Date: Dec 2011
Posts: 9
Rep Power: 15 |
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: 17 |
Why not using Solution Limits?
Set Minimum Pressure. |
|
December 16, 2011, 11:45 |
|
#3 |
New Member
Join Date: Dec 2011
Posts: 9
Rep Power: 15 |
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: 15 |
anybody some suggestions please , it would be of great help!!
|
|
December 23, 2011, 04:50 |
|
#5 |
Senior Member
duri
Join Date: May 2010
Posts: 245
Rep Power: 17 |
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: 15 |
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: 245
Rep Power: 17 |
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: 15 |
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: 245
Rep Power: 17 |
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: 15 |
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, 06:12 |
Use DEFINE_EXECUTE_AT_END
|
#11 |
New Member
|
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! |
|
May 1, 2012, 11:59 |
|
#12 |
New Member
Join Date: Dec 2011
Posts: 9
Rep Power: 15 |
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, 12:02 |
my email
|
#13 |
New Member
|
||
June 8, 2014, 14:40 |
|
#14 | |
New Member
Marco Dc
Join Date: Feb 2014
Location: Italy
Posts: 20
Rep Power: 12 |
Quote:
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 |
||
July 24, 2017, 09:41 |
|
#15 |
New Member
Duyikang
Join Date: Jun 2015
Location: Wuhan,China
Posts: 4
Rep Power: 11 |
hello, I have tried the macro command of define_adjust to change the negative pressure to zero,but i can't make it.Now, i don't know the why.
DEFINE_ADJUST(adjust_pressure,domain) { Thread *t; cell_t c; thread_loop_c(t,domain) { begin_c_loop(c,t) { if(C_P(c, t) < 0) { C_P(c, t) = 0; } } end_c_loop(c,t) } } |
|
December 5, 2018, 12:02 |
|
#16 |
Member
MEK
Join Date: Oct 2016
Posts: 39
Rep Power: 10 |
Can someone tell me where to hook define adjust UDF for pressure change in domain
Currently I m compiling the UDF and hooking it with define adjust next I don't know where to implement this UDF for pressure correction. e.g define source udf is hooked in source term tab. But in this case I don't know. Thank in advance |
|
December 5, 2018, 15:43 |
|
#17 | |
New Member
Sanket Dange
Join Date: Jul 2013
Posts: 9
Rep Power: 13 |
Quote:
Define -> User-Defined -> Function Hooks -> Adjust Define_Adjust is used to work over whole domain and after every iteration. So there is no need to hook it in specific boundary face or even in a cell zone. |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Accelerating pre and checking the mfr at exit how to hook udf to Pressure inlet(BC) | kokoory | Fluent UDF and Scheme Programming | 0 | August 17, 2011 09:20 |
UDF for transient pressure inlet, mass flow check at nozzle exit and volumetric heat | kokoory | FLUENT | 0 | August 17, 2011 03:07 |
Pressure profile UDF for unsteady-state problem? | Mohsen Keshavarzian | FLUENT | 2 | August 20, 2008 05:22 |
ADJUST udf | Jubs | FLUENT | 3 | February 12, 2007 07:00 |
Neumann pressure BC and velocity field | Antech | Main CFD Forum | 0 | April 25, 2006 03:15 |