CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

UDF to visualize the cavitation source term: getting a very strange result!!!

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 5, 2015, 06:05
Default UDF to visualize the cavitation source term: getting a very strange result!!!
  #1
Member
 
Anh
Join Date: Sep 2014
Posts: 69
Rep Power: 11
dinhanh is on a distinguished road
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.
Attached Images
File Type: jpg void_fraction.jpg (11.1 KB, 14 views)
File Type: jpg condensation.jpg (9.3 KB, 11 views)
dinhanh is offline   Reply With Quote

Old   June 6, 2015, 10:29
Default
  #2
Member
 
Anh
Join Date: Sep 2014
Posts: 69
Rep Power: 11
dinhanh is on a distinguished road
Anyone please help!!
dinhanh is offline   Reply With Quote

Reply


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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 15:14
Accessing phase volm fraction in UDF for a source term in mixture model aditya.pandare Fluent UDF and Scheme Programming 9 March 20, 2013 23:38
UDF Source Term Christian FLUENT 4 August 1, 2009 05:53
UDF - Source Term Question Jacques FLUENT 0 December 8, 2008 13:40
The source term of UDF summer FLUENT 0 August 24, 2006 17:44


All times are GMT -4. The time now is 02:11.