Gradient of a variable in CFX
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. |
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.
|
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 |
Your expression T.Gradient X is zero... due to uniform initial conditions maybe?
|
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?
|
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. |
OK, no problem.
|
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?
|
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. |
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? |
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. |
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. |
All times are GMT -4. The time now is 18:37. |