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

Why we use Gauss divergence theorem in Weak form of Navier-Stokes equation?

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By adrin
  • 1 Post By FMDenaro

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 26, 2016, 23:04
Post Why we use Gauss divergence theorem in Weak form of Navier-Stokes equation?
  #1
Member
 
AGN
Join Date: Dec 2011
Posts: 70
Rep Power: 14
arungovindneelan is on a distinguished road
While deriving integral form of NS equation, we use Gauss divergence*theorem to convert volume integral to surface integral. Why we are doing this?

Divergence term has derivative calculation. In high-speed flow there will be discontinuity in flux, so calculating derivative is meaningless. If this is a reason resulting*form of NS equation after divergence theorem also looks like equivalent*finite difference form of derivative calculation.

We can evaluate flux across boundary easily if we use divergence theorem. Using that we can ensure conservativeness of flux. But conservativeness of flux does not ensure conservativeness*of mass, momentum etc. for transient case (because fluxes are discontinuous in transient stage but mass, momentum etc. are not) *. Because conservativeness*is based on combined spatial and temporal parts. I believe only doing spatial will not ensure conservativeness except steady state case.

Why we use Gauss divergence theorem in Weak form of Navier-Stokes equation? - ResearchGate. Available from: https://www.researchgate.net/post/Wh...366d4b5f24bc51 [accessed Sep 27, 2016].
arungovindneelan is offline   Reply With Quote

Old   September 27, 2016, 01:15
Default
  #2
Senior Member
 
Michael Prinkey
Join Date: Mar 2009
Location: Pittsburgh PA
Posts: 363
Rep Power: 25
mprinkey will become famous soon enough
By transforming the strong form into the weak form over finite volumes allows us to build discrete systems that are precisely conservative. This occurs because the flux integrals are computed on cell faces. And conserved quantities flow out of one cell and into another cell. This is valuable because it allows (nearly) machine precision conservation of mass, species, and energy. Those are absolutely critical when simulating, say, flows with chemical reactions where trace amounts of species can seriously impact flow behavior and reaction rates.

Finite difference implementations of the strong form do not naturally offer the same conservation properties. They can be assembled, but only by ultimately recasting them as "control volume" finite difference methods.
mprinkey is offline   Reply With Quote

Old   September 27, 2016, 01:31
Default
  #3
Member
 
AGN
Join Date: Dec 2011
Posts: 70
Rep Power: 14
arungovindneelan is on a distinguished road
I think you misunderstand the quest. Please tell me what the significance or use of gauss divergence theorem in integral form of NS equation
arungovindneelan is offline   Reply With Quote

Old   September 27, 2016, 01:57
Default
  #4
Senior Member
 
Michael Prinkey
Join Date: Mar 2009
Location: Pittsburgh PA
Posts: 363
Rep Power: 25
mprinkey will become famous soon enough
I understand the question perfectly. Divergence terms in the strong form become face interpolations in the integral weak form. Quadrature over finite volume boundary is perfectly conservative no matter how face interpolation is performed or how discontinuous the flow variables. Take mass for an example and assume steady state for simplicity. Assume also a closed system so that the boundary of domain has zero-flux walls.

div(rho U) = 0

In weak form integrated over a control volume, that becomes SUM_faces((rho U)_f) = 0. For two neighboring CVs, the same value of rho U is computed for the shared face. The mass flux exits the first cell and enters the second cell. In our example with zero-flux boundaries, you start with some total mass in the system...and you evolve/relax the solution and end up with the same total mass in the system. That feature is an implicit characteristic of the finite volume method and is not at all guaranteed in a vanilla finite difference treatment of the strong form.

If you time integrate a transient form, the conservation is maintained in the same way. The flux into and out of pairs of cells is exactly balanced. Each are multiplied with the same timestep, so over the course of the dt, the same flux exits one cell and enters its neighbor. It is obvious for first-order Euler integrations that this is the case, but the same is true for, say, Adams Bashforth Moulton and Runge-Kutta time integration schemes when you look closely.

This is the fundamental construct of flux conservative formulations. You can read in detail in any CFD book written in the last 20 years.
mprinkey is offline   Reply With Quote

