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

error in udf of property

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 28, 2020, 07:50
Default error in udf of property
  #1
Senior Member
 
Zese
Join Date: Sep 2013
Posts: 102
Rep Power: 12
zese is on a distinguished road
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;
}
Attached Images
File Type: jpg Untitled.jpg (14.2 KB, 2 views)
zese 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
Save output of udf in another udf! JuanJoMex FLUENT 0 February 8, 2018 12:43
FLUENT UDF for Variable Thermo-physical Property Simulation nh.cryo Fluent UDF and Scheme Programming 1 November 1, 2017 00:46
udf eror + Define property + density rezvan Fluent UDF and Scheme Programming 10 July 10, 2015 04:30
access to a property in a boundary condition using UDF Negin_Salehi Fluent UDF and Scheme Programming 3 November 16, 2012 16:11
I need UDF help. S.Whitney FLUENT 0 October 15, 2007 11:29


All times are GMT -4. The time now is 15:27.