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

Approximating derivative in 2D finite volume

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 9, 2023, 10:51
Default Approximating derivative in 2D finite volume
  #1
Senior Member
 
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 184
Rep Power: 4
hunt_mat is on a distinguished road
Suppose I have a rectangular cell with vertices at (X_{i},Y_{j}),(X_{i+1},Y_{y}),(X_{i+1},Y_{i+1}),(X_{i},Y_{j+1}), If we label the sides, in the obvious way as \{n,e,s,w\}. The finite volume method yields the derivatives evaluated at the cell sides, and
I know how to approximate:
\frac{\partial\varphi}{\partial X}

on the east, and west faces using Taylor series is a simple way. However, I am confused about how to do it on the north, and south sides. I thought about taking averages around the north(or south) edge.
\frac{\partial\varphi}{\partial X}\Bigg|_{n}=\frac{1}{2}\left(\frac{\partial\varphi}{\partial X}\Bigg|_{j+1}+\frac{\partial\varphi}{\partial X}\Bigg|_{j}\right)
hunt_mat is offline   Reply With Quote

Old   November 9, 2023, 12:48
Default
  #2
Senior Member
 
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 184
Rep Power: 4
hunt_mat is on a distinguished road
So I think I have an answer to my own question:
I can average the derivatives to the top and bottom, so:
\frac{\partial\varphi}{\partial X}\Bigg|_{n}=\frac{1}{2}\left(\frac{\partial\varphi}{\partial X}\Bigg|_{i,j+1}+\frac{\partial\varphi}{\partial X}\Bigg|_{i,j}\right)
Then I use a central difference representation to obtain:
\frac{\partial\varphi}{\partial X}\Bigg|_{i,j+1}\approx\frac{\varphi_{i+1,j+1}-\varphi_{i-1,j+1}}{2\delta X}
\frac{\partial\varphi}{\partial X}\Bigg|_{i,j}\approx\frac{\varphi_{i+1,j}-\varphi_{i-1,j}}{2\delta X}
thus making:
\frac{\partial\varphi}{\partial X}\Bigg|_{n}=\frac{\varphi_{i+1,j}+\varphi_{i+1,j+1}-\varphi_{i-1,j+1}-\varphi_{i-1,j}}{4\delta X}
Does this look reasonable?
hunt_mat is offline   Reply With Quote

Old   November 9, 2023, 13:12
Default
  #3
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,896
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
That depends on the choice you did for the colocation of phi. Is it at the FV center X(i+1/2),Y(j+1/2) or is cell-vertex ?


It seems a cell-center colocation, thus you need of an interpolation. But why do you need a tangential derivative on the faces? In a FV scheme it never enters into the update.
FMDenaro is offline   Reply With Quote

Old   November 9, 2023, 13:39
Default
  #4
Senior Member
 
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 184
Rep Power: 4
hunt_mat is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
That depends on the choice you did for the colocation of phi. Is it at the FV center X(i+1/2),Y(j+1/2) or is cell-vertex ?


It seems a cell-center colocation, thus you need of an interpolation. But why do you need a tangential derivative on the faces? In a FV scheme it never enters into the update.
So the i and j are centred at the cell centres. The n,e,s,w are the sides of the cell, the fluxes into and out of the cell. My stress tensor is very complicated and has all derivatives of everything, especially in Lagrangian co-ordinates.
hunt_mat is offline   Reply With Quote

Old   November 9, 2023, 14:17
Default
  #5
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,896
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by hunt_mat View Post
So the i and j are centred at the cell centres. The n,e,s,w are the sides of the cell, the fluxes into and out of the cell. My stress tensor is very complicated and has all derivatives of everything, especially in Lagrangian co-ordinates.
The normal component of the tensor has tangential derivative ? Then yes, use a linear interpolation.
FMDenaro is offline   Reply With Quote

Reply

Tags
finite volume method


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
Matlab code for Finite Volume Method in 2D coagmento Main CFD Forum 5 October 7, 2022 14:47
The fundamental difference between Finite Difference and Finite Volume Methods vikramaditya91 Main CFD Forum 3 January 14, 2016 05:13
Problem with SIMPLEC-like finite volume channel flow boundary conditions ghobold Main CFD Forum 3 June 15, 2015 12:14
Problem of simulating of small droplet with radius of 2mm liguifan OpenFOAM Running, Solving & CFD 5 June 3, 2014 03:53
influence of convex or concave control volume in finite volume discretization openfoammaofnepo Main CFD Forum 1 March 24, 2014 03:13


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