|
[Sponsors] |
div(phi,U) linearUpwind default; or div(phi,U) linearUpwind grad(U); |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 29, 2018, 14:23 |
div(phi,U) linearUpwind default; or div(phi,U) linearUpwind grad(U);
|
#1 |
Senior Member
cyln
Join Date: Jul 2016
Posts: 102
Rep Power: 9 |
Hello OF users,
I am doing a URANS simulation and trying to understand the difference between div(phi,U) linearUpwind default; and div(phi,U) linearUpwind grad(U);. linearUpwind is a bounded (with limiters) second order upwind scheme. When I study the OF documentation, I see that linearUpwind is usually used with grad(U) term at the end for the convection term. However, the turbulence terms such as k and omega, which have the same format as the convection term, are used with the default option. So, I did a laminar benchmark study of flat-plate boundary layer against the Blasius solution. For the convection term, I used the followings, respectively. 1: div(phi,U) Gauss linearUpwind default; 2: div(phi,U) Gauss linearUpwind grad(U); Both generated almost the same results. I also calculated the shape factor for the two and they are as follows: H_1=2.69, H_2=2.69. my fvSchemes file looks like this: Code:
gradSchemes { default Gauss linear; } divSchemes { default none; div(phi,U) Gauss linearUpwind default; //div(phi,U) Gauss linearUpwind grad(U); div((nuEff*dev2(T(grad(U))))) Gauss linear; } My main question, can I use linearUpwind with default option for the convection term? More specifically, what is the difference between using the default and grad(U)? My gradient terms are already discretized using second order centered differencing. Last edited by cyln; July 29, 2018 at 15:50. |
|
July 31, 2018, 07:16 |
|
#2 | |
Senior Member
|
Hi,
Quote:
Code:
gradSchemes { default Gauss linear; grad(U) leastSquares; } divSchemes { default none; //div(phi,U) Gauss linearUpwind default; div(phi,U) Gauss linearUpwind grad(U); div((nuEff*dev2(T(grad(U))))) Gauss linear; } Tom Last edited by tomf; July 31, 2018 at 07:17. Reason: Alignment |
||
July 31, 2018, 07:21 |
|
#3 |
Senior Member
cyln
Join Date: Jul 2016
Posts: 102
Rep Power: 9 |
Hi Tom,
Thanks for your reply. But what is the default (none)? Cyln |
|
July 31, 2018, 07:50 |
|
#4 |
Senior Member
|
Hi Cyln,
The default none just means that there is no default divScheme. That means that you would have to provide one for every term that you are solving for. If you comment both Code:
div(phi,U) Code:
div(phi,U) Code:
default none Code:
default Gauss linearUpwind default Code:
Gauss linearUpwind default Regards, Tom Last edited by tomf; July 31, 2018 at 07:51. Reason: formatting |
|
July 31, 2018, 10:18 |
|
#5 |
Senior Member
cyln
Join Date: Jul 2016
Posts: 102
Rep Power: 9 |
Thanks for the clear explanation. It makes a lot more sense now. What I am trying to really understand is the meaning of "default" added at the end of div(phi,U) discretization scheme.
for example: Code:
div(phi,U) Gauss linearUpwind default; Please correct me if I am wrong, but to my understanding from my readings, when we replace default with grad(U), then linearUpwind becomes bounded scheme through the limiters defined in gradSchemes. In the case below, grad(U) term is used rather than default. Moreover, there is no limiter defined in gradSchemes as they are second-order centered. Yet, I am not getting exactly the same results for div(phi,U) Gauss linearUpwind default; and div(phi,U) Gauss linearUpwind grad(U); Code:
gradSchemes { default Gauss linear; } divSchemes { default none; //div(phi,U) Gauss linearUpwind default; div(phi,U) Gauss linearUpwind grad(U); div((nuEff*dev2(T(grad(U))))) Gauss linear; } |
|
July 31, 2018, 10:34 |
|
#6 |
Senior Member
|
I guess you would have to specify what you mean with not exactly the same results, can you quantify?
The default in div(phi,U) linearUpwind default; points to the default gradScheme. So you should not see any difference. Otherwise the implementation is different from what I said and I would like to know how this differs as well. Some information can be found on the online cpp-guide. |
|
July 31, 2018, 13:28 |
|
#7 |
Senior Member
cyln
Join Date: Jul 2016
Posts: 102
Rep Power: 9 |
Regarding the flat-plate boundary layer benchmark, even though I obtain the same shape factor for both div(phi,U) linearUpwind default; and div(phi,U) linearUpwind default;, the shape factors are not exactly equal:
i.e. H_1=2.652, H_2=2.654. Moreover, the velocity values should be extactly the same if default in div(phi,U) linearUpwind default; refers to the default gradScheme which is Gauss linear. However, I am not getting exactly the same results. More specifically, we expect that the following two fvSchemes should give us exactly the same results, but they dont. Code:
gradSchemes { default Gauss linear; } divSchemes { default none; div(phi,U) Gauss linearUpwind default; div((nuEff*dev2(T(grad(U))))) Gauss linear; } Code:
gradSchemes { default Gauss linear; } divSchemes { default none; div(phi,U) Gauss linearUpwind grad(U); div((nuEff*dev2(T(grad(U))))) Gauss linear; } When I try these two in another bluff-body simulation, I get higher numerical diffusion for div(phi,U) Gauss linearUpwind grad(U);, suggesting second-order upwind scheme is bounded in this case. |
|
August 1, 2018, 04:56 |
|
#8 |
Senior Member
|
If you are absolutely sure that this scheme is the only difference between the two cases (setup, software, hardware), than I think there may be something wrong indeed. You could consider filing a bug report. If there is a reply on the bug report, one may know if the implementation is wrong, or if this behavior is as expected and the way I believe it works is wrong.
Of course, if someone sees this thread on the forum and has another explanation, I would be more than interested to know. |
|
August 1, 2018, 08:46 |
|
#9 |
Senior Member
Peter Baskovich
Join Date: Jul 2014
Posts: 127
Rep Power: 11 |
I just tried the simpleCar tutorial case from 1712 except I changed fvSchemes to:
Code:
/*--------------------------------*- C++ -*----------------------------------*\ ddtSchemes { //default steadyState; ddt(epsilon) steadyState; ddt(k) steadyState; } gradSchemes { //default none; grad(U) Gauss linear; grad(p) Gauss linear; grad(epsilon) Gauss linear; grad(k) Gauss linear; } divSchemes { //default none; div(phi,U) Gauss linearUpwind grad(U); //div(phi,U) Gauss linearUpwind grad(p); //can also use this div(phi,k) bounded Gauss upwind; div(phi,epsilon) bounded Gauss upwind; div((nuEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes { //default Gauss linear corrected; laplacian(nuEff,U) Gauss linear corrected; laplacian((1|A(U)),p) Gauss linear corrected; laplacian(DepsilonEff,epsilon) Gauss linear corrected; laplacian(DkEff,k) Gauss linear corrected; } interpolationSchemes { //default linear; flux(U) linear; flux(HbyA) linear; } snGradSchemes { //default corrected; } // ************************************************************************* // Changing div(phi,U) to: Code:
div(phi,U) Gauss linearUpwind default; Code:
--> FOAM FATAL IO ERROR: keyword default is undefined in dictionary "/home/xxxxx/OpenFOAM/xxxxx-v1712/run/simpleCar/system/fvSchemes.gradSchemes" Code:
default Gauss linear; Unless I've missed something, there is something else you are doing to cause this issue. When do you stop the jobs? |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem in fvschemes divSchemes cannot use Gauss linearUpwind | nico765 | OpenFOAM Bugs | 30 | August 9, 2018 07:39 |
Stabilization of the LinearUpwind for a VAWT | Giova | OpenFOAM Running, Solving & CFD | 0 | December 13, 2016 08:11 |
No convergence issue | kurdt89 | OpenFOAM Running, Solving & CFD | 7 | October 12, 2015 02:36 |
CFX-Pre problem, pls help!!! | cth_yao | CFX | 0 | February 17, 2012 00:52 |
rhoCentralFoam linearUpwind | Andy_bm | OpenFOAM Running, Solving & CFD | 8 | November 14, 2011 11:34 |