CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

diffusion term backward differencing

Register Blogs Community New Posts Updated Threads Search

Like Tree8Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 27, 2022, 15:42
Default diffusion term backward differencing
  #1
Member
 
Shah
Join Date: Aug 2013
Posts: 61
Rep Power: 13
researcher is on a distinguished road
Dear CFD community,
I am analyzing a simple rectangular domain and applying 2D Navier Stokes equations (zero pressure gradient) to it. As I apply the diffusion term d2u/dy2 to the node just above the wall on the exit boundary and do backward differencing, I get a term u(i,j-2). Now, since there is no node below (i,j-1), how do I go about it. Urgent help needed, please.
researcher is offline   Reply With Quote

Old   March 27, 2022, 16:29
Default
  #2
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,747
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
If you are doing FVM then the diffusion term is actually the divergence of fluxes. The flux is what needs to be discretized, not d2u/dy2. The boundary flux is either a boundary condition or needs to be obtained from the solution.
LuckyTran is offline   Reply With Quote

Old   March 27, 2022, 16:33
Default backward differencing on boundary
  #3
Member
 
Shah
Join Date: Aug 2013
Posts: 61
Rep Power: 13
researcher is on a distinguished road
please see the picture attached to make the situation clear.
Attached Images
File Type: jpg 20220328_002106.jpg (78.2 KB, 17 views)
researcher is offline   Reply With Quote

Old   March 27, 2022, 16:34
Default
  #4
Member
 
Shah
Join Date: Aug 2013
Posts: 61
Rep Power: 13
researcher is on a distinguished road
Quote:
Originally Posted by LuckyTran View Post
If you are doing FVM then the diffusion term is actually the divergence of fluxes. The flux is what needs to be discretized, not d2u/dy2. The boundary flux is either a boundary condition or needs to be obtained from the solution.
I am using finite difference method. Of course in FVM it is in terms of fluxes.
researcher is offline   Reply With Quote

Old   March 27, 2022, 17:00
Default ghost cells
  #5
Member
 
Shah
Join Date: Aug 2013
Posts: 61
Rep Power: 13
researcher is on a distinguished road
Please also make me understand (with reference to the figure I attached above), how to use ghost cells. What would be the values of, say, velocities at the ghost cells.
researcher is offline   Reply With Quote

Old   March 27, 2022, 17:28
Default
  #6
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,747
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
In FD you directly have node values on nodes. What is your boundary condition there?
LuckyTran is offline   Reply With Quote

Old   March 27, 2022, 17:32
Default ghost cells
  #7
Member
 
Shah
Join Date: Aug 2013
Posts: 61
Rep Power: 13
researcher is on a distinguished road
Its wall right in the bottom.At the top it is the free stream condition.
researcher is offline   Reply With Quote

Old   March 27, 2022, 17:32
Default
  #8
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,849
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Your sketch is not clear and the formula you wrote is wrong


The derivative in i,j is (f(i,j+1)-2f(i,j)-f(i,j-1))/dy^2, no point in j-2 is involved in the node just above the wall.


But what is not clear is that you are at the outflow section, what are you prescribing as BC?
researcher likes this.
FMDenaro is offline   Reply With Quote

Old   March 27, 2022, 17:36
Default
  #9
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,747
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
The node at i,j is on the boundary. At boundaries, you impose boundary conditions. You simply don't discretize the governing equation there. What is the discretization of the diffusion term for the node at i,j is never a question.

What is the constraint at i,j? Is it f(i,j)= some number of df/dx and df/dy= something.


Even if i,j is an interior node adjacent to a boundary node, the same applies for the node at j-1. It has boundary conditions there. The boundary conditions determine what is the value of the virtual cells.
FMDenaro and researcher like this.
LuckyTran is offline   Reply With Quote

Old   March 27, 2022, 17:41
Default
  #10
Member
 
Shah
Join Date: Aug 2013
Posts: 61
Rep Power: 13
researcher is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
Your sketch is not clear and the formula you wrote is wrong


The derivative in i,j is (f(i,j+1)-2f(i,j)-f(i,j-1))/dy^2, no point in j-2 is involved in the node just above the wall.


But what is not clear is that you are at the outflow section, what are you prescribing as BC?
I am reattaching the image.
researcher is offline   Reply With Quote

Old   March 27, 2022, 17:42
Default
  #11
Member
 
Shah
Join Date: Aug 2013
Posts: 61
Rep Power: 13
researcher is on a distinguished road
please see the schematic.
Attached Images
File Type: jpg 20220328_013739.jpg (61.6 KB, 12 views)
researcher is offline   Reply With Quote

Old   March 27, 2022, 17:46
Default
  #12
Member
 
Shah
Join Date: Aug 2013
Posts: 61
Rep Power: 13
researcher is on a distinguished road
Quote:
Originally Posted by LuckyTran View Post
The node at i,j is on the boundary. At boundaries, you impose boundary conditions. You simply don't discretize the governing equation there. What is the discretization of the diffusion term for the node at i,j is never a question.