Old   September 27, 2016, 04:16
Default
  #5
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by arungovindneelan View Post
While deriving integral form of NS equation, we use Gauss divergence*theorem to convert volume integral to surface integral. Why we are doing this?

Divergence term has derivative calculation. In high-speed flow there will be discontinuity in flux, so calculating derivative is meaningless. If this is a reason resulting*form of NS equation after divergence theorem also looks like equivalent*finite difference form of derivative calculation.

We can evaluate flux across boundary easily if we use divergence theorem. Using that we can ensure conservativeness of flux. But conservativeness of flux does not ensure conservativeness*of mass, momentum etc. for transient case (because fluxes are discontinuous in transient stage but mass, momentum etc. are not) *. Because conservativeness*is based on combined spatial and temporal parts. I believe only doing spatial will not ensure conservativeness except steady state case.

Why we use Gauss divergence theorem in Weak form of Navier-Stokes equation? - ResearchGate. Available from: https://www.researchgate.net/post/Wh...366d4b5f24bc51 [accessed Sep 27, 2016].


The weak form of the differential equation is a mathematical formulation in which the original equation is projected along some shape functions that must have some requirements. The Gauss theorem is applied to lower the degree of derivation so that for first order equations (like Euler), you have no longer the differentiability requirement. For the second order equations (like NS) the differentiability remains required but, differently from inviscid flows, viscous flows do not actually produce a mathematical discontinuity. This is the reason why the weak form is particulary relevant for Euler equations. For the NS equation the reason to use the weak form is no longer for a mathematical constraint but for numerical properties.

Now, one of the weak forms that can be formulated corresponds to the integral formulation of the conservative equations. In such case, conservation of mass, momentum and total energy is fulfilled even for the unsteady case. It states that the total conserved variable in a volume can vary in time only if there is a net flux difference.
FMDenaro is offline   Reply With Quote

Old   September 27, 2016, 04:17
Default
  #6
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
PS: have a look to the book of Leveque
FMDenaro is offline   Reply With Quote

Old   September 27, 2016, 04:36
Default
  #7
Member
 
AGN
Join Date: Dec 2011
Posts: 70
Rep Power: 14
arungovindneelan is on a distinguished road
You have nicely explained why we use weak form for flows with shocks. Could you explain why we use gauss-divergence theorem in weak form that I couldn't found or understand in any book!. If your answer is that reduce the derivative requirement by one, then the resulting equation after applying gauss-divergence is equivalent to first derivative in finite difference form. That also looks like calculating derivative?
arungovindneelan is offline   Reply With Quote

Old   September 27, 2016, 04:58
Default
  #8
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by arungovindneelan View Post
You have nicely explained why we use weak form for flows with shocks. Could you explain why we use gauss-divergence theorem in weak form that I couldn't found or understand in any book!. If your answer is that reduce the derivative requirement by one, then the resulting equation after applying gauss-divergence is equivalent to first derivative in finite difference form. That also looks like calculating derivative?

no, not at all! First, the weak form is a mathematical formulation in the continuous form, nothing realted to discretization.
Then, if as weak form you want to use the integral form of the conservation equation you get (I use a very simple model):


df/dt + div F = 0 -> d/dt Int[V] f dx + Int [S] n.F dS = 0

so that:


d f_av/dt + 1/|V| Int [S] n.F dS = 0

produces a very different form from the differential one.
This is the key to understand the difference between Finite Volume (integral form) and Finite Difference (differential one) discretizations.
FMDenaro is offline   Reply With Quote

Old   September 27, 2016, 05:25
Default
  #9
Member
 
AGN
Join Date: Dec 2011
Posts: 70
Rep Power: 14
arungovindneelan is on a distinguished road
Please see the attachments, last equation in that attachment equivalent to finite difference form of first derivative evaluation. Could you tell me the advantage? Why I'm interested in that is we are losing accuracy and wasting lot of computational cost in calculating flux and boundary normal calculation and error is accumulating when we use skewed mesh. I'm interested in framing one numerical method that ensure conservativeness and that should work pretty fine in skewed mesh. The black sheep here is cell normal calculator and the cause is gauss-divergence theorem. So I want to study that properly.
Attached Images
File Type: jpg 1.jpg (12.3 KB, 19 views)
File Type: jpg 2.jpg (30.8 KB, 19 views)
arungovindneelan is offline   Reply With Quote

