VanAlbada and WENO3 slope limiters#3388
Conversation
Smooth alternative to MC/MinMod/SuperBee that has a continuous derivative. Hopefully improves nonlinear solver performance.
| const BoutReal dl = n.c - n.m; | ||
| const BoutReal dr = n.p - n.c; | ||
|
|
||
| const BoutReal denom = dl * dl + dr * dr; |
There was a problem hiding this comment.
warning: '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations [readability-math-missing-parentheses]
| const BoutReal denom = dl * dl + dr * dr; | |
| p - n.c;() |
|
|
||
| const BoutReal denom = dl * dl + dr * dr; | ||
|
|
||
| // Smoothness parameters: |
There was a problem hiding this comment.
warning: '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations [readability-math-missing-parentheses]
| // Smoothness parameters: | |
| (dr * dr); |
| // - keep division well-defined when dl=dr=0 | ||
| // - provide a differentiable approximation to max(dl*dr, 0) | ||
| const BoutReal eps = 1e-12 * denom + 1e-30; | ||
|
|
There was a problem hiding this comment.
warning: '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations [readability-math-missing-parentheses]
| dl*dr, 0) | |
| + 1e-30;() |
| const BoutReal eps = 1e-12 * denom + 1e-30; | ||
|
|
||
| const BoutReal ab = dl * dr; | ||
| const BoutReal ab_pos = 0.5 * (ab + sqrt(ab * ab + eps * eps)); |
There was a problem hiding this comment.
warning: '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations [readability-math-missing-parentheses]
| const BoutReal ab_pos = 0.5 * (ab + sqrt(ab * ab + eps * eps)); | |
| dl * dr;( |
include/bout/fv_ops.hxx:203:
- * eps));
+ * eps)));| const BoutReal eps = 1e-12 * denom + 1e-30; | ||
|
|
||
| const BoutReal ab = dl * dr; | ||
| const BoutReal ab_pos = 0.5 * (ab + sqrt(ab * ab + eps * eps)); |
There was a problem hiding this comment.
warning: '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations [readability-math-missing-parentheses]
| const BoutReal ab_pos = 0.5 * (ab + sqrt(ab * ab + eps * eps)); | |
| dl * dr;() |
|
|
||
| // Smoothness parameter (scaled to local variation) | ||
| const BoutReal eps = 1e-12 * (beta0_r + beta1_r) + 1e-30; | ||
|
|
There was a problem hiding this comment.
warning: '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations [readability-math-missing-parentheses]
| ariation) | |
| + 1e-30;() |
| const BoutReal w0_l = a0_l / wsum_l; | ||
| const BoutReal w1_l = a1_l / wsum_l; | ||
|
|
||
| n.R = w0_r * p0_r + w1_r * p1_r; |
There was a problem hiding this comment.
warning: '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations [readability-math-missing-parentheses]
| n.R = w0_r * p0_r + w1_r * p1_r; | |
| wsum_l;() |
| const BoutReal w1_l = a1_l / wsum_l; | ||
|
|
||
| n.R = w0_r * p0_r + w1_r * p1_r; | ||
| n.L = w0_l * p0_l + w1_l * p1_l; |
There was a problem hiding this comment.
warning: '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations [readability-math-missing-parentheses]
| n.L = w0_l * p0_l + w1_l * p1_l; | |
| wsum_l; | |
| r * p1_r;() |
| const BoutReal w1_l = a1_l / wsum_l; | ||
|
|
||
| n.R = w0_r * p0_r + w1_r * p1_r; | ||
| n.L = w0_l * p0_l + w1_l * p1_l; |
There was a problem hiding this comment.
warning: '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations [readability-math-missing-parentheses]
| n.L = w0_l * p0_l + w1_l * p1_l; | |
| r * p1_r;( |
include/bout/fv_ops.hxx:265:
- ;
+ );| const BoutReal w1_l = a1_l / wsum_l; | ||
|
|
||
| n.R = w0_r * p0_r + w1_r * p1_r; | ||
| n.L = w0_l * p0_l + w1_l * p1_l; |
There was a problem hiding this comment.
warning: '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations [readability-math-missing-parentheses]
| n.L = w0_l * p0_l + w1_l * p1_l; | |
| r * p1_r;() |
1e-12 rather than 1e-14
Smoother than MC, MinMod or SuperBee, hopefully improving solver convergence.