|
[Sponsors] |
Suggestion on new dynamic viscosity expression in CFX |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 31, 2013, 11:10 |
Suggestion on new dynamic viscosity expression in CFX
|
#1 |
New Member
Titus Ofei
Join Date: Nov 2012
Posts: 14
Rep Power: 14 |
Dear friends,
I am using ANSYS CFX version 14.0 and I want to model a different non-Newtonian 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: (1-exp(nu0*sstrnr/tau0))+((tau0/sstrnr)+K*sstrnr^(n-1)) 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, 07:17 |
|
#2 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,870
Rep Power: 144 |
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, 08:07 |
|
#3 |
Member
rasool
Join Date: Apr 2013
Posts: 41
Rep Power: 13 |
hi
You must specify shear stress? shear stress @(your place) |
|
June 1, 2013, 08:20 |
|
#4 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,870
Rep Power: 144 |
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, 01:08 |
|
#5 | |
New Member
Titus Ofei
Join Date: Nov 2012
Posts: 14
Rep Power: 14 |
Quote:
BTW is there any way I can get access to the existing code for Herschel-Bulkley viscosity in ANSYS CFX 14.0 and then modify it as a UDF? Thanks again Titus |
||
June 2, 2013, 07:12 |
|
#6 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,870
Rep Power: 144 |
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, 01:02 |
|
#7 |
New Member
Titus Ofei
Join Date: Nov 2012
Posts: 14
Rep Power: 14 |
Hi Glenn, this is the error message I used to get any time I run with the defined dynamic viscosity:
(1-exp(nu0*sstrnr/tau0))+((tau0/sstrnr)+K*sstrnr^(n-1)) +--------------------------------------------------------------------+ | 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.8254E-02 Minimum Extent = 5.0800E-02 Maximum Extent = 1.5240E-01 Density = 7.9405E-07 Velocity = 5.0000E-01 Advection Time = 1.1651E-01 Reynolds Number = 3.6682E+07 Even if I omit the first part of the viscosity equation, the classical Herschel-Bulkley equation remains [((tau0/sstrnr)+K*sstrnr^(n-1))]; yet I do get similar errors. Any ideas please? thanks |
|
June 3, 2013, 02:56 |
|
#8 |
Senior Member
Lance
Join Date: Mar 2009
Posts: 669
Rep Power: 22 |
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, 07:32 |
|
#9 |
New Member
Titus Ofei
Join Date: Nov 2012
Posts: 14
Rep Power: 14 |
Thanks Glenn. Very informative.
|
|
June 3, 2013, 09:08 |
|
#10 |
New Member
Titus Ofei
Join Date: Nov 2012
Posts: 14
Rep Power: 14 |
Hi Glenn, one more thing. Please find attached a plot of dynamic viscosity vs. shear rate (gamma from 1E-10 to 1E-01). It can be seen that for shear rate of 1E-10 and below, the dynamic viscosity is approx. zero (0) which will drastically increase the Reynolds number. Above that (1E-10), 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 1E-03 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, 09:16 |
|
#11 |
Senior Member
Lance
Join Date: Mar 2009
Posts: 669
Rep Power: 22 |
a nested if-statement that bounds sstrnr between 1e-3 and 1e3:
if(sstrnr<1e-3[s^-1],1e-3[s^-1],if(sstrnr>1e3 [s^-1],1e3[s^-1],sstrnr)) (im not Glenn ) |
|
June 3, 2013, 09:16 |
|
#12 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,870
Rep Power: 144 |
How about:
MinValue = 1.0e-10 MaxValue = 1.0e+10 Bounded_sstrnr = min(max(sstrnr,MinValue),MaxValue) dynvis = (1-exp(nu0*Bounded_sstrnr/tau0))+((tau0/Bounded_sstrnr)+K*Bounded_sstrnr^(n-1)) Easy. (But I will let you sort out the units) |
|
June 3, 2013, 09:24 |
|
#13 |
New Member
Titus Ofei
Join Date: Nov 2012
Posts: 14
Rep Power: 14 |
||
June 3, 2013, 09:27 |
|
#14 |
New Member
Titus Ofei
Join Date: Nov 2012
Posts: 14
Rep Power: 14 |
Thanks Glenn for the quick reply. I'll sort out the units
|
|
June 3, 2013, 09:52 |
|
#15 |
New Member
Titus Ofei
Join Date: Nov 2012
Posts: 14
Rep Power: 14 |
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.1417E-02 Minimum Extent = 5.0800E-02 Maximum Extent = 1.5240E-01 Density = 1.0000E+03 Dynamic Viscosity = 6.1622E-02 Velocity = 5.0000E-01 Advection Time = 1.2283E-01 Reynolds Number = 4.9834E+02 |
|
June 3, 2013, 09:58 |
|
#16 |
Senior Member
Lance
Join Date: Mar 2009
Posts: 669
Rep Power: 22 |
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, 10:34 |
|
#17 |
New Member
Titus Ofei
Join Date: Nov 2012
Posts: 14
Rep Power: 14 |
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, 06:53 |
|
#18 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,870
Rep Power: 144 |
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, 08:03 |
|
#19 |
New Member
Titus Ofei
Join Date: Nov 2012
Posts: 14
Rep Power: 14 |
Hi Glenn
The viscosity equation I wrote after cross-checking the units, should have been dynvis = (1-exp(nu0*Bounded_sstrnr/tau0)) * ((tau0/Bounded_sstrnr)+K*Bounded_sstrnr^(n-1)) instead of dynvis = (1-exp(nu0*Bounded_sstrnr/tau0))+((tau0/Bounded_sstrnr)+K*Bounded_sstrnr^(n-1)) 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, 08:08 |
|
#20 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,870
Rep Power: 144 |
Yes, and MaxValue and MinValue will need to be declared with the correct units.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
solid particle dynamic viscosity | trinitron | CFX | 0 | August 2, 2012 04: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 22:15 |
CFX 4.4 installation problem | Pandu Sattvika | CFX | 1 | December 1, 2001 05:07 |