CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Polynomial in cellLimited<cubic> seems dodgy

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

Like Tree2Likes
  • 2 Post By scleakey

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 2, 2021, 05:40
Lightbulb Polynomial in cellLimited<cubic> seems dodgy
  #1
New Member
 
Shannon Leakey
Join Date: Mar 2019
Posts: 6
Rep Power: 4
scleakey is on a distinguished road
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 04:26. Reason: change "y" to "r" in last paragraph
scleakey is offline   Reply With Quote

Old   June 3, 2021, 10:40
Default
  #2
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 367
Rep Power: 9
Tobermory will become famous soon enough
Perhaps worth dropping a bug report?
Tobermory is offline   Reply With Quote

Old   June 9, 2021, 04:53
Default
  #3
New Member
 
Shannon Leakey
Join Date: Mar 2019
Posts: 6
Rep Power: 4
scleakey is on a distinguished road
I submitted a bug report https://develop.openfoam.com/Develop.../-/issues/2113 and it is getting fixed
saladbowl and Tobermory like this.
scleakey is offline   Reply With Quote

Old   June 9, 2021, 04:57
Default
  #4
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 367
Rep Power: 9
Tobermory will become famous soon enough
Well done - the system works! Thanks for putting the effort in to get this fixed for us all.
Tobermory is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fluent UDF - polynomial profile description mihnea333 FLUENT 0 February 26, 2021 03:19
Error: GENERAL CAR CDR - User-Defined-Material-Database EvaKn FLUENT 0 December 21, 2020 08:01
Add piecewise polinomial material property EvaKn FLUENT 0 December 21, 2020 06:03
thermophysicalProperties with polynomial values Gerrit OpenFOAM Running, Solving & CFD 4 April 21, 2020 10:51
polynomial BC from 3d vector data map OpenFOAM Programming & Development 0 March 30, 2015 08:48


All times are GMT -4. The time now is 08:12.