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

Gradient of a variable in CFX

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 9, 2011, 10:31
Default Gradient of a variable in CFX
  #1
Member
 
Shahid Parvez
Join Date: Jul 2009
Location: Pakistan
Posts: 38
Rep Power: 17
shahpar73 is on a distinguished road
Hi
Is it possible in CFX to calculate the Gradient of "My defined Variable" with respect to temperature? i,e

My defined Variable.Gradient T

It is not working for me saying "T" is not recognized. When I replace "T" with "X" then it is OK.
shahpar73 is offline   Reply With Quote

Old   February 9, 2011, 19:36
Default
  #2
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,852
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
You cannot do it directly. You can only do gradients like that WRT space. But dV/dT=dV/dX * 1/(dT/dX) so you should be able to calculate it from the spatial gradients of your variable and temperature.
ghorrocks is offline   Reply With Quote

Old   February 10, 2011, 00:12
Default
  #3
Member
 
Shahid Parvez
Join Date: Jul 2009
Location: Pakistan
Posts: 38
Rep Power: 17
shahpar73 is on a distinguished road
Thanks Glenn. Your response always helped me.
I tried your suggestion and got the following error message. Any comments Please...

| PROBLEM ENCOUNTERED WHEN EXECUTING CFX EXPRESSION LANGUAGE |
| |
| The CFX expression language was evaluating: |
| Additional Variable Value |
| |
| The problem was: |
| DIVIDE-BY-ZERO |
| |
| FURTHER INFORMATION |
| |
| The problem was encountered in executing the expression for: |
| GradSurfTension |
| The complete expression is: |
| Surface Tension.Gradient X*(1/T.Gradient X) |
| The error occurs on sub-expression: |
| 1/T.Gradient X
shahpar73 is offline   Reply With Quote

Old   February 10, 2011, 02:56
Default
  #4
Senior Member
 
Lance
Join Date: Mar 2009
Posts: 669
Rep Power: 22
Lance is on a distinguished road
Your expression T.Gradient X is zero... due to uniform initial conditions maybe?
Lance is offline   Reply With Quote

Old   February 10, 2011, 05:15
Default
  #5
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,852
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Um, why are you doing this? If you have a surface tension set as a function of temperature you already know the gradient of the surface tension WRT to temperature, so why get CFX to calculate it?
ghorrocks is offline   Reply With Quote

Old   February 10, 2011, 06:07
Default
  #6
Member
 
Shahid Parvez
Join Date: Jul 2009
Location: Pakistan
Posts: 38
Rep Power: 17
shahpar73 is on a distinguished road
Hi Glenn,
If you look at the expression, Surface Tension is NOT set as a gradient of Temperature rather set as "X" and I want to calculate the Surface Tension as a Gradient of Temperature in a way as you mentioned in your previous reply.
shahpar73 is offline   Reply With Quote

Old   February 10, 2011, 06:59
Default
  #7
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,852
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
OK, no problem.
ghorrocks is offline   Reply With Quote

Old   February 10, 2011, 09:29
Default
  #8
Member
 
Shahid Parvez
Join Date: Jul 2009
Location: Pakistan
Posts: 38
Rep Power: 17
shahpar73 is on a distinguished road
Just noticed in Cfx Post that "T.Gradient X" is zero at t=0, and then nonzero. Any solution then? How to skip t=0 in transient analysis?
shahpar73 is offline   Reply With Quote

Old   February 10, 2011, 16:36
Default
  #9
Senior Member
 
Edmund Singer P.E.
Join Date: Aug 2010
Location: Minneapolis, MN
Posts: 511
Rep Power: 21
singer1812 is on a distinguished road
Perhaps add a non zero value to the T.Gradient.X term and a step function. Like

(T.Gradient X+0.0001 [K m^-1]*step(.00001-t*1[s^-1])

for a quick and dirty solution. Make sure you change .00001 to something that suits your time step.
singer1812 is offline   Reply With Quote

Old   February 10, 2011, 18:00
Default
  #10
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,852
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Back to my previous post.... I am still puzzled by what you are trying to do. Surface tension is usually constant (so dS/dT=0 where S is surface tension and T is temperature) so if it is not constant you must have set it to be a function of something. So why not simply work out the derivative of that function WRT temperature?

Can you explain what function you have set surface tension to?
ghorrocks is offline   Reply With Quote

Old   February 10, 2011, 23:03
Default
  #11
Member
 
Shahid Parvez
Join Date: Jul 2009
Location: Pakistan
Posts: 38
Rep Power: 17
shahpar73 is on a distinguished road
I want to calculate the Marangoni Force such that MF=dS/dT*dT/dX [N m^-2] (where S is in N/m) and apply it as a BC.
So in my case S is not constant but a function of temperature and temperature is a function of "X". In CFX, as you mentioned earlier, dS/dT can not be calculated directly and that is why all this stuff come.
shahpar73 is offline   Reply With Quote

Old   February 10, 2011, 23:22
Default
  #12
Member
 
Shahid Parvez
Join Date: Jul 2009
Location: Pakistan
Posts: 38
Rep Power: 17
shahpar73 is on a distinguished road
Problem solved. Thanks to all who replied to this post.
I followed Singer's instructions by adding a small value of 1e-10 [K m^-1] to T.Gradient X and it worked.
shahpar73 is offline   Reply With Quote

Reply


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
Pros and Cons for CFX, CFdesign, COMSOL Val Main CFD Forum 3 June 10, 2011 03:20
Boundary Condition for variable Gradient wilko OpenFOAM Running, Solving & CFD 1 March 13, 2009 13:30
hi how to set entironment variable in CFX pre romance CFX 0 December 23, 2007 08:11
User Defined Variable in CFX PRE Hamidur Rahman CFX 2 September 21, 2007 15:18
CFX 4.4 installation problem Pandu Sattvika CFX 1 December 1, 2001 05:07


All times are GMT -4. The time now is 23:51.