|
[Sponsors] |
November 6, 2015, 07:11 |
|
#21 |
Member
Davi Barreira
Join Date: Apr 2014
Location: Fortaleza
Posts: 76
Rep Power: 12 |
There is Dr Jasak's thesis, which is a must for people using OpenFOAM (just google it and you will find right away). And also Versteeg and Malalasekera book on CFD.
|
|
October 25, 2018, 06:05 |
limited Linear NOT Sweby
|
#22 |
New Member
Jan Gaertner
Join Date: Nov 2017
Posts: 20
Rep Power: 9 |
Hey,
I have seen in many posts, that limitedLinear uses the Sweby limiter function. This is not correct. If you look at the code of the limitedLinear.H file you see: Code:
scalar limiter ( const scalar cdWeight, const scalar faceFlux, const typename LimiterFunc::phiType& phiP, const typename LimiterFunc::phiType& phiN, const typename LimiterFunc::gradPhiType& gradcP, const typename LimiterFunc::gradPhiType& gradcN, const vector& d ) const { scalar r = LimiterFunc::r ( faceFlux, phiP, phiN, gradcP, gradcN, d ); return max(min(twoByk_*r, 1), 0); } |
|
June 6, 2021, 17:18 |
|
#23 |
New Member
s.v
Join Date: Jun 2021
Posts: 13
Rep Power: 5 |
Response to post #11 in this thread:
I am guessing the reason why "linear" and "limitedLinear 0" do not give identical results is because "limitedLinear 0" becomes upwind outside the Convection Boundedness Criterion (CBC) region on the NVD diagram -- see for example the discussion and figures around page 35 in my PhD thesis (https://drum.lib.umd.edu/handle/1903/21883). Cheers .... Last edited by s.v; June 6, 2021 at 17:21. Reason: added which post I am responding to (post #11) |
|
October 20, 2021, 11:36 |
A question of r
|
#24 | |
Member
bany
Join Date: Nov 2019
Posts: 50
Rep Power: 8 |
Quote:
Thanks for this explanation for , where defined in Dr. Jasak's thesis. Now i have two questions : (1) If phiD-phiC=0, r equals? Just like the case:in a initial field, the value of phi (a scalar field) is uniform. (2) As we know, r is related to the successive grad of phi. And C, D and U are at the upwind, downwind and far-upwind cells. While for the cells whose faces are at boundary, how does the definition of U and how does (phiC-phiU) calculate? Any reply is grateful! |
||
October 20, 2021, 22:00 |
1D uniform structured mesh
|
#26 |
Member
bany
Join Date: Nov 2019
Posts: 50
Rep Power: 8 |
We only consider the simple condition: a 1-D structured FV mesh.
|
|
October 20, 2021, 22:09 |
|
#27 |
New Member
s.v
Join Date: Jun 2021
Posts: 13
Rep Power: 5 |
Tobi -- Jasak et al. discuss this point in their gamma scheme paper (https://citeseerx.ist.psu.edu/viewdo...=rep1&type=pdf) -- see for example the text below equation 10 in the paper -- they work with gradients ....
This link might also be useful -- https://www.openfoam.com/documentati...e-nvd-tvd.html |
|
October 20, 2021, 22:30 |
|
#28 | |
Member
bany
Join Date: Nov 2019
Posts: 50
Rep Power: 8 |
Quote:
In my work: a 1D structured FV mesh, and the scalarField phi is uniform at the beginning. Thus phiC=phiD for initial time in every mesh. When i output the matrix of convection term for the first timestep, i found the upper() and lower() of the matrix for convection term when using limitedLinear scheme is like that when using linear scheme. That means that when phiC=phiD, r=k/2. However, i failed to find the relative code in openfoam -- https://github.com/OpenFOAM/OpenFOAM...cheme/NVDTVD.H |
||
October 20, 2021, 22:43 |
|
#29 |
New Member
s.v
Join Date: Jun 2021
Posts: 13
Rep Power: 5 |
Quote:
But I think the answer to your first question is in this file most likely -- https://www.openfoam.com/documentati...8H_source.html It looks like if phiD-phiC=0 (I think in the file above they call phiD as phiN and phiC as phiP) the following lines in the above file will come into play: if (mag(gradcf) >= 1000*mag(gradf)) { return 2*1000*sign(gradcf)*sign(gradf) - 1; } which means r will either become 1999 or -2001 if phiD-phiC=0 or phiN-phiP=0 depending upon the signs of the gradients .... Regarding your second question -- see my response to Tobi above -- they work with gradients -- they don't explicitly use the far-upwind cell .... Again I have been away from OpenFOAM for a while -- but most likely what I have said above should be OK .... Also remember that the gamma and limitedLinear schemes are very similar -- the only difference is how they switch between upwind and linear schemes -- if we use the factor "k" equal to 1 then gamma scheme switches more smoothly compared to limitedLinear scheme (see for example figure 2.9 in my thesis -- download link given above in one of my other posts) -- if we use a smaller value of the factor "k" like 0.2 then both schemes become pretty much the same (see figure 2.10 in my thesis) .... also note that the gamma scheme is generally bugged in OpenFOAM (this is also briefly discussed in my thesis) -- so I plot the dbGamma scheme in figures 2.9 and 2.10 -- dbGamma basically means debugged gamma scheme -- thats the best name I could come up with for my thesis .... |
|
October 20, 2021, 22:53 |
|
#30 | |
New Member
s.v
Join Date: Jun 2021
Posts: 13
Rep Power: 5 |
Quote:
https://github.com/OpenFOAM/OpenFOAM...imitedLinear.H At the end of the above file we see: return max(min(twoByk_*r, 1), 0); so if r = 1999 like I mentioned in my other post -- the above line will return 1 -- and for a value of 1 -- limitedLinear will behave like linear I think .... the above line is returning \psi(r) in the TVD framework I think .... sorry I do not know how to use math in these posts yet .... |
||
October 20, 2021, 23:58 |
|
#31 | |
Member
bany
Join Date: Nov 2019
Posts: 50
Rep Power: 8 |
Quote:
Oh, what you said helped me a lot and your thesis is so clearly. Thank you very much. For the second question, the gradients are used. For the cell near the boundary just like the cell C in figure. The gradient of phi for the cell C is calculated by following: grad(phiC)=(phiC-phib)/(XC-Xb), where phib is the value of phi on the boundary. If something is wrong, please note that. |
||
October 21, 2021, 00:05 |
|
#32 | |
Member
bany
Join Date: Nov 2019
Posts: 50
Rep Power: 8 |
Quote:
For the math scheme, you can quote any posts included math scheme and you will see the original math code. Just like: "[ math]......[ /math]" (of course, there is no space in [].). And is "[math ]\psi[/math ]" in math scheme. |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
A few simple questions about linearUpwind and limitedLinear | chegdan | OpenFOAM | 28 | March 30, 2024 03:44 |
Using TVD Schemes in fvScheme | aydemirk | OpenFOAM Pre-Processing | 1 | August 20, 2014 05:26 |
TVD schemes | Vino | Main CFD Forum | 3 | September 16, 2013 20:47 |
TVD schemes: 2 questions | Shuo | Main CFD Forum | 0 | August 19, 2008 22:51 |
TVD Schemes | Matt Umbel | Main CFD Forum | 1 | January 25, 2000 05:21 |