Old   September 27, 2016, 06:04
Default
  #10
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by arungovindneelan View Post
Please see the attachments, last equation in that attachment equivalent to finite difference form of first derivative evaluation. Could you tell me the advantage? Why I'm interested in that is we are losing accuracy and wasting lot of computational cost in calculating flux and boundary normal calculation and error is accumulating when we use skewed mesh. I'm interested in framing one numerical method that ensure conservativeness and that should work pretty fine in skewed mesh. The black sheep here is cell normal calculator and the cause is gauss-divergence theorem. So I want to study that properly.

The equation you posted need some attention. As you can see, values of fluxes at intermediate faces are needed. But that form can be expressed both for the integral (weak) form and for the differential conservative form. You need to see the original continuous equation that is discretized.
For example, I write first the differential Burgers' equation,

du/dt + d/dx (u^2/2) = 0

that you can discretize (first order time and second in space) as (f=u^2/2)

u(i,n+1)-u(i,n) + dt * [ f(i+1/2) -f(i-1/2)]/dx = 0 (1)

it remains to express the fluxes at the faces in term of grid values.

Conversely, the integral form would write (still in continuous form)

d/dt Int[V] u dx + f(x+dx/2) -f(x-dx/2) = 0

or, defining the average value u_av,

d u_av/dt + [f(x+dx/2) -f(x-dx/2)]/dx = 0 (2)

if you compare (1) and (2) you see the differences between differential and integral formulations.
Be carefull that in 2D the difference appears more relevant due to the appearence of the surface integrals.

In conclusion, for conservation of the variables, I strongly advice to use the integral form.
FMDenaro is offline   Reply With Quote

Old   September 27, 2016, 20:16
Default
  #11
Senior Member
 
adrin
Join Date: Mar 2009
Posts: 115
Rep Power: 17
adrin is on a distinguished road
Judging from your question and the formulations you provided, it appears to me that your fundamental problem is actually with calculus, not weak vs strong discretization. In particular, it seems that you have difficulty with the divergence theorem itself, at its core level.

Let's look at the 1-D counterpart of the divergence theorem:

Int[(df/dx)*dx] = Int[df] = f(R) - f(L) Eq. (1)

where R and L are the right and left end points, respectively.

The integral above is _exact_ and _analytic_.

Now, let's consider the 1-D unsteady equation discussed earlier, and integrate it over the L-R interval:

d/dt{Int[f*dx]} + Int[(df/dx)*dx] = 0 Eq. (2)

d/dt{Int[f*dx]}/h + {f(R) - f(L)}/h = 0 Eq. (3)

where h = R - L, and I simply divided Eq.(2) by h and used Eq. (1) to arrive at Eq. (3).

Note that Eq. (3) is still _exact_; i.e. _no_ assumptions and/or simplifications have been made up to this point! The fact that {f(R) - f(L)}/h _looks_ identical to a centered finite difference (FD) discretization is simply fortuitous at this stage.

The point of convergence/divergence between a FD discretization and a finite volume (FV) formulation is what one assumes about the variation of function f within h and dt. If f is assumed to vary linearly within h, then the two different approaches will yield identical discrete forms. If f is a higher-order polynomial (or other high-order function), the FD and FV results will generally be different (specific conditions would have to be imposed to make the integral in FV and differencing in FD equivalent).

In the 2D formulations you provided you have actually made a few implicit assumptions without knowing it. In 2D (rectangular grids), we'd have

Int[ Int[(df/dx)*dx] * dy] = Int[{f(R) - f(L)}*dy] = Int[f(R)*dy] - Int[f(L)*dy]

The above is _exact_, and the only way it becomes equal to {f(R) - f(L)}*dy (similar to your formulation) is if a Taylor series expansion of f is applied at the _midpoint_ of dy and terms of order 2 and higher are ignored. It is not difficult to see that one may use a whole host of other assumptions about f to arrive at different discretizations.

