|
[Sponsors] |
June 2, 2021, 06:40 |
Polynomial in cellLimited<cubic> seems dodgy
|
#1 |
New Member
Shannon Leakey
Join Date: Mar 2019
Posts: 10
Rep Power: 7 |
Hello
After having some convergence problems in a Godunov-type scheme I programmed in OpenFOAM, I have been investigating the source code for the gradScheme cellLimited<cubic> in src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellLimitedGrad/gradientLimiters/cubicGradientLimiter.H The paper it is based on (Michalak and Ollivier-Gooch, 2008) says that the limiter function should be a cubic polynomial P(r) with P(r = 0) = 0, P(r = t) = 1, P'(r = 0) = 1, P'(r = t) = 0. By my calculations, this should be: P(r) = ar^3 + br^2 + r a = (t - 2)/(t^3) b = - (3at^2 + 1)/(2t) https://www.wolframalpha.com/input/?...+and+t+%3D+1.5 But the source code says: P(r) = ar^3 + br^2 + r a = 2/t^2 - 2/t^3 b = - (3/2)at https://www.wolframalpha.com/input/?...+and+t+%3D+1.5 The Wolfram|Alpha graphs (shown for t = 1.5) suggest that P'(r = t) is definitely not zero for the polynomial that is in the OpenFOAM code. Coincidentally, I initially ended up with the same coefficients as in the OpenFOAM code when I accidentally said the derivative of r with respect to r was 0 and not 1 when incorporating the constraint P'(r = t), then I plotted the graphs and realised something was wrong. Is this a mistake in the code or do I just not understand it properly? Thanks, Shannon Last edited by scleakey; June 4, 2021 at 05:26. Reason: change "y" to "r" in last paragraph |
|
June 3, 2021, 11:40 |
|
#2 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 736
Rep Power: 14 |
Perhaps worth dropping a bug report?
|
|
June 9, 2021, 05:53 |
|
#3 |
New Member
Shannon Leakey
Join Date: Mar 2019
Posts: 10
Rep Power: 7 |
I submitted a bug report https://develop.openfoam.com/Develop.../-/issues/2113 and it is getting fixed
|
|
June 9, 2021, 05:57 |
|
#4 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 736
Rep Power: 14 |
Well done - the system works! Thanks for putting the effort in to get this fixed for us all.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Fluent UDF - polynomial profile description | mihnea333 | FLUENT | 0 | February 26, 2021 04:19 |
Error: GENERAL CAR CDR - User-Defined-Material-Database | EvaKn | FLUENT | 0 | December 21, 2020 09:01 |
Add piecewise polinomial material property | EvaKn | FLUENT | 0 | December 21, 2020 07:03 |
thermophysicalProperties with polynomial values | Gerrit | OpenFOAM Running, Solving & CFD | 4 | April 21, 2020 11:51 |
polynomial BC from 3d vector data | map | OpenFOAM Programming & Development | 0 | March 30, 2015 09:48 |