CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 28, 2019, 08:52
Default Viscosity UDF Gives different Results to fluent Model?
  #1
Member
 
Dave
Join Date: Mar 2019
Posts: 31
Rep Power: 3
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;

DEFINE_PROPERTY(cell_viscosity,c,t)
{
real diff;
real shear;
real prod;
real power;
real visco;
diff=(mu0-muinf);
prod=((lambda)*(C_STRAIN_RATE_MAG(c,t)));
shear=(1+(pow(prod,p)));
power=((n-1)/(p));
visco=((muinf)+(diff)*(pow(shear,power)));
return visco;
}

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

Old   March 28, 2019, 21:11
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 1,554
Rep Power: 21
AlexanderZ will become famous soon enough
Quote:
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

Reply

Tags
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 39 March 19, 2020 19:27
How to solve UDF compilation problems in Fluent. pakk Fluent UDF and Scheme Programming 16 September 10, 2018 03:48
standard wall function UDF fluent (k-omega model) alinik Fluent UDF and Scheme Programming 0 April 27, 2017 19:05
Fluent Radiation/porous media Schmitt pierre-Louis FLUENT 26 September 1, 2016 11:29
Wrong flow in ratating domain problem Sanyo CFX 17 August 15, 2015 07:20


All times are GMT -4. The time now is 13:49.