|
[Sponsors] |
November 1, 2023, 14:17 |
|
#21 | |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,896
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. |
||
November 2, 2023, 06:27 |
|
#22 |
Senior Member
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 184
Rep Power: 4 |
||
November 2, 2023, 06:36 |
|
#23 |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,896
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. |
|
November 3, 2023, 10:27 |
|
#24 | |
Senior Member
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 184
Rep Power: 4 |
Quote:
|
||
November 3, 2023, 10:50 |
|
#25 |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,896
Rep Power: 73 |
||
November 6, 2023, 06:39 |
|
#26 |
Senior Member
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 184
Rep Power: 4 |
||
November 6, 2023, 07:58 |
|
#27 | |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,896
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. |
||
November 6, 2023, 08:20 |
|
#28 |
Senior Member
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 184
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.
|
|
November 6, 2023, 08:55 |
|
#29 | |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,896
Rep Power: 73 |
Quote:
The trapezoidal rule is [f(a)+f(b)]*h/2 |
||
November 6, 2023, 11:00 |
|
#30 |
Senior Member
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 184
Rep Power: 4 |
For small enough dX, and dY, then the approximations are as good as each other, and implementing makes things harder,
|
|
November 6, 2023, 11:05 |
|
#31 |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,761
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. |
|
November 6, 2023, 12:03 |
|
#32 | |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,896
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. |
||
November 6, 2023, 12:11 |
|
#33 | |
Senior Member
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 184
Rep Power: 4 |
Quote:
|
||
November 6, 2023, 12:13 |
|
#34 | |
Senior Member
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 184
Rep Power: 4 |
Quote:
|
||
November 6, 2023, 12:28 |
|
#35 | |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,896
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. |
||
November 6, 2023, 13:16 |
|
#36 | |
Senior Member
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 184
Rep Power: 4 |
Quote:
|
||
November 6, 2023, 13:23 |
|
#37 |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,896
Rep Power: 73 |
||
November 6, 2023, 13:34 |
|
#38 |
Senior Member
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 184
Rep Power: 4 |
||
November 6, 2023, 14:00 |
|
#39 | |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,896
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. |
||
November 7, 2023, 06:03 |
|
#40 |
Senior Member
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 184
Rep Power: 4 |
I'm not doing Fourier analysis here. It's a very nonlinear problem.
|
|
Tags |
finite volume method |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
finite volume method and finite difference method | harishkamat100 | FLUENT | 3 | December 22, 2020 00:52 |
Finite element method ANSYS CFX | tomd97 | CFX | 2 | April 4, 2018 05:10 |
Mesh; wall function for element based finite volume method | sheaker | CFX | 2 | January 25, 2018 18:36 |
ALE in finite volume method | littlelz | Main CFD Forum | 5 | June 21, 2003 13:50 |
finite volume method for CFD analysis of 2D blunt body | Aditya Vaze | Main CFD Forum | 1 | January 19, 2000 14:55 |