CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

WENO scheme validation - rhoCentralFoam - shockTube/Shu-Osher problems

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   June 12, 2017, 09:23
Default WENO scheme validation - rhoCentralFoam - shockTube/Shu-Osher problems
  #1
Member
 
Join Date: Sep 2015
Location: Singapore
Posts: 58
Rep Power: 4
usv001 is on a distinguished road
Dear all,

I have implemented an n-th order WENO scheme in OpenFOAM and modified the rhoCentralFoam solver (with TVD 3rd order RK time marching).

I have simulated both the shockTube and the Shu-Osher problems. The solution for the shockTube problem looks fine for both the 5th and 7th order WENO schemes. However, small wiggles occur near the small shocklets for the Shu-Osher problem. So far, I have not seen anybody reporting about this problem. I have no idea why this is happening.

Has anyone faced this problem or something similar to this when implementing WENO schemes?

With many thanks,
USV
Attached Images
File Type: png shockTube-WENO5.png (24.3 KB, 37 views)
File Type: png shockTube-WENO7.png (24.0 KB, 32 views)
File Type: png shuOsher-WENO5.png (32.8 KB, 34 views)
File Type: png shuOsher-WENO7.png (32.0 KB, 32 views)
usv001 is offline   Reply With Quote

Old   June 14, 2017, 09:06
Default Update & more info
  #2
Member
 
Join Date: Sep 2015
Location: Singapore
Posts: 58
Rep Power: 4
usv001 is on a distinguished road
Dear all,

I managed to eliminate the oscillations but I have no idea why it works. I just want to give more information so that someone might be able to help me understand.

First of all, previously, I was reconstructing \rho, \rho{}u and p using the WENO scheme. Then, I applied the HLL flux at the interface which led to the oscillations for the Shu-Osher test case.

Today, I modified the code using the method described here. Basically, instead of reconstructing the flow variables \textbf{q}, the fluxes \textbf{F}^{\pm} were reconstructed from the left and right sides, respectively.

\textbf{q} = \left[ \rho, \rho{}u, \rho{}E \right]

\textbf{F}^{\pm} (\textbf{q}) = \left[ \rho{}u, \rho{}u^2 + p, (\rho{}E +p)u \right] \pm a_{max} \textbf{q}

Then, the Lax–Friedrichs (LxF) numerical flux was defined as:

\textbf{F}_{1/2} = \frac{1}{2} \left[ \textbf{F}_{1/2}^{+} + \textbf{F}_{1/2}^{-} \right]

This appears to have solved the problem of the oscillations that I mentioned in the previous post. However, I am at a loss as to why WENO-reconstructing [MATH]\textbf{q}[\MATH] and computing an upwind-biased numerical flux (e.g. HLL, HLLC) leads to oscillations. I will be grateful if anyone could explain how to properly implement the HLL numerical flux scheme in this case.

With many thanks,
USV
Attached Images
File Type: png shuOsher-WENO5-LxF.png (34.7 KB, 23 views)
usv001 is offline   Reply With Quote

Old   June 30, 2017, 23:36
Default Solution
  #3
Member
 
Join Date: Sep 2015
Location: Singapore
Posts: 58
Rep Power: 4
usv001 is on a distinguished road
Dear all,

I would like to report on a (known) solution for this problem. Apparently, WENO schemes can be oscillatory when used to reconstruct primitive or conservative variables but not so when used to reconstruct characteristic variables.

A friend of mine coded WENO7 with HLL flux separately in Matlab and found that it led to the same oscillations as OpenFOAM. He further went to code WENO7 with characteristic variables and found that the oscillations did not appear. However, he also commented that the computation time was 3-5 times longer even for a specialized 1D case.

USV
usv001 is offline   Reply With Quote

Old   September 10, 2017, 03:51
Default
  #4
New Member
 
Frank Ann
Join Date: Dec 2016
Posts: 6
Rep Power: 2
ajogajog is on a distinguished road
Hi usv,

I want to implement a high-order difference scheme in openfoam too, can you tell me that how did you implement WENO in openfoam? The RK time scheme is accomplished by modified the solver, how about weno scheme?

I will be grateful if you could share it or give me some advice.

Thanks!

Regards,
ajog

Last edited by ajogajog; September 10, 2017 at 07:10.
ajogajog is offline   Reply With Quote

Old   September 14, 2017, 12:06
Default
  #5
Member
 
Join Date: Sep 2015
Location: Singapore
Posts: 58
Rep Power: 4
usv001 is on a distinguished road
Quote:
Originally Posted by ajogajog View Post
Hi usv,

I want to implement a high-order difference scheme in openfoam too, can you tell me that how did you implement WENO in openfoam? The RK time scheme is accomplished by modified the solver, how about weno scheme?

I will be grateful if you could share it or give me some advice.

Thanks!

Regards,
ajog
Hi ajog,

I developed a finite volume (FV) formulation since OpenFOAM is based on that. I am sorry that I can't share the code (yet) but I can give you some details.

First of all, you need to build the stencils. If you intend to use a finite difference (FD) formulation, then you are probably assuming that cell values represent the point values at the cell centres. So, there will be a stencil for each cell. Unless you have a structured mesh consisting of a single block, the ordering of cells in OpenFOAM does not follow any particular pattern which you can exploit to avoid building the stencils.

Secondly, since you intend to use a finite difference (FD) formulation, I am going to assume that your mesh is Cartesian and uniform. In that case, you can follow any standard paper on WENO for the reconstruction coefficients, smoothness indicators, linear weights, etc. The simplicity of the mesh means that you can hard code these as functions that you use in the solver. If your mesh is non-uniform, then each cell/stencil will have its own set of reconstruction coefficients, smoothness indicators, linear weights, etc. That will be harder to implement.

Thirdly, you'll need to figure out how you're going to treat the boundaries. Periodic boundaries have the advantage of not requiring any ghost cell treatment (but will require some clever coding). If you have other types of boundaries, you can choose to adopt the ghost cell method or reduce the order of reconstruction close to the boundaries.

Lastly, I suggest that you begin from 1D problems and work your way up to higher dimensions.

USV
usv001 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems adding volScalarField to rhoCentralFoam cryple OpenFOAM Programming & Development 2 January 17, 2013 06:18
[ICEM] Problems with coedge curves and surfaces tommymoose ANSYS Meshing & Geometry 0 August 5, 2011 16:02
[GAMBIT] Problems with the Cooper Scheme Forrest ANSYS Meshing & Geometry 0 July 13, 2009 10:59
Help for cut cell scheme for moving problems Wei Main CFD Forum 0 August 2, 2006 09:32
Implicit scheme for incompressible flow problems Triton Main CFD Forum 4 August 25, 2002 04:54


All times are GMT -4. The time now is 10:46.