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

Finite volume methods

Register Blogs Community New Posts Updated Threads Search

Like Tree19Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 8, 2023, 10:24
Default Finite volume methods
  #1
Senior Member
 
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 184
Rep Power: 4
hunt_mat is on a distinguished road
I've been reading the book, "Finite volume method for hyperbolic problems" by Randall LeVeque. In chapter 4 of his book, he goes on about averaging over the cell, which is an integral (in 1D) from edge to edge, and the integral itself, the average of the quantity over the cell is the new variable, and he talks about scheme using this variable.

I've seen other books on the topic where they do the usual integral but they approximate the average as the centroid multiplied by the volume. Typically the centroid is the mid-point of the cell. Is this the same method? I'm unsure how to get the averaged quantities from the edge values once I've done the integral.
shiva3556 likes this.
hunt_mat is offline   Reply With Quote

Old   August 8, 2023, 10:39
Default
  #2
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,761
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
Consider that you do a volume integral over a computational cell and that this integration is single valued. This volume integral is the cell value. It doesn't matter what location in the cell has this value (you just create a different stencils later one) or that any location actually does match this value.
LuckyTran is offline   Reply With Quote

Old   August 8, 2023, 11:05
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
Quote:
Originally Posted by hunt_mat View Post
I've been reading the book, "Finite volume method for hyperbolic problems" by Randall LeVeque. In chapter 4 of his book, he goes on about averaging over the cell, which is an integral (in 1D) from edge to edge, and the integral itself, the average of the quantity over the cell is the new variable, and he talks about scheme using this variable.

I've seen other books on the topic where they do the usual integral but they approximate the average as the centroid multiplied by the volume. Typically the centroid is the mid-point of the cell. Is this the same method? I'm unsure how to get the averaged quantities from the edge values once I've done the integral.



Your question is, indeed, one of the sources of confusion in evaluating the accuracy order of a FV method. The example I can use in 1D is


du/dt + d F(u)/dx =0



that, expressed in the integral form is


d u_bar/dt + (1/h)*[F(u(x+h/2)) - F(u(x-h/2))]=0 (1)



with



