|
[Sponsors] |
![]() |
![]() |
#21 | |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,830
Rep Power: 73 ![]() ![]() ![]() |
Quote:
Compute only one flux for each face, then it is sufficien to change the sign to have the fluxes for two adjacent cells. |
||
![]() |
![]() |
![]() |
![]() |
#22 |
Senior Member
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 178
Rep Power: 4 ![]() |
||
![]() |
![]() |
![]() |
![]() |
#23 |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,830
Rep Power: 73 ![]() ![]() ![]() |
you have adjacent cells sharing a face, the flux is unique, only the normal unit vector changes. Thus, you compute for each face the flux and then us that to update the values in time just considering the correct sign. For example, the flux at the est face of the cell i is equal to the west face of the cell i+1, just with opposite sign. |
|
![]() |
![]() |
![]() |
![]() |
#24 | |
Senior Member
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 178
Rep Power: 4 ![]() |
Quote:
|
||
![]() |
![]() |
![]() |
![]() |
#25 |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,830
Rep Power: 73 ![]() ![]() ![]() |
||
![]() |
![]() |
![]() |
![]() |
#26 |
Senior Member
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 178
Rep Power: 4 ![]() |
||
![]() |
![]() |
![]() |
![]() |
#27 | |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,830
Rep Power: 73 ![]() ![]() ![]() |
Quote:
I suggest thinking always to the discretization of the outer operator, in this case the integral. In a more general second order discretization, you can use trapezoidal rule. You see a different and larger stencil. |
||
![]() |
![]() |
![]() |
![]() |
#28 |
Senior Member
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 178
Rep Power: 4 ![]() |
Which I did. If X and X+dX are very close to each other then the approximation I gave should be valid.
|
|
![]() |
![]() |
![]() |
![]() |
#29 | |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,830
Rep Power: 73 ![]() ![]() ![]() |
Quote:
The trapezoidal rule is [f(a)+f(b)]*h/2 |
||
![]() |
![]() |
![]() |
![]() |
#30 |
Senior Member
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 178
Rep Power: 4 ![]() |
For small enough dX, and dY, then the approximations are as good as each other, and implementing makes things harder,
|
|
![]() |
![]() |
![]() |
![]() |
#31 |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,728
Rep Power: 66 ![]() ![]() ![]() |
You still need to discretize the face flux (the integral) either way. You don't know C(x+dx/2,y+dy/2)*dx
I don't understand this obsession with midpoint rule or small dx and small dy. We are in the realm of discrete math. Delta-epsilon arguments don't work here. There is (almost) always a finite error that is the neglected higher order terms (almost unless you have a TVD scheme). This is just another rabbit hole. Just write out the entire discretized integral (i.e. write down the face flux already!). Let me point out what is wrong with the logic. For small enough dx and dy f(x,y)=f(x+dx,y+dy)=f(x+2dx,y+2dy) are all equally good approximations of each other. Clearly there are practical issues with this implementation. |
|
![]() |
![]() |
![]() |
![]() |
#32 | |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,830
Rep Power: 73 ![]() ![]() ![]() |
Quote:
No, for your problem you have to write properly the equation by dividing for the measure of the volume this way 1/(dx*dy) * Integral[S] v.f ds=0 and when dx,dy->0 the equation tend to Div.f=0. It is ok to use the midpoint rule but be aware that is only first order accurate on an irregular grid. |
||
![]() |
![]() |
![]() |
![]() |
#33 | |
Senior Member
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 178
Rep Power: 4 ![]() |
Quote:
|
||
![]() |
![]() |
![]() |
![]() |
#34 | |
Senior Member
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 178
Rep Power: 4 ![]() |
Quote:
|
||
![]() |
![]() |
![]() |
![]() |
#35 | |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,830
Rep Power: 73 ![]() ![]() ![]() |
Quote:
if you work only on the equation Int[S] n.f dS=0, this equation would be erroneously verified for |S|->0, even for a wrong flux. To be consistent to the limit for vanishing dx and dy you have to divide the integral. As far as the discretization of the integral is concerned, the mid-point rule has a poor spectral representation compared to the trapezoidal rule. |
||
![]() |
![]() |
![]() |
![]() |
#36 | |
Senior Member
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 178
Rep Power: 4 ![]() |
Quote:
|
||
![]() |
![]() |
![]() |
![]() |
#37 |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,830
Rep Power: 73 ![]() ![]() ![]() |
||
![]() |
![]() |
![]() |
![]() |
#38 |
Senior Member
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 178
Rep Power: 4 ![]() |
||
![]() |
![]() |
![]() |
![]() |
#39 | |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,830
Rep Power: 73 ![]() ![]() ![]() |
Quote:
You need to study the spectral analysis of the formulas and look at the resulting error in the wavenumber space to understand why. But I think you are not interested in that, so use the midpoint rule that is very easy to implement. |
||
![]() |
![]() |
![]() |
![]() |
#40 |
Senior Member
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 178
Rep Power: 4 ![]() |
I'm not doing Fourier analysis here. It's a very nonlinear problem.
|
|
![]() |
![]() |
![]() |
Tags |
finite volume method |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
finite volume method and finite difference method | harishkamat100 | FLUENT | 3 | December 21, 2020 23:52 |
Finite element method ANSYS CFX | tomd97 | CFX | 2 | April 4, 2018 04:10 |
Mesh; wall function for element based finite volume method | sheaker | CFX | 2 | January 25, 2018 17:36 |
ALE in finite volume method | littlelz | Main CFD Forum | 5 | June 21, 2003 12:50 |
finite volume method for CFD analysis of 2D blunt body | Aditya Vaze | Main CFD Forum | 1 | January 19, 2000 13:55 |