|
[Sponsors] |
June 28, 2020, 08:50 |
error in udf of property
|
#1 |
Senior Member
Zese
Join Date: Sep 2013
Posts: 106
Rep Power: 13 |
Dear Friends
I have to simulate an axisymmetric swirling flow and to prevent reversed flow from outlet, the paper proposed a variable Re number which decreases in a sponge region from the Re of flow to 0.1 at the outlet. To consider this, I tried to write a UDF for variable viscosity based on the formulation. the formula and the UDF are brought here but Fluent gives error when I interpret it. I already defined density and velocity as 1 to make it non-dimensional #include "udf.h" DEFINE_PROPERTY(cell_Viscosity,c,t) { double x,y,theta; real mu_lam,zita; real cellcentroid[ND_ND]; real pi=3.14159265; cell_t c; Thread *t; begin_c_loop(c,t) { C_CENTROID(cellcentroid,c,t); y=cellcentroid[1]; x=cellcentroid[0]; if (x<=40) mu_lam=0.00333; else { zita=0.5+0.5*tanh(4.0*tan(-(pi/2)+pi*abs(x-40.)/60.)); mu_lam=1./(300.0+(0.1-300.0)*zita); } } return mu_lam; } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Save output of udf in another udf! | JuanJoMex | FLUENT | 0 | February 8, 2018 13:43 |
FLUENT UDF for Variable Thermo-physical Property Simulation | nh.cryo | Fluent UDF and Scheme Programming | 1 | November 1, 2017 01:46 |
udf eror + Define property + density | rezvan | Fluent UDF and Scheme Programming | 10 | July 10, 2015 05:30 |
access to a property in a boundary condition using UDF | Negin_Salehi | Fluent UDF and Scheme Programming | 3 | November 16, 2012 17:11 |
I need UDF help. | S.Whitney | FLUENT | 0 | October 15, 2007 12:29 |