CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Calculating gradient for scalar considering flow direction

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 11, 2019, 08:34
Default Calculating gradient for scalar considering flow direction
  #1
Member
 
Durgesh
Join Date: Oct 2018
Posts: 34
Rep Power: 8
durg is on a distinguished road
Hello!

I am writing a UDF using execute at end macros, in which I have to use convective part of the governing equation in which I want the gradient value for the scalar based on the upwind scheme. Based on the CFD theory, in the upwind scheme, based on flow direction, method of calculating gradient along x and y-direction changes, means for u(velocity)>0 then Backward Difference scheme is used and for u<0, then Forward Difference Scheme is used to calculate the gradient.

I went through the manual to understand how fluent calculates the gradient of a scalar. To get the gradient values for scalar in udf from fluent there is cell macros to calculate gradient which is C_UDSI_G(c,t,0)[0], this gives x-component gradient value.

I want to know whether above cell gradient macros follow the upwind scheme.

Regards
durg is offline   Reply With Quote

Old   April 11, 2019, 09:01
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
You should look in the Theory Guide part of the manual. Specifically:
Section 21 is about Solver Theory.
Section 21.5 is about the density-based solver.
Section 21.5.3 is about Convective fluxes in the density-based solver.


The situation that you sketch is for a 1D problem. In 3D, everything becomes a bit more subtle, and Fluent does not use the most basic formulation, but a slightly more complex one, see section 21.5.3.
pakk is offline   Reply With Quote

Old   April 11, 2019, 11:12
Default
  #3
Member
 
Durgesh
Join Date: Oct 2018
Posts: 34
Rep Power: 8
durg is on a distinguished road
Thank you for reply. In my problem, fluid is incompressible, so I am using pressure-based solver. I went through the above sections. Also went through a section where it tells about the evolution of gradient and derivatives and currently least squares cell-based is used for evaluating gradient. I want to know whether gradient cell macros values are following upwind scheme, or I need to write condition based on velocity direction for getting gradient values.

Also, when defining scalar variable in scalar definition box, if I select 'none' in flux function and default in unsteady column, does it mean that both convective and diffusive flux will not be solved by fluent, only unsteady and source term get evaluated. Is it true?

Regards
durg is offline   Reply With Quote

Reply


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
Issues on the simulation of high-speed compressible flow within turbomachinery dowlee OpenFOAM Running, Solving & CFD 11 August 6, 2021 07:40
periodic straight tube flow, no mesh independent solution for pressure gradient thijs1909 FLUENT 5 May 16, 2018 10:04
Review: Reversed flow CRT FLUENT 1 May 7, 2018 06:36
Calculation of the flow just in x direction in 3D model cavida OpenFOAM 3 July 8, 2015 17:26
High No Iterations in Secondary Flow Direction camoesas OpenFOAM Running, Solving & CFD 0 July 9, 2014 05:11


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