
[Sponsors] 
May 31, 2013, 10:10 
Suggestion on new dynamic viscosity expression in CFX

#1 
New Member
Titus Ofei
Join Date: Nov 2012
Posts: 13
Rep Power: 4 
Dear friends,
I am using ANSYS CFX version 14.0 and I want to model a different nonNewtonian fluid dynamic viscosity other than those provided in CFX. I wish to write them in either CEL or CCL (I don't know which is better). The dynamic viscosity is expressed as: (1exp(nu0*sstrnr/tau0))+((tau0/sstrnr)+K*sstrnr^(n1)) where nu0=1000 [Pa s] (viscosity at zero shear rate) sstrnr=shear strain rate (min=0.001, max=1000) [s^1] tau0=8 [Pa] (yield stress) n=0.30 (flow behavior index) K=6 [Pa s^0.30] (consistency index) I know CFX understands 'sstrnr', however, I do not know how to impose the limiting min, max condition. Your suggestion are greatly appreciated Titus 

June 1, 2013, 06:17 

#2 
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 11,079
Rep Power: 86 
Have a look at the available CEL expressions in the reference manual. It has functions "min" and "max", also if and step. Any of these can do this sort of thing.


June 1, 2013, 07:07 

#3 
Member
rasool
Join Date: Apr 2013
Posts: 41
Rep Power: 4 
hi
You must specify shear stress? shear stress @(your place) 

June 1, 2013, 07:20 

#4 
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 11,079
Rep Power: 86 
No, if you just use the sstnr variable by itself it means the local value at the point, and that is calculated for all points in the domain.


June 2, 2013, 00:08 

#5  
New Member
Titus Ofei
Join Date: Nov 2012
Posts: 13
Rep Power: 4 
Quote:
BTW is there any way I can get access to the existing code for HerschelBulkley viscosity in ANSYS CFX 14.0 and then modify it as a UDF? Thanks again Titus 

June 2, 2013, 06:12 

#6 
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 11,079
Rep Power: 86 
No way at all. It is in the source code and that is propriety.
If your modification is minor you could try using CEL variables for some of the input variables, but if your change is more fundamental you are going to have to write a new relation either as CEL or as fortran. 

June 3, 2013, 00:02 

#7 
New Member
Titus Ofei
Join Date: Nov 2012
Posts: 13
Rep Power: 4 
Hi Glenn, this is the error message I used to get any time I run with the defined dynamic viscosity:
(1exp(nu0*sstrnr/tau0))+((tau0/sstrnr)+K*sstrnr^(n1)) ++  ERROR #002100004 has occurred in subroutine Out_Scales_Flu.   Message:   The Reynolds number is outside of the range expected based on the   Option selected for the TURBULENCE MODEL. Check this setting,   the values of the properties, mesh scale, consistency of units   and solution values in the input file. Execution will proceed.  ++ Based on the given parameters, the flow should be laminar, however, the Reynolds number recorded shows it is in the turbulent regime. Domain Name : dratio 05 eccen 0 Global Length = 5.8254E02 Minimum Extent = 5.0800E02 Maximum Extent = 1.5240E01 Density = 7.9405E07 Velocity = 5.0000E01 Advection Time = 1.1651E01 Reynolds Number = 3.6682E+07 Even if I omit the first part of the viscosity equation, the classical HerschelBulkley equation remains [((tau0/sstrnr)+K*sstrnr^(n1))]; yet I do get similar errors. Any ideas please? thanks 

June 3, 2013, 01:56 

#8 
Senior Member
Lance
Join Date: Mar 2009
Posts: 548
Rep Power: 11 
That's only a warning, CFX guess the Re by the mean velocity, square root of the domain volume and mean density and viscosity. It can be miles off the Re you calculated. If you are sure that the Re is low enough for the flow to be laminar, then ignore the warning.


June 3, 2013, 06:32 

#9 
New Member
Titus Ofei
Join Date: Nov 2012
Posts: 13
Rep Power: 4 
Thanks Glenn. Very informative.


June 3, 2013, 08:08 

#10 
New Member
Titus Ofei
Join Date: Nov 2012
Posts: 13
Rep Power: 4 
Hi Glenn, one more thing. Please find attached a plot of dynamic viscosity vs. shear rate (gamma from 1E10 to 1E01). It can be seen that for shear rate of 1E10 and below, the dynamic viscosity is approx. zero (0) which will drastically increase the Reynolds number. Above that (1E10), the dynamic viscosity increases to a maximum (yield) and then decreases due to the shear thinning nature of the fluid.
That is why I wish I could bound my 'sstrnr' within the range of 1E03 to 1E+3 in the CEL which is a typical range for drilling fluids. These bounded range would produce the Reynolds number for laminar flow regime. Within the reference material, I couldn't find examples on how to impose 'max', 'min', 'if', or 'step' functions on 'sstrnr'. I hope to receive guidance on this. Thanks again for your patience. 

June 3, 2013, 08:16 

#11 
Senior Member
Lance
Join Date: Mar 2009
Posts: 548
Rep Power: 11 
a nested ifstatement that bounds sstrnr between 1e3 and 1e3:
if(sstrnr<1e3[s^1],1e3[s^1],if(sstrnr>1e3 [s^1],1e3[s^1],sstrnr)) (im not Glenn ) 

June 3, 2013, 08:16 

#12 
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 11,079
Rep Power: 86 
How about:
MinValue = 1.0e10 MaxValue = 1.0e+10 Bounded_sstrnr = min(max(sstrnr,MinValue),MaxValue) dynvis = (1exp(nu0*Bounded_sstrnr/tau0))+((tau0/Bounded_sstrnr)+K*Bounded_sstrnr^(n1)) Easy. (But I will let you sort out the units) 

June 3, 2013, 08:24 

#13 
New Member
Titus Ofei
Join Date: Nov 2012
Posts: 13
Rep Power: 4 

June 3, 2013, 08:27 

#14 
New Member
Titus Ofei
Join Date: Nov 2012
Posts: 13
Rep Power: 4 
Thanks Glenn for the quick reply. I'll sort out the units


June 3, 2013, 08:52 

#15 
New Member
Titus Ofei
Join Date: Nov 2012
Posts: 13
Rep Power: 4 
Thanks Glenn and Lance for your help. Problem solved!!!
Now the Reynolds number is completely laminar and no error message as before. I'm very grateful to you all. I love this forum. Domain Name : dratio 05 eccen 0 Global Length = 6.1417E02 Minimum Extent = 5.0800E02 Maximum Extent = 1.5240E01 Density = 1.0000E+03 Dynamic Viscosity = 6.1622E02 Velocity = 5.0000E01 Advection Time = 1.2283E01 Reynolds Number = 4.9834E+02 

June 3, 2013, 08:58 

#16 
Senior Member
Lance
Join Date: Mar 2009
Posts: 548
Rep Power: 11 
You're welcome. Note that the Reynolds number in the output from CFX has no meaning for the solution process.
I guess you also changed the density, in post #7 it was kind of low: 

June 3, 2013, 09:34 

#17 
New Member
Titus Ofei
Join Date: Nov 2012
Posts: 13
Rep Power: 4 
Lance, the density has always been 1000kgm^3, however, I do not know how it became so low in the output file. Maybe it could be due to the 'bounded' problem I was facing earlier.


June 5, 2013, 05:53 

#18 
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 11,079
Rep Power: 86 
You will have to be careful with such a weird viscosity relation as this. The numerical stability will be low and you might have multiple solution issues. That is if you start with high viscosity and work down you get a different answer to if you start at low viscoisty and work up.


June 5, 2013, 07:03 

#19 
New Member
Titus Ofei
Join Date: Nov 2012
Posts: 13
Rep Power: 4 
Hi Glenn
The viscosity equation I wrote after crosschecking the units, should have been dynvis = (1exp(nu0*Bounded_sstrnr/tau0)) * ((tau0/Bounded_sstrnr)+K*Bounded_sstrnr^(n1)) instead of dynvis = (1exp(nu0*Bounded_sstrnr/tau0))+((tau0/Bounded_sstrnr)+K*Bounded_sstrnr^(n1)) So far, all my solutions are reasonable. Unless there is something I should know. I am implementing your idea of MinValue, MaxValue. Thanks 

June 5, 2013, 07:08 

#20 
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 11,079
Rep Power: 86 
Yes, and MaxValue and MinValue will need to be declared with the correct units.


Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
solid particle dynamic viscosity  trinitron  CFX  0  August 2, 2012 03:45 
CGNS lib and Fortran compiler  manaliac  Main CFD Forum  2  November 29, 2010 07:25 
dynamic viscosity setup  fat bug  CFX  5  March 20, 2008 12:01 
Does CFX support LES, local dynamic mdoel  JJ  CFX  0  August 28, 2003 21:15 
CFX 4.4 installation problem  Pandu Sattvika  CFX  1  December 1, 2001 05:07 