Finally, the divergence theorem allows one to easily discretize the equation for complex computational domains, whereas this is not easily doable in a FD formulation - neither will FD and FV necessarily be identical in this case even for low-order discretization.

adrin
arungovindneelan likes this.
adrin is offline   Reply With Quote

Old   September 28, 2016, 01:01
Default
  #12
Member
 
AGN
Join Date: Dec 2011
Posts: 70
Rep Power: 14
arungovindneelan is on a distinguished road
Dear Adrin,
Have you come across any numerical scheme, that works on integral form without using the "gauss-divergence theorem" (i.e) will not add flux around the cell?
arungovindneelan is offline   Reply With Quote

Old   September 28, 2016, 01:28
Default
  #13
Senior Member
 
adrin
Join Date: Mar 2009
Posts: 115
Rep Power: 17
adrin is on a distinguished road
The question for you is: if the integrand could be written in terms of a divergence (or curl) why would you opt _not_ to take advantage of it? It is well-known that numerical differentiation of a function can be noisy and eventually lead to numerical instability, whereas integration tends to have a smoothing effect and improves stability.

So, say, you wish to evaluate int[Div(F) dV]. Based on what you are suggesting one would first have to evaluate Div(F) numerically (with its own errors) and then integrate the outcome of the latter. If we perform these two processes explicitly in two sequential steps we have (1) unnecessarily increased computational cost and (2) we have introduced unnecessary errors and instability problems. On the other hand, if we combine these two steps and perform simplifications, etc, before we finally apply numerics, we essentially perform a "poor man's" version of the divergence theorem anyway. So, why not do it properly in the first place?

int[Div(F) dV] = int[F.dS] is an exact identity that simplifies the integration process tremendously by (1) converting a volume integral into that of a surface, and (2) removing the evaluation of Div(F), and all the above-mentioned complexities, altogether. So, once again, why would anyone opt for the volume integral unless it actually evaluates more easily than its surface integral counterpart?

adrin
adrin is offline   Reply With Quote

Old   September 28, 2016, 04:36
Default
  #14
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
To give an answer to your final question, you should consider the field of the LES. Usually, a type of filter called top-hat correspond to a volume averaging.
According to the filter concept, you apply it on any terms of the NS, in other words you apply the volume integral to any term. The difference is that the Gauss theorem is not applied :

1/|V| Int[V] Div F dx = Div 1/|V| Int[V] F dx = Div [F]_filt


That requires the mathematical property that derivative and integral do commute.

You could find some details here:
https://www.researchgate.net/publica...dy_Simulations
arungovindneelan likes this.
FMDenaro is offline   Reply With Quote

Old   September 28, 2016, 04:53
Default
  #15
Senior Member
 
adrin
Join Date: Mar 2009
Posts: 115
Rep Power: 17
adrin is on a distinguished road
Good point, but I was considering the specific (and the more straightforward) question asked by AGN. It still appears to me that AGN's fundamental difficulty is one of (not) appreciating the Gauss theorem and how it was derived, which is just calculus and at least one step before questions related to differences in FD and FV formulations - certainly a few steps before one considers LES

adrin
adrin is offline   Reply With Quote

Old   September 28, 2016, 05:24
Default
  #16
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
yes, for this reason I cited the fundamental of LES where the equations are in continuous form and no FD/FV discretization are involved
FMDenaro is offline   Reply With Quote

Reply

Tags
conservative form, finite volume method, integral form, navier stokes equation


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
Calculation of the Governing Equations Mihail CFX 7 September 7, 2014 07:27
second derivatives in the navier stokes equation catapult OpenFOAM Running, Solving & CFD 0 March 27, 2014 10:32
Matlab CFD Complete Navier Stokes equation archeoptyrx Main CFD Forum 1 July 11, 2013 10:24
Derivation of Momentum Equation in Integral Form Demonwolf Main CFD Forum 2 October 29, 2009 20:53
Full navier stokes Equation descretized form rawin Main CFD Forum 1 September 21, 2005 13:42


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