
[Sponsors] 
July 3, 2007, 09:07 
solution variable gradient

#1 
Guest
Posts: n/a

I have calculated a steady state solution for a flow problem. Now I would like to calculate the gradient of one of the solutions. I know I could do it with some postprocessing (e.g. tecplot) using a simple difference scheme. But I would also like to monitor the gradient development during the iterative solution steps.
Is there a way to define the gradient of a variable in CFXpre (or CFXpost)? Thanks in advance, Niko 

July 3, 2007, 09:20 
Re: solution variable gradient

#2 
Guest
Posts: n/a

Dear N.R.
Are you using ANSYS CFX10.0 or 11.0? For 10.0:  1  Define the Additional Variable 2  Activate the Additional Variable on the domain of interest, and make its components equal to the User CEL Function.. Use an integer to indicates which component the User Function should return. 3 Create a User CEL Function that  calls USER_GETVAR for the Gradient of the variable of interest.  copy the components of the gradients to the components of a Vector Algebraic Additional Variable For 11.0  1  Create Additional Variable 2  Activate Additional Variable in the domain interest, select Vector Algebraic Equation  Set the components to <MyVariableofInterest>.Gradient For example Vector xValue = Temperature.Gradient X Vector yValue = Temperature.Gradient Y Vector zValue = Temperature.Gradient Z Hope this helps, Opaque 

July 5, 2007, 10:08 
Re: solution variable gradient

#3 
Guest
Posts: n/a

Opaque, Thanks for your help.
It works well with CFX 11. But I am having problems with variables that anly occur at boundaries (e.g Wall Shear Stress) "Error in subroutine CAL_TAUWALL_LAM : Error calculating Wall Shear" I think the problem arises because CFX wants to access values at locations different than the boundary wall. Do you have any idea, how I could calculate the Wall shear stress gradient? Thanks, N.R. 

July 5, 2007, 10:59 
Re: solution variable gradient

#4 
Guest
Posts: n/a

Dear NR
The CFX variable Wall Shear only exists on nodes at the boundary; therefore, the calculation of the gradient is not well defined. Do you want the gradient on the boundary surface? Not sure what you are trying to evaluate. However, since your flow is laminar you can evaluate your shear stress from its definition using Velocity u/v/w.Gradient X/Y/Z (which is available) and compute the gradient of those expressions. Hope this helps, Opaque 

July 20, 2007, 07:52 
Re: solution variable gradient

#5 
Guest
Posts: n/a

Dear opaque,
with gradient of wall shear stress I mean the spatial gradient of the magnitude of the wall shear stress vector. I tried to obtain wall shear stress from the velocity gradients for an incompressible newtonian fluid, but the results are not equal. Actually my results using: e_ij=0.5(du_i/dx_j+du_j/dx_i) and sigma_ij=pd_ij+2mu(e_ij1/3d_ij div(u)) with d_ij = 1 for i=j and 0 else I use incompressible fluid, thus in theory div(u) should be 0 but just to make sure I include it. Also p should have no influence on WSS, but for completeness I include it as well. Then I use the element normal to calculate shear stress The results are very similar to the product of the CFX variables "shear strain rate" * "dynamic viscosity" but very different to what cfx reports as "wall shear". Do you have done a similar calculation? 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
grid dependancy  gueynard a.  Main CFD Forum  19  June 27, 2014 21:22 
gradient of a userdefined variable  rostamimass  Fluent UDF and Scheme Programming  0  May 4, 2011 06:26 
Exact solution of Burgers equation  mcaro  Main CFD Forum  3  January 25, 2011 07:46 
Gradient of a User defined Variable  Ramadas  CFX  2  August 21, 2007 09:19 
Wall functions  Abhijit Tilak  Main CFD Forum  6  February 5, 1999 02:16 