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

Minmod Limiter

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 29, 2017, 21:43
Default Minmod Limiter
  #1
New Member
 
Join Date: Mar 2017
Posts: 7
Rep Power: 9
sammy2 is on a distinguished road
I'm trying to implement a simple minmod limiter on my primitive variables.
It (seemingly) works perfectly when advecting a square pulse (u=p=const) but is worse than piecewise constant at Sod's problem (see pics).
Here is how I'm calculating the edge states:
Code:
leftDiff = rho[i-1] - rho[i-2];
rightDiff = rho[i] - rho[i-1];
left.rho = rho[i-1] + 0.5 * minmod(leftDiff, rightDiff);
//...

leftDiff = rho[i] - rho[i-1];
rightDiff = rho[i+1] - rho[i];
right.rho = rho[i] + 0.5 * minmod(leftDiff, rightDiff);
//...
Does anyone have any idea where I'm going wrong? I've been stuck on this for weeks.
Attached Images
File Type: png tophat.png (19.4 KB, 62 views)
File Type: png density.png (32.1 KB, 62 views)
File Type: png pressure.png (31.0 KB, 47 views)
File Type: png velocity.png (28.9 KB, 49 views)
sammy2 is offline   Reply With Quote

Old   March 29, 2017, 23:07
Default
  #2
Senior Member
 
Michael Prinkey
Join Date: Mar 2009
Location: Pittsburgh PA
Posts: 363
Rep Power: 25
mprinkey will become famous soon enough
I guess it depends on what you are doing in your "minmod" function. I am used to seeing fluxes interpolated based on:

phi_f = phi_0 + 0.5*psi(r)*(phi_0 - phi_-1)

where r = (phi_1 - phi_0)/(phi_0 - phi_-1)

and for minmod, psi(r) = max(0,min(1,r))

(This all assumes evenly spaced grids. Also, I am used to using slope limiters on unstructured meshes, so my flux-limiter Fu is a little rusty.)

if your minmod performs those same calculations and returns a dimensional value for density, then it should be right. But r in the forms I am used to seeing is dimensionless, as is the return value of minmod(). So, I'd expect a trailing factor of units of density to make it physical in your right.rho and left.rho lines.
mprinkey is offline   Reply With Quote

Old   March 30, 2017, 08:42
Default
  #3
New Member
 
Join Date: Mar 2017
Posts: 7
Rep Power: 9
sammy2 is on a distinguished road
Quote:
Originally Posted by mprinkey View Post
I guess it depends on what you are doing in your "minmod" function. I am used to seeing fluxes interpolated based on:

phi_f = phi_0 + 0.5*psi(r)*(phi_0 - phi_-1)

where r = (phi_1 - phi_0)/(phi_0 - phi_-1)

and for minmod, psi(r) = max(0,min(1,r))

(This all assumes evenly spaced grids. Also, I am used to using slope limiters on unstructured meshes, so my flux-limiter Fu is a little rusty.)

if your minmod performs those same calculations and returns a dimensional value for density, then it should be right. But r in the forms I am used to seeing is dimensionless, as is the return value of minmod(). So, I'd expect a trailing factor of units of density to make it physical in your right.rho and left.rho lines.
I should have said that I am limiting slopes here not fluxes (also on an evenly spaced grid). Therefore my minmod function is simply

minmod(a,b) = \left\{
        \begin{array}{ll}
            a & \quad if |a| < |b|, ab > 0 \\
            b & \quad if |b| < |a|, ab > 0 \\
            0 & \quad otherwise
        \end{array}
    \right.
sammy2 is offline   Reply With Quote

Old   April 2, 2017, 14:46
Default
  #4
Senior Member
 
Join Date: Oct 2011
Posts: 242
Rep Power: 17
naffrancois is on a distinguished road
I think your problem does not come only from 2nd order reconstruction. Your 1st order solution does not look TVD to me, large oscillations near the shock do not occur when using shock capturing upwind fluxes. What spatial discretisation are you using ?
naffrancois is offline   Reply With Quote

Old   April 2, 2017, 15:12
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
I agree, Godunov must give a monotonic solution
FMDenaro is offline   Reply With Quote

Old   April 3, 2017, 10:04
Default
  #6
New Member
 
Join Date: Mar 2017
Posts: 7
Rep Power: 9
sammy2 is on a distinguished road
Quote:
Originally Posted by naffrancois View Post
I think your problem does not come only from 2nd order reconstruction. Your 1st order solution does not look TVD to me, large oscillations near the shock do not occur when using shock capturing upwind fluxes. What spatial discretisation are you using ?
I'm using finite volume. What kind of things can I do to find the problem?
sammy2 is offline   Reply With Quote

Old   April 3, 2017, 10:30
Default
  #7
Senior Member
 
Join Date: Oct 2011
Posts: 242
Rep Power: 17
naffrancois is on a distinguished road
What Riemann solver are you using ? If it is the exact or Roe flux, maybe you should start with the simplest one: the Rusanov flux. As it seems that the raréfaction and contact are Well captured it may be à bug with the définition of left and right pressure as they are discontinuous across the shock
naffrancois is offline   Reply With Quote

Old   April 3, 2017, 13:04
Default
  #8
New Member
 
Join Date: Mar 2017
Posts: 7
Rep Power: 9
sammy2 is on a distinguished road
Quote:
Originally Posted by naffrancois View Post
What Riemann solver are you using ? If it is the exact or Roe flux, maybe you should start with the simplest one: the Rusanov flux. As it seems that the raréfaction and contact are Well captured it may be à bug with the définition of left and right pressure as they are discontinuous across the shock
I am using the exact solver found here with their function sampleWaveSolution (with wave_speed = 0.0) which I don't really understand but I couldn't find any simple ones in C/++.
sammy2 is offline   Reply With Quote

Old   April 3, 2017, 16:08
Default
  #9
Senior Member
 
Join Date: Oct 2011
Posts: 242
Rep Power: 17
naffrancois is on a distinguished road
Hello,

I haven't looked much the code you are referring to. I can't recommend you taking pieces of code as a black box, the mistake could be in that code, the way you use it or both.

It is worth taking time to learn how the exact solution is built (Toro, Riemann Solvers and Numerical Methods for Fluid Dynamics is one of the references) and how approximate solvers have been derived. This way you will understand the code you mention and find what is wrong.

Cheers,
François
naffrancois is offline   Reply With Quote

Old   April 5, 2017, 12:08
Default
  #10
New Member
 
Join Date: Mar 2017
Posts: 7
Rep Power: 9
sammy2 is on a distinguished road
I have tried another solver which is producing the same results..
It's a bit of a long shot but does anyone recognise what is happening in the Godunov vs the minmod plot?
sammy2 is offline   Reply With Quote

Reply

Tags
euler, limiter, minmod, plm, sod


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
Minmod limiter for Correction Procedure via Reconstruction LUQILIN Main CFD Forum 0 May 20, 2016 03:36
Is MINMOD still an option for slope limiter? wruudf SU2 5 October 22, 2014 19:13
Limiter MINMOD' problems akun646 SU2 3 August 28, 2014 16:24
how to implement MINMOD limiter ? alan Main CFD Forum 0 November 25, 2008 11:57
Moment limiter in DG method. jinwon park Main CFD Forum 0 May 15, 2008 13:18


All times are GMT -4. The time now is 01:28.