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

How to calculate the gradient of a scaler variable?

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Opaque

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 20, 2016, 13:00
Default How to calculate the gradient of a scaler variable?
  #1
Member
 
Sidharath
Join Date: May 2015
Location: UK
Posts: 65
Rep Power: 11
sidharath is on a distinguished road
Hi all,
I am trying to calculate the gradient of a variable in CFD-post.
The gradient of interest is not the global coordinate frame (x,y & z) but instead along different planes (streamwise and spanwise planes)

The option of using "expression" to calculate gradient will only allow me to calculate the gradient of the variable in the global reference frame (I reckon).
Anyone can help me with this, can I directly compute gradient along the plane other than global XYZ planes ?

Thank you
sidharath is offline   Reply With Quote

Old   May 20, 2016, 15:27
Default
  #2
Senior Member
 
Join Date: Jun 2009
Posts: 1,880
Rep Power: 33
Opaque will become famous soon enough
From calculus, the gradient along any direction of interest is the projection of the gradient in the global coordinate frame along the direction of interest, i.e. grad(Variable) . Direction

Now, do you have the direction vector of interest available already ? if you do, you must write the following CEL expression (for a scalar variable):

MyScalarVar.Gradient X * MyDir X +MyScalarVar.Gradient Y * MyDir Y+MyScalarVar.Gradient Z * MyDir Z

You can write it for vector variables as well.

Hope the above helps,
Saeef likes this.
Opaque is offline   Reply With Quote

Old   May 20, 2016, 18:24
Default
  #3
Member
 
Sidharath
Join Date: May 2015
Location: UK
Posts: 65
Rep Power: 11
sidharath is on a distinguished road
Hi Opaque,
Thank you for your reply.
Your solution to compute the gradient along a different axis using the dot product is spot on but the problem is the streamwise surfaces created in CFD-post are automatically generated and are circular in shape. To calculate the streamwise and spanwise vectors for the whole surface would be very difficult as circular shape would cause it to change at a lot.
I am trying to find a way out.
I was wondering if there is any direct way to compute it, using different coordinate system or polar one?
Thank you.
sidharath is offline   Reply With Quote

Reply

Tags
cfd - post, cfx, compressor, gradient, turbo-machinery


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
Periodic flow using Cyclic - comparison with Fluent nusivares OpenFOAM Running, Solving & CFD 30 December 12, 2017 06:35
How to calculate oscillating roll of 2D body (with variable amplitude and omega) lavrov OpenFOAM Running, Solving & CFD 0 March 19, 2015 07:31
calculate gradient tension in udf mohsenz_136 Fluent UDF and Scheme Programming 1 January 5, 2013 04:15
how to calculate the temperature gradient of wall houbaolin FLUENT 0 July 28, 2008 03:51
Env variable not set gruber2 OpenFOAM Installation 5 December 30, 2005 05:27


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