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

How to make UDF for the spatial variation of viscosity?

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 12, 2019, 13:46
Default How to make UDF for the spatial variation of viscosity?
  #1
New Member
 
Nitesh Dubey
Join Date: Jun 2018
Posts: 4
Rep Power: 3
Nitesh_CMG_GUY is on a distinguished road
Hi,

Need a small help. I am looking for a UDF for the spatial variation of viscosity. Viscosity is varying in two directions (say X and Z). I tried but when I am loading in the fluent. Simulation showing floating point exception error.

/************************************************** *******************
UDF that simulates spatially dependent viscosity property
************************************************** ********************/
#include "udf.h"
#define a 20105467790.5412
#define b 2.692576799425
#define c 5083.56137738767
#define d -84995.6051593393
#define e -2230225.26461472
#define f 852890049.062181
#define g 502636694.742164

DEFINE_PROPERTY(cell_viscosity, cell,thread)
{
real mu;
real y, z;
real ZB[ND_ND];
C_CENTROID(ZB,cell,thread);

y=ZB[1]; /* y cooridnate*/
z=ZB[2]; /* z cooridnate*/

mu=1.21 - 2.71*(a + b*(z-0.006) + c*pow(z-0.006,2.) + d*pow(z-0.006,3.) + e*pow(z-0.006,4.) + f*pow(z-0.006,5.) + g/(y+0.52347)) +
25.46*pow((a + b*(z-0.006) + c*pow(z-0.006,2.) + d*pow(z-0.006,3.) + e*pow(z-0.006,4.) + f*pow(z-0.006,5.) + g/(y+0.52347)),2.);
return mu;

}

Is there any problem in this UDF?
Nitesh_CMG_GUY is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fluid turns into solid at given T (via viscosity UDF or solidifcation model?) jpina FLUENT 1 April 3, 2016 03:48
Problems in converging viscosity UDF dependent upon strain rate and temperature. alexskerhut Fluent UDF and Scheme Programming 1 March 17, 2016 07:19
UDF for Turbulent Viscosity Lourival Fluent UDF and Scheme Programming 3 October 13, 2012 03:09
Help - UDF for solid shear viscosity nbh2801 FLUENT 0 April 21, 2006 07:49
Turbulent Viscosity UDF Raphael FLUENT 2 January 23, 2006 04:04


All times are GMT -4. The time now is 20:12.