CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Viscosity UDF Gives different Results to fluent Model?

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

LinkBack Thread Tools Search this Thread Display Modes
Old   March 28, 2019, 07:52
Default Viscosity UDF Gives different Results to fluent Model?
Join Date: Mar 2019
Posts: 34
Rep Power: 6
bloodflow is on a distinguished road
Hi All.

I am examining many different viscosity models through UDF's in Fluent. I have written a UDF for the Carreau model even though it is in Fluent. When I run 2 identical simulations, one using my UDF for Carreau Viscosity, the other using Fluents inbuilt model, they give different results. This is implying my UDF's are not working as intended, and are likely wrong for the other models. Is there a reaosn why this UDF doesnt implement the Carreau model? (both models use the same values for max/min shear visco, lambda and n.)

Could this be because of the rounding errors in my code? Would it be more accurate to use "double" instead of "float"?

/* Carreau (p=2) Viscosity Model */

#include "udf.h"

float muinf=0.00345;
float mu0=0.056;
float lambda=3.313;
float p=2;
float n=0.3568;

real diff;
real shear;
real prod;
real power;
real visco;
return visco;

Last edited by bloodflow; March 28, 2019 at 10:54.
bloodflow is offline   Reply With Quote

Old   March 28, 2019, 20:11
Senior Member
Join Date: Apr 2013
Posts: 2,259
Rep Power: 33
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
Would it be more accurate to use "double" instead of "float"?
why did you ask? try it. Change everything to real.

best regards
AlexanderZ is offline   Reply With Quote


carreau, fluent, udf, viscosity

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Use of k-epsilon and k-omega Models Jade M Main CFD Forum 40 January 27, 2023 07:18
How to solve UDF compilation problems in Fluent. pakk Fluent UDF and Scheme Programming 16 September 10, 2018 02:48
standard wall function UDF fluent (k-omega model) alinik Fluent UDF and Scheme Programming 0 April 27, 2017 18:05
Fluent Radiation/porous media Schmitt pierre-Louis FLUENT 26 September 1, 2016 10:29
Wrong flow in ratating domain problem Sanyo CFX 17 August 15, 2015 06:20

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