CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   gradient for scalar quantity (https://www.cfd-online.com/Forums/fluent/37471-gradient-scalar-quantity.html)

tseo August 3, 2005 20:24

gradient for scalar quantity
 
I simulated the advection-diffusion equation coupled with Navier-stokes equation. I'd like to calculate the spatial gradient of scalar quantity (dC/dx) along the wall in the flow direction. If anyone has the experience to calculate the gradient of scalar, could you please tell me how to write the UDF and to link in FLUENT? Thank you in advance

ramesh August 3, 2005 22:31

Re: gradient for scalar quantity
 
I suppose u solved the UDS along with the NS equations. Then Fluent automatically gives u the gradient in some of the post processing options. Like in xy plot if u have velocity as main menu then in the u have gradients and all other things as sub menu. In the similar way u have UDS as main menu then in that u have different options.

Bye ramesh

Swarup August 3, 2005 22:56

Re: gradient for scalar quantity
 
you should see the contour quantity menu. you will get many relevant scalar and vector gradients there. you will be able to obtain a data file also in the post-processing menu.

Swarup

tseo August 4, 2005 14:37

Re: gradient for scalar quantity
 
Thank you very much for your response. However I could not see the scalar gradient when I look at either xy-plot or contour menu. For instance if I click the xy-plot menu in plot, and choose user defined scalar..., I only can choose user scalar 0 or diffusion coefficient of user defined scalar 0. Same thing in Contour. I can't find the gradient of scalar any where in FLUENT. Did I miss something? I'd like to know more specific guide from you. Is there any other method to calculate the gradient of scalar in the flow direction? Thank you very much.

Swarup August 4, 2005 22:51

Re: gradient for scalar quantity
 
Sorry for being vague in the previous post. Did you check derivatives option in display->contour menus?

swarup

tseo August 5, 2005 15:19

Re: gradient for scalar quantity
 
Yes, I checked derivative option in contour menu, but there exist only for velocity and pressure gradient. I'd like to know the gradient of scalar quantity, (dC/dx), where C represents the concentration and x the direction of flow.

Thank you very much

Swarup August 5, 2005 23:15

Re: gradient for scalar quantity
 
Tseo,

Please see the UDS sample example in UDF guide (p.547 for 6.2 and p. 432 for 6.1). you will need to calculate your gradient first and then again put it in some UDS. actually, as you said, post-processing is available only for scalar and diffusion coefficient. so you need to do gradient computation yourself. this is what is shown in the example UDF code. the code also stores the gradient value to another scalar. I hope it will be possible for you to access your scalar first and then compute its gradient. if you are able to access your scalar then rest of the code will be similar to the one shown in the cited example.

Swarup


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