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

Problems in converging viscosity UDF dependent upon strain rate and temperature.

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 17, 2016, 06:33
Default Problems in converging viscosity UDF dependent upon strain rate and temperature.
  #1
New Member
 
Alex Skerhut
Join Date: Mar 2016
Posts: 10
Rep Power: 10
alexskerhut is on a distinguished road
Hi,
I am interpreting a viscosity UDF which is dependent upon temperature and strain rate. The UDF interprets fine but does not lead to convergence and starts diverging from the very start and does not run even a single iteration. My UDF is as follows:

#include<udf.h>
DEFINE_PROPERTY(cell_viscosity,c,t)
{
double stress = 22.22e+06;
double A = 8.86e+06;
double energy = 145000;
double R = 8.314;
double n = 3.55;
double mu_laminar,temp,strainrate,Z,D,E,F;
temp= C_T(c,t);
strainrate= C_STRAIN_RATE_MAG(c,t);
Z= strainrate*exp(energy/(R*temp));
D= pow((Z/A),(1/n));
E= pow((Z/A),(2/n));
F= pow(E+1,0.5);
mu_laminar= (stress*log(D+F))/(3*strainrate);
return mu_laminar;
}

A similar viscosity model named carreau dependent upon strainrate and temperature converges fine but my udf does not even start iterating. It gives the error message

#Divergence detected in AM solver: x-momentum - Increasing relaxation sweeps!

Kindly help me in this my complete project depends upon the successful implementation of the viscosity UDF.
alexskerhut is offline   Reply With Quote

Old   March 17, 2016, 07:19
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
Print the values to your screen.
Code:
Message("Z,D,E,F: %f,%f,%f,%f\n",Z,D,E,F);
Message("Mu: %f\n",mu_laminar);
return mu_laminar;
(If I remember the syntax correctly, otherwise check the manual.)

Then check if the values that are shown agree to what you want. If they don't, find out why not and fix your equations.
pakk is offline   Reply With Quote

Reply

Tags
fluent - udf, udf and programming, udf compile, udf eror


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
[openSmoke] libOpenSMOKE Tobi OpenFOAM Community Contributions 562 January 25, 2023 09:21
Ansys CFX problem: unexpected very high temperatures in premix laminar combustion faizan_habib7 CFX 4 February 1, 2016 17:00
Time and temperature dependent viscosity sur4j OpenFOAM 16 January 12, 2015 00:56
Temperature dependent Non-Newtonian viscosity UDF cric92 Fluent UDF and Scheme Programming 0 April 14, 2013 06:31


All times are GMT -4. The time now is 07:59.