What is the constraint at i,j? Is it f(i,j)= some number of df/dx and df/dy= something.


Even if i,j is an interior node adjacent to a boundary node, the same applies for the node at j-1. It has boundary conditions there. The boundary conditions determine what is the value of the virtual cells.
So you mean one should start boundary node calculations starting from top (where Neumann condition exists) next to the free stream nodes rather than starting from the wall?
researcher is offline   Reply With Quote

Old   March 27, 2022, 17:51
Default
  #13
Member
 
Shah
Join Date: Aug 2013
Posts: 61
Rep Power: 13
researcher is on a distinguished road
I am not discretizing at the wall. i,j is at one node above the wall node. I am applying d2u/dx2 there. Maybe I should start from the free stream top and come down on nodes until I reach the node adjacent to the wall.Correct me please.
researcher is offline   Reply With Quote

Old   March 27, 2022, 17:55
Default
  #14
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,849
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by researcher View Post
I am not discretizing at the wall. i,j is at one node above the wall node. I am applying d2u/dx2 there. Maybe I should start from the free stream top and come down on nodes until I reach the node adjacent to the wall.Correct me please.



I do not understand what you are doing!

You should specify your flow problem, equations, bcs and formulation to integrate the NSE.

You are just addressing a term in the x-direction momentum
FMDenaro is offline   Reply With Quote

Old   March 27, 2022, 20:37
Default
  #15
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,747
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
You have a boundary condition at the j-1 node. Either you have du/dy= some value and you are done or you have u(i,j-1)=some value you use this to derive the correct finite difference formula (which is not 1 -2 1, because that is the formula for an interior node). For example, for a uniform grid:

u''(j) \approx \frac{u'(j)-u'(j-1)}{{\Delta }y^2}
LuckyTran is offline   Reply With Quote

Old   March 28, 2022, 05:10
Default
  #16
Member
 
Shah
Join Date: Aug 2013
Posts: 61
Rep Power: 13
researcher is on a distinguished road
I am attaching the whole problem. Please see.
Attached Images
File Type: jpg 20220328_130522.jpg (37.8 KB, 12 views)
researcher is offline   Reply With Quote

Old   March 28, 2022, 10:12
Default
  #17
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,747
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
This gets more and more confusing with every picture taken by your phone.

Boundary nodes don't have governing equations, there is no discretization there. You don't discretize anything at outlets. Boundaries (outlets) have boundary conditions and that's all.
researcher likes this.
LuckyTran is offline   Reply With Quote

Old   March 28, 2022, 12:53
Default
  #18
Member
 
Shah
Join Date: Aug 2013
Posts: 61
Rep Power: 13
researcher is on a distinguished road
Quote:
Originally Posted by LuckyTran View Post
This gets more and more confusing with every picture taken by your phone.

Boundary nodes don't have governing equations, there is no discretization there. You don't discretize anything at outlets. Boundaries (outlets) have boundary conditions and that's all.
Honestly, I am perplexed now. it is a rectangular domain. From left enters air at 10 m/s. There is no pressure gradient ( I have quoted the equation). If I were to find the U and V velocities at the outlet, how should these two eqns (continuity and momentum) apply.
researcher is offline   Reply With Quote

Old   March 28, 2022, 13:06
Default
  #19
Member
 
Shah
Join Date: Aug 2013
Posts: 61
Rep Power: 13
researcher is on a distinguished road
Let me elaborate it further :
Now, it is desired that backward differencing be applied to both continuity and momentum equations, how should these two equations look. There has to be a ghost node outside the domain to account for the 2nd order partial term in momentum equations. Can these two equations be consistently discretized in the mentioned scheme at the outlet? I would be grateful if you could please explain.
researcher is offline   Reply With Quote

Old   March 28, 2022, 13:48
Default
  #20
Member
 
Shah
Join Date: Aug 2013
Posts: 61
Rep Power: 13
researcher is on a distinguished road
my bad, forgot to tell, it is flow over a flat plate. if pressure gradient does not exist, what condition should be set at the outlet. obviously one has to investigate laminar boundary layer and velocity gradient therein.
researcher is offline   Reply With Quote

Reply

Tags
backward differencing, finite difference, rectangular domain


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
On the diffusion term discretization on unstructured grids sbaffini Main CFD Forum 33 November 10, 2017 04:20
Why in Hrvoje Jasak's thesis diffusion term has "rho"? cavida OpenFOAM Programming & Development 6 February 4, 2016 08:10
Discretization of the Diffusion Term Rui CFX 0 October 24, 2005 13:43
Source term for diffusion equation in FLUENT 4.5 Raja Banerjee FLUENT 1 August 31, 2000 00:00
Numerical diffusion error Z.Zeng Main CFD Forum 8 October 22, 1999 10:06


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