u_bar(x,t) = (1/h)*Int[x-h/2,x+h/2] u(x',t) dx' (2)




You can see that Eq.(1) is not closed in terms of the variable u_bar since the fluxes are function of u.

However, you know the exact functional relation between u_bar and u.
A simple Taylor expansion introduced in the RHS of (2) allows to see that when x is a centroid position, then


u_bar(x,t)=u(x,t) + (h^2/24)*d2u/dx^2 + ... (3)



If a global second order accuracy is the goal, you can simply set the first term in (3) as a second order approximation.


But now the confusion can be generated by the notation of higher order FV method. You can use some high order reconstruction for the flux function F but if you still retain a second order approximation in (3), the resulting variable u_bar will be always second order accurate in terms of u, irrespective of any high order flux reconstruction.


This framework is relevant to understand the properties of convergence in the FV method.


It is worthwhile to note that the fact that Eq.(2) is not closed is exactly the problem you see in the LES equations based on the top-hat filter.
hunt_mat likes this.
FMDenaro is offline   Reply With Quote

Old   August 8, 2023, 12:08
Default
  #4
Senior Member
 
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 184
Rep Power: 4
hunt_mat is on a distinguished road
So if my set of equations are:

nu_t=u_h
(nu*u)_t =((D/nu)*u_h+u^2/2)_h
h_x=1/nu
Here h is the mass co-ordinate introduced into LeVeque (eq 2.107), my h is his \xi.
And I do the integral over a generic cell to get:

nu_i*h_i=[u]_{h_}^{h+}
nu_i*u_i*h_i=[(D/nu)*u_h+u^2/2]_{h_}^{h+}

Where I have approximated the average using your equation (3). I then use averaging to obtain the relevant quantities inside the cell? Using averaging in this way doesn't yield an upwind scheme for nu, is this a problem in this set up?

When it comes to boundary conditions, I have odd conditions, I know u at one end, and not the other. On the other end, I know u_h but not u. Do I use the averaging trick to find these?
hunt_mat is offline   Reply With Quote

Old   August 8, 2023, 12:14
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 if my set of equations are:

nu_t=u_h
(nu*u)_t =((D/nu)*u_h+u^2/2)_h
h_x=1/nu
Here h is the mass co-ordinate introduced into LeVeque (eq 2.107), my h is his \xi.
And I do the integral over a generic cell to get:

nu_i*h_i=[u]_{h_}^{h+}
nu_i*u_i*h_i=[(D/nu)*u_h+u^2/2]_{h_}^{h+}

Where I have approximated the average using your equation (3). I then use averaging to obtain the relevant quantities inside the cell? Using averaging in this way doesn't yield an upwind scheme for nu, is this a problem in this set up?

When it comes to boundary conditions, I have odd conditions, I know u at one end, and not the other. On the other end, I know u_h but not u. Do I use the averaging trick to find these?



Please, attach a file, this way I'm sure to understand your notation
FMDenaro is offline   Reply With Quote

Old   August 8, 2023, 12:28
Default
  #6
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 FMDenaro View Post
Please, attach a file, this way I'm sure to understand your notation



Ok, I had a look to the equations in the textbook, you are using a Lagrangian approach, therefore you have a material volume, not an Eulerian volume. That means you follow a certain material volume that at t0 has position x0. The shape of your volume is one of the unknown to determine. Note that this is very different from what I wrote above that refers to the Eulerian FV method.

However, you alwaya have the fact that the time variation of a variable integrated over the lagrangian volume depends on the fluxes on the surface.

That is, the equation and the intial condition do not close theoretically the problem.
FMDenaro is offline   Reply With Quote

Old   August 8, 2023, 12:58
Default Lagrangian conservative form.
  #7
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
Please, attach a file, this way I'm sure to understand your notation
My idea is in section 2.
Attached Files
File Type: pdf Lagrangian_FD.pdf (146.4 KB, 18 views)
hunt_mat is offline   Reply With Quote

Old   August 8, 2023, 13:02
Default
  #8
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
Ok, I had a look to the equations in the textbook, you are using a Lagrangian approach, therefore you have a material volume, not an Eulerian volume. That means you follow a certain material volume that at t0 has position x0. The shape of your volume is one of the unknown to determine. Note that this is very different from what I wrote above that refers to the Eulerian FV method.

However, you alwaya have the fact that the time variation of a variable integrated over the lagrangian volume depends on the fluxes on the surface.

That is, the equation and the intial condition do not close theoretically the problem.
I'm aware of that, I have two equations that I solve to close the system. The new co-ordinates x, can be found by u=x_t. To find the new h, I have the equation h_x=1/nu. Solving these two equations closes the system.
hunt_mat is offline   Reply With Quote

Old   August 8, 2023, 13:20
Default
  #9
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
My idea is in section 2.



But, according to Leveque, the equations (2.107) are formulated in differential form but the varibles are already considered to be volume-integrated.

Why in your Sec.2 you introduced e further integration?
FMDenaro is offline   Reply With Quote

Old   August 8, 2023, 13:57
Default
  #10
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
But, according to Leveque, the equations (2.107) are formulated in differential form but the varibles are already considered to be volume-integrated.

Why in your Sec.2 you introduced e further integration?
So equations (18) and (19) are my equations in conservative form written in Lagrangian mass co-ordinates. I integrate both sides over a general cell. This leaves the fluxes to be evaluated on the cell boundaries. I then use the averaging trick to get values at the cell centroids.
hunt_mat is offline   Reply With Quote

Old   August 8, 2023, 14:08
Default
  #11
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 equations (18) and (19) are my equations in conservative form written in Lagrangian mass co-ordinates. I integrate both sides over a general cell. This leaves the fluxes to be evaluated on the cell boundaries. I then use the averaging trick to get values at the cell centroids.



But you have already that ... look at the equation before (2.106). The point xi1 and xi2 are the face of the lagrangian volume, not a generic cell.
FMDenaro is offline   Reply With Quote

Old   August 8, 2023, 14:29
Default
  #12
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
But you have already that ... look at the equation before (2.106). The point xi1 and xi2 are the face of the lagrangian volume, not a generic cell.
Then I'm confused about what you're asking. If we look at them as PDEs then we can split the domain into cells as I did.
hunt_mat is offline   Reply With Quote

Old   August 8, 2023, 14:48
Default
  #13
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
Then I'm confused about what you're asking. If we look at them as PDEs then we can split the domain into cells as I did.
This is somehow confusing because you have a lagrangian PDE equation for the volume-averaged variable. If you integrate further your variable is averaged twice. Just solve the integral equation written above (2.106).
FMDenaro is offline   Reply With Quote

Old   August 8, 2023, 15:17
Default
  #14
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
This is somehow confusing because you have a lagrangian PDE equation for the volume-averaged variable. If you integrate further your variable is averaged twice. Just solve the integral equation written above (2.106).
In my particular system, I have a second-order derivative though.

Just think of h as being another variable.
hunt_mat is offline   Reply With Quote

Old   August 8, 2023, 15:26
Default
  #15
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
Eq.(2.104) is the integral equation for the specific volume.
FMDenaro is offline   Reply With Quote

Old   August 8, 2023, 15:41
Default
  #16
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
Eq.(2.104) is the integral equation for the specific volume.
Later on though he derives differential equations that look almost linear though. The mass is used as a variable.
hunt_mat is offline   Reply With Quote

Old   August 8, 2023, 18:00
Default
  #17
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,761
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
You have continuity and momentum (18) and (19). You integrate over the volume the FVM way and apply gauss divergence theorem which gives you (20) and (21). The integral of a volume average quantity is the average and you do not need (22). I'm not sure if you skipped a step but in (23) the dh should be inside the time derivative because h is time-depedent, unlike the Eulerian case. Or maybe you meant to explain the extra conditions but didn't have the time.


And then, you retrieve the fluxes via reconstruction from the cell average quantities. And here is where the error analysis that Filippo described would come into play.
LuckyTran is offline   Reply With Quote

Old   August 8, 2023, 18:19
Default
  #18
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
Still not clear to me the basic idea ... h depends on time, the grid is lagrangian not eulerian, the equations are somehow the 1D counterpart of the equation deduced in the Reynolds transport theorem.

As appear in LeVeque, Sec.2.13 describes the integral form of the two equations (integral between mass-points xi1 and x2) for U_bar and V_bar. These latter are, however, still lagrangian averaged-value and the reconstruction of the fluxes from averaged values is required.


Then, the presence of second derivatives changes the mathematical character of the problem (from hyperbolic to parabolci) and the number of boundary conditions required.
FMDenaro is offline   Reply With Quote

Old   August 8, 2023, 19:32
Default
  #19
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 LuckyTran View Post
You have continuity and momentum (18) and (19). You integrate over the volume the FVM way and apply gauss divergence theorem which gives you (20) and (21). The integral of a volume average quantity is the average and you do not need (22). I'm not sure if you skipped a step but in (23) the dh should be inside the time derivative because h is time-depedent, unlike the Eulerian case. Or maybe you meant to explain the extra conditions but didn't have the time.


And then, you retrieve the fluxes via reconstruction from the cell average quantities. And here is where the error analysis that Filippo described would come into play.
You're absolutely correct, h is indeed time dependent, however. As the derivative is the integrand, the approximation means that the dh isn't inside the partial derivative.

One of the problems I have is how to apply the boundary conditions as well.
hunt_mat is offline   Reply With Quote

Old   August 8, 2023, 19:37
Default
  #20
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
Still not clear to me the basic idea ... h depends on time, the grid is lagrangian not eulerian, the equations are somehow the 1D counterpart of the equation deduced in the Reynolds transport theorem.

As appear in LeVeque, Sec.2.13 describes the integral form of the two equations (integral between mass-points xi1 and x2) for U_bar and V_bar. These latter are, however, still lagrangian averaged-value and the reconstruction of the fluxes from averaged values is required.


Then, the presence of second derivatives changes the mathematical character of the problem (from hyperbolic to parabolci) and the number of boundary conditions required.
I used the co-ordinate system in eq 2.107 in Leveque, but my initial equations are different but I still have the conservation of mass nu_t=u_h, but I have a second order equation, parabolic for the other. In this approach, I can write my system in a conservative way so I can use the finite volume approach which makes things easier so I'm told.
hunt_mat 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
multiphaseEulerFoam FOAM FATAL IO ERROR qutadah.r OpenFOAM Running, Solving & CFD 11 December 10, 2021 21:18
SU2 7.0.7 Built on CentOS 7, parallel computation pyscript mpi exit error? EternalSeekerX SU2 3 October 9, 2020 19:28
Problem of simulating of small droplet with radius of 2mm liguifan OpenFOAM Running, Solving & CFD 5 June 3, 2014 03:53
Gradient evaluation in Finite Volume Methods yidongxia Main CFD Forum 7 August 6, 2012 11:23
Unstructured grid finite volume methods Marcus Main CFD Forum 3 December 5, 2000 01:25


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