CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > CFX

Suggestion on new dynamic viscosity expression in CFX

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

Like Tree3Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 31, 2013, 11:10
Default Suggestion on new dynamic viscosity expression in CFX
  #1
New Member
 
Titus Ofei
Join Date: Nov 2012
Posts: 14
Rep Power: 13
TitusOfei is on a distinguished road
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
TitusOfei is offline   Reply With Quote

Old   June 1, 2013, 07:17
Default
  #2
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,655
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
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.
ghorrocks is offline   Reply With Quote

Old   June 1, 2013, 08:07
Default
  #3
Member
 
rasool
Join Date: Apr 2013
Posts: 41
Rep Power: 12
rasool motamedi is on a distinguished road
hi
You must specify shear stress?
shear stress @(your place)
rasool motamedi is offline   Reply With Quote

Old   June 1, 2013, 08:20
Default
  #4
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,655
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
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.
ghorrocks is offline   Reply With Quote

Old   June 2, 2013, 01:08
Default
  #5
New Member
 
Titus Ofei
Join Date: Nov 2012
Posts: 14
Rep Power: 13
TitusOfei is on a distinguished road
Quote:
Originally Posted by ghorrocks View Post
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.
Glenn, thanks for the reply.
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
TitusOfei is offline   Reply With Quote

Old   June 2, 2013, 07:12
Default
  #6
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,655
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
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.
ghorrocks is offline   Reply With Quote

Old   June 3, 2013, 01:02
Default
  #7
New Member
 
Titus Ofei
Join Date: Nov 2012
Posts: 14
Rep Power: 13
TitusOfei is on a distinguished road
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
TitusOfei is offline   Reply With Quote

Old   June 3, 2013, 02:56
Default
  #8
Senior Member
 
Lance
Join Date: Mar 2009
Posts: 669
Rep Power: 22
Lance is on a distinguished road
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.
Lance is offline   Reply With Quote

Old   June 3, 2013, 07:32
Default
  #9
New Member
 
Titus Ofei
Join Date: Nov 2012
Posts: 14
Rep Power: 13
TitusOfei is on a distinguished road
Thanks Glenn. Very informative.
TitusOfei is offline   Reply With Quote

Old   June 3, 2013, 09:08
Default
  #10
New Member
 
Titus Ofei
Join Date: Nov 2012
Posts: 14
Rep Power: 13
TitusOfei is on a distinguished road
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.
Attached Images
File Type: jpg visc vs shear rate.jpg (22.6 KB, 69 views)
TitusOfei is offline   Reply With Quote

Old   June 3, 2013, 09:16
Default
  #11
Senior Member
 
Lance
Join Date: Mar 2009
Posts: 669
Rep Power: 22
Lance is on a distinguished road
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 )
Lance is offline   Reply With Quote

Old   June 3, 2013, 09:16
Default
  #12
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,655
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
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)
ghorrocks is offline   Reply With Quote

Old   June 3, 2013, 09:24
Default
  #13
New Member
 
Titus Ofei
Join Date: Nov 2012
Posts: 14
Rep Power: 13
TitusOfei is on a distinguished road
Quote:
Originally Posted by Lance View Post
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 )
Thanks alot Lance. I'll check the results and give you feedback
TitusOfei is offline   Reply With Quote

Old   June 3, 2013, 09:27
Default
  #14
New Member
 
Titus Ofei
Join Date: Nov 2012
Posts: 14
Rep Power: 13
TitusOfei is on a distinguished road
Quote:
Originally Posted by ghorrocks View Post
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)
Thanks Glenn for the quick reply. I'll sort out the units
TitusOfei is offline   Reply With Quote

Old   June 3, 2013, 09:52
Default
  #15
New Member
 
Titus Ofei
Join Date: Nov 2012
Posts: 14
Rep Power: 13
TitusOfei is on a distinguished road
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
TitusOfei is offline   Reply With Quote

Old   June 3, 2013, 09:58
Default
  #16
Senior Member
 
Lance
Join Date: Mar 2009
Posts: 669
Rep Power: 22
Lance is on a distinguished road
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:

Quote:
Originally Posted by TitusOfei View Post
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
Lance is offline   Reply With Quote

Old   June 3, 2013, 10:34
Default
  #17
New Member
 
Titus Ofei
Join Date: Nov 2012
Posts: 14
Rep Power: 13
TitusOfei is on a distinguished road
Quote:
Originally Posted by Lance View Post
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:
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.
TitusOfei is offline   Reply With Quote

Old   June 5, 2013, 06:53
Default
  #18
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,655
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
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.
ghorrocks is offline   Reply With Quote

Old   June 5, 2013, 08:03
Default
  #19
New Member
 
Titus Ofei
Join Date: Nov 2012
Posts: 14
Rep Power: 13
TitusOfei is on a distinguished road
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
TitusOfei is offline   Reply With Quote

Old   June 5, 2013, 08:08
Default
  #20
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,655
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Yes, and MaxValue and MinValue will need to be declared with the correct units.
ghorrocks is offline   Reply With Quote

Reply

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
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


All times are GMT -4. The time now is 06:42.