CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Need UDF for determination ofpressures in hydrodynamic journal bearing (https://www.cfd-online.com/Forums/fluent-udf/102830-need-udf-determination-ofpressures-hydrodynamic-journal-bearing.html)

Dinesh_Dhande June 4, 2012 04:22

Need UDF for determination ofpressures in hydrodynamic journal bearing
 
Hi Friends,
I want to simulate the pressures generated in hydrodynamic journal bearing. Can anyone help me? I need either tutorial or the ready made UDF for the same or the link where i will get help.
Also i want to convert fortran program on bearing in UDF. How to do that? Kindly help.
Thanks in advance.

Far September 25, 2018 12:14

There are two udfs which can help you.

First is about pressure control at the end of each iteration etc

Code:

#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)
}


}

Second will model viscosity as function of temperature


Code:

/*        **********************************************************        */
/*                                                                    */
/* User-Defined Functions for temperature-dependent viscosity        */
/* FLUENT 16.0                                                        */
/*                                                                    */
/* Author: FARCFD  farcfd@gmail.com                                            */
/* Date: August 16, 2015                                              */
/*                                                                    */
/* ************************************************************ */



#include "udf.h"

DEFINE_PROPERTY(cell_viscosity, c, t)


{
       
real mu_laminar, temp, pres;

temp = C_T(c, t);

pres = C_P(c, t);

mu_laminar = 0.0127*exp(0.000000213345*(pres-101345))*exp(0.029*(temp-293));

return mu_laminar;


}



All times are GMT -4. The time now is 09:16.