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

Flux discretization of 2D Compressible Navier-Stokes

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By LuckyTran

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 27, 2017, 13:12
Default Flux discretization of 2D Compressible Navier-Stokes
  #1
Senior Member
 
Selig
Join Date: Jul 2016
Posts: 213
Rep Power: 10
selig5576 is on a distinguished road
Hi all,

I am writing a solver for the 2D compressible Navier-Stokes equations in conservative form. When it is in conservative form it can be written as a 2D hyperbolic conservation law, but with a viscous flux. To start off simple, I would like to apply the Rusanov Flux (Local Lax Friedrichs) for my flux discretization, how I am unsure how to handle the viscous terms. A part of me wants to separate the fluxes and perform 2nd-order central differencing on the viscous terms and use a standard Rusanov flux for the advection terms, but that would not maintain conservative form.

I have 2 books on solving the compressible Navier-Stokes, and both use MacCormack's method. Furthermore, it uses backward/forward differencing to achieve 2nd-order accuracy. Would I apply a similar approach when using the Local Lax Friedrichs on the viscous flux?
selig5576 is offline   Reply With Quote

Old   March 27, 2017, 15:31
Default
  #2
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,769
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by selig5576 View Post
Hi all,

I am writing a solver for the 2D compressible Navier-Stokes equations in conservative form. When it is in conservative form it can be written as a 2D hyperbolic conservation law, but with a viscous flux. To start off simple, I would like to apply the Rusanov Flux (Local Lax Friedrichs) for my flux discretization, how I am unsure how to handle the viscous terms. A part of me wants to separate the fluxes and perform 2nd-order central differencing on the viscous terms and use a standard Rusanov flux for the advection terms, but that would not maintain conservative form.

I have 2 books on solving the compressible Navier-Stokes, and both use MacCormack's method. Furthermore, it uses backward/forward differencing to achieve 2nd-order accuracy. Would I apply a similar approach when using the Local Lax Friedrichs on the viscous flux?


For the spatial discretization of the viscous terms I suggest to use a central linear flux reconstruction. That would be second order accurate and it is in conservative form. Furthermore, a time integration like the Crank-Nicolson scheme would be suitable.
FMDenaro is offline   Reply With Quote

Old   March 28, 2017, 10:24
Default
  #3
Member
 
Anh
Join Date: Sep 2014
Posts: 69
Rep Power: 11
dinhanh is on a distinguished road
For viscous term, It uses central scheme at i-1/2 and i+1/2 for x direction, similar for y direction
dinhanh is offline   Reply With Quote

Old   March 28, 2017, 11:10
Default Flux discretization for viscous terms
  #4
Senior Member
 
Selig
Join Date: Jul 2016
Posts: 213
Rep Power: 10
selig5576 is on a distinguished road
Hi,

Thank you for the replies. So if I wanted to do a simple 2nd-order central difference. For example, given the term (and focussing only on the u velocity)

F(u,v) = \frac{4}{3} \mu \frac{\partial u}{\partial x} - \frac{2}{3} \mu \frac{\partial v}{\partial y}

F_{i+1/2} =  \frac{4}{3} \mu \frac{u_{i+1} - u_{i}}{\Delta x},
F_{i-1/2} =  \frac{4}{3} \mu \frac{u_{i} - u_{i-1}}{\Delta x}

So putting this together we have

\frac{\partial F}{\partial x} = \frac{\partial}{\partial x} \left[\frac{4}{3} \mu \frac{\partial u}{\partial x} - \frac{2}{3} \mu \frac{\partial v}{\partial y}\right] = \frac{F_{i+1/2} - F_{i-1/2}}{\Delta x} =  \frac{4}{3} \mu \frac{u_{i+1} - 2 u_{i} + u_{i-1}}{(\Delta x)^{2}}
selig5576 is offline   Reply With Quote

Old   March 28, 2017, 11:20
Default
  #5
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,769
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Well, this is correct if you have a uniform grid and if mu is constant.
In general in a FV implementation you compute only the fluxes on all faces (and you have to compute also the integral of the flux) and then the sum gives the update. As a consequence, you work without assuming that the grid size is uniform and mu can be variable as happens in compressible flow when you can express the dependence on the temperature.
FMDenaro is offline   Reply With Quote

Old   March 28, 2017, 11:26
Default Flux discretization
  #6
Senior Member
 
Selig
Join Date: Jul 2016
Posts: 213
Rep Power: 10
selig5576 is on a distinguished road
Hi FM Denaro,

Currently I am working under the assumption of constant mu and a uniform grid. Do you have any good references on the finite volume for non-uniform grids?

Thanks,
Selig
selig5576 is offline   Reply With Quote

Old   March 28, 2017, 11:32
Default
  #7
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,769
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by selig5576 View Post
Hi FM Denaro,

Currently I am working under the assumption of constant mu and a uniform grid. Do you have any good references on the finite volume for non-uniform grids?

Thanks,
Selig

It is a general topic you can find in any good textbook about CFD. Start having a look to the book of Peric and Ferziger. Of course, differences appear if you work with non-uniform structured or unstructured grids.
FMDenaro is offline   Reply With Quote

Old   March 29, 2017, 22:25
Default
  #8
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,675
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
Non-uniform catesian grids are straightforward. You only need to calculate the local distances between cells and include that as a parameter (i.e. it's no longer {(\Delta x)^{2}} everywhere). You simply need to resist doing analytical simplifications. For example, as Filippo mentioned, don't do this thing where you put them together because the {(\Delta x)^{2}} is going to depend on the local grid and don't also assume mu is constant. It also would have been more obvious that diffusive fluxes are conserved

Quote:
Originally Posted by selig5576 View Post
So putting this together we have
\frac{\partial F}{\partial x} = \frac{\partial}{\partial x} \left[\frac{4}{3} \mu \frac{\partial u}{\partial x} - \frac{2}{3} \mu \frac{\partial v}{\partial y}\right] = \frac{F_{i+1/2} - F_{i-1/2}}{\Delta x} =  \frac{4}{3} \mu \frac{u_{i+1} - 2 u_{i} + u_{i-1}}{(\Delta x)^{2}}
For non-uniform grids (but still cartesian) few things change except you might want to tweak the the coefficients in your discretization schemes. But from a code-writing standpoint, that doesn't stop you. I.e. instead of [1 -2 1] for the diffusive term you might want to do [1.5 1.5 1] where the coefficients are related to the local cell distances.

There is an intermediate step between uniform cartesian and a completely unstructured grid that I would recommend. That is the uniform (or non-uniform) structured grid but non-cartesian. I.e. instead of a bunch of rectangles or boxes that are aligned with coordinate system, you have a bunch of diamonds, trapezoids, parallelograms, or boxes that are misaligned with the coordinate. In this situation, the vector between two cell centers is mis-aligned with the derivatives in each direction. Now you have to keep track of the skewness angle of every cell face.

Unstructured grids are similar. The challenge with unstructured grids, is you have to store cell connectivity data. For each cell, you need a way to figure out which cells are the neighboring cells. As soon as you skewed cells, you generally want to upgrade your method to calculate the cell gradients from a simple green-gauss method to what's commonly referred to as a least squares based method.
FMDenaro likes this.
LuckyTran is offline   Reply With Quote

Reply


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
Filtered navier stokes equation..LES:: Palani Velladurai Main CFD Forum 7 September 6, 2013 02:51
Adding a term to Navier Stokes Equation ashtonJ CFX 3 January 15, 2011 06:32
Navier stokes compresible viscid flow fea, somebody can help? Jose Choy Main CFD Forum 3 October 24, 2003 02:28
total mass flux correction for compressible fluid? Francesco Di Maio Main CFD Forum 0 August 21, 2000 04:23
help: I am trying to solve Navier Stokes compressible and viscid flow Jose Choy Main CFD Forum 2 May 18, 2000 05:45


All times are GMT -4. The time now is 03:26.