|
[Sponsors] |
UDF to visualize the cavitation source term: getting a very strange result!!! |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 5, 2015, 07:05 |
UDF to visualize the cavitation source term: getting a very strange result!!!
|
#1 |
Member
Anh
Join Date: Sep 2014
Posts: 72
Rep Power: 12 |
Dear Fluent-user,
I wrote the UDF file to visualize the cavitation source term. In that: if P(c,t)>Pv the condensation occurs, else, the evaporation occurs. However, the visualization from my UDF, the condensation occurs even P(c,t)<Pv. I do not find the exist problem in the code. The code is following: #include "udf.h" #include "math.h" #include "mem.h" #include "sg_mem.h" #define rho_V 0.0163 #define rho_L 998.4 #define pv 2198.0 DEFINE_ADJUST(Singhal_model,d) { d=Get_Domain(1); Thread *t; cell_t c; double gamma,pv_t,eva,con,n,Rb; thread_loop_c(t,d) { begin_c_loop(c,t) { eva=0.0; con=0.0; pv_t=0.0; gamma =(C_R(c,t)-rho_L)/(rho_V-rho_L); pv_t=pv+0.5*0.39*C_R(c,t)*C_K(c,t); n=pow(10.0,13.0); if(gamma<0.0001) { gamma=0.0001; } Rb=pow(gamma/(1.0-gamma)*3.0/4.0/3.14/n,(1.0/3.0)); if(pv_t!=C_P(c,t)) { eva=MAX(0.0,(pv_t-C_P(c,t)))/fabs(pv_t-C_P(c,t))*sqrt(C_K(c,t))/gamma/sqrt(C_R(c,t))*Rb; con=MAX(0.0,(-pv_t+C_P(c,t)))/fabs(pv_t-C_P(c,t))*sqrt(C_K(c,t))/(1.0-gamma)*Rb; } C_UDMI(c,t,0)=eva; C_UDMI(c,t,1)=con; } end_c_loop(c,t) } } Someone please help me!!! It is very importance for my work. Thank you very much. |
|
June 6, 2015, 11:29 |
|
#2 |
Member
Anh
Join Date: Sep 2014
Posts: 72
Rep Power: 12 |
Anyone please help!!
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] Swak4FOAM 0.2.3 / OF2.2.x installation error | FerdiFuchs | OpenFOAM Community Contributions | 27 | April 16, 2014 16:14 |
Accessing phase volm fraction in UDF for a source term in mixture model | aditya.pandare | Fluent UDF and Scheme Programming | 9 | March 21, 2013 00:38 |
UDF Source Term | Christian | FLUENT | 4 | August 1, 2009 06:53 |
UDF - Source Term Question | Jacques | FLUENT | 0 | December 8, 2008 14:40 |
The source term of UDF | summer | FLUENT | 0 | August 24, 2006 18:44 |