How to calculate the gradient of a scaler variable?

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

 May 20, 2016, 13:00 How to calculate the gradient of a scaler variable? #1 Member   Sidharath Join Date: May 2015 Location: UK Posts: 62 Rep Power: 7 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

 May 20, 2016, 15:27 #2 Senior Member   Join Date: Jun 2009 Posts: 1,285 Rep Power: 25 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.

 May 20, 2016, 18:24 #3 Member   Sidharath Join Date: May 2015 Location: UK Posts: 62 Rep Power: 7 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.

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