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

A few simple questions about linearUpwind and limitedLinear

Register Blogs Community New Posts Updated Threads Search

Like Tree46Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 8, 2018, 08:22
Default
  #21
Senior Member
 
Dr. Alexander Vakhrushev
Join Date: Mar 2009
Posts: 256
Blog Entries: 1
Rep Power: 19
makaveli_lcf is on a distinguished road
Send a message via ICQ to makaveli_lcf
So I am currently busy but if no ready unswer will come, I have to look into the code

Quote:
Originally Posted by alimea View Post
Hi Alexander

I haven't tested this, but theoretically yes. you are right. According to this sentence of cfd.direct:
limitedLinear: linear scheme that limits towards upwind in regions of rapidly changing gradient; requires a coefficient, where 1 is strongest limiting, tending towards linear as the coefficient tends to 0.


https://cfd.direct/openfoam/user-guide/fvschemes/
Tobi likes this.
__________________
Best regards,

Dr. Alexander VAKHRUSHEV

Christian Doppler Laboratory for "Metallurgical Applications of Magnetohydrodynamics"

Simulation and Modelling of Metallurgical Processes
Department of Metallurgy
University of Leoben

http://smmp.unileoben.ac.at
makaveli_lcf is offline   Reply With Quote

Old   June 15, 2021, 20:13
Default
  #22
s.v
New Member
 
s.v
Join Date: Jun 2021
Posts: 13
Rep Power: 5
s.v is on a distinguished road
Sorry I have not read everything in this thread carefully but my PhD thesis (which can be downloaded from this link -- https://drum.lib.umd.edu/handle/1903/21883) discusses both these schemes reasonably well I think -- see information around page 27 in my thesis for linearUpwind and information around pages 34-35 for limitedLinear ....

Some other schemes are also reasonably well discussed in there (for example LUST, Gamma) ....

Most of the schemes are discussed through the NVD diagram which provides some useful insights ....

Convergence speed for different schemes is also discussed a little bit in there ....

Cheers ....
gigili206, saladbowl and DevilX like this.
s.v is offline   Reply With Quote

Old   June 17, 2021, 03:57
Default
  #23
Member
 
Daniel
Join Date: Jan 2021
Posts: 39
Rep Power: 5
DevilX is on a distinguished road
Just a small question: in your thesis you use fx in eq. 2.23 - is it the gradient in x direction or what is ist? Thanks!
DevilX is offline   Reply With Quote

Old   June 17, 2021, 08:33
Default
  #24
s.v
New Member
 
s.v
Join Date: Jun 2021
Posts: 13
Rep Power: 5
s.v is on a distinguished road
Hello Daniel -- fx is described in the LUST scheme section (page 28, text below equation 2.15) -- I have pasted some of that text below:

"f x represents the mesh non-uniformity in the direction of the vector r. For
uniform grids (for which f x = 1/2)"
s.v is offline   Reply With Quote

Old   June 21, 2021, 09:27
Default
  #25
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Quote:
Originally Posted by makaveli_lcf View Post
So I am currently busy but if no ready unswer will come, I have to look into the code
Dear Dr. Vakhrushev,

did you investigate into that topic and did you get a reasonable answer? I was expecting more or less the same result as you wrote. Using a limiter of 0 should be identical to linear.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   June 21, 2021, 09:47
Default
  #26
s.v
New Member
 
s.v
Join Date: Jun 2021
Posts: 13
Rep Power: 5
s.v is on a distinguished road
Hi Tobias:

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 thesis (https://drum.lib.umd.edu/handle/1903/21883) ....

This thread (TVD schemes, questions about limitedLinear) also discusses the same issue and I wrote a similar answer there as well (see post #23) ....

I hope this helps ....
anaspauzi likes this.
s.v is offline   Reply With Quote

Old   June 21, 2021, 11:17
Default
  #27
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
I am not too much into the single discretization schemes and its pro/cons. I would need to investigate into the OpenFOAM code to understand the real difference. However, if you say some parts go to upwind rather than linear, it should be obvious.

You thesis already had more downloads than mine will get until 2200
Well. Regarding to your thesis, k represents the limiter, right? So k = 0 is a "bounded linear (central differencing)" scheme. However, I need some time to go through the stuff (whenever I will find the motivation :P )
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   June 21, 2021, 11:39
Default
  #28
s.v
New Member
 
s.v
Join Date: Jun 2021
Posts: 13
Rep Power: 5
s.v is on a distinguished road
When I did my thesis -- I looked at the code and wrote the equations for the different schemes ....

To confirm that I am reading the code correctly I remember I wrote a small OpenFOAM utility that gave me the face values directly ....

Then I compared the face values given by the equations and the OpenFOAM utility with a simple python or Matlab script -- they were within machine precision as far as I remember -- so I am quite confident about the equations given in my thesis ....

And yes k is the limiter/coefficient and can go from 0 to 1 ....
Tobi likes this.

Last edited by s.v; June 21, 2021 at 19:36.
s.v is offline   Reply With Quote

Old   March 30, 2024, 03:44
Default
  #29
Member
 
bany
Join Date: Nov 2019
Posts: 50
Rep Power: 7
bany is on a distinguished road
Quote:
Originally Posted by Anne Lincke View Post
Dear Dan, Dear Foamers,

I found your post which is very interesting for me.
Could you please tell me how one can derive the equation above?
I found this equation implemented in OpenFOAM, and in Fluent it is obviously the same.
But I have problems in understanding this equation.
For LUDS (linear upwind) we discretize the face value as

\phi_f = \phi(C) + 0.5 (\phi(C) - \phi(U))

How is the implemented formula connected to that?

Thank you very much for an answer in advance!

Anne

In OpenFOAM, limitedLinear: T_f =psiT_{UD} +(1-psi)T_{CD}
linearUpwind: T_{f} =T_{P}+\phi grad(T)_{p}r

When I output the matrix created by fvm::div(phi, T) through fvScalarMatrix divphi_tmp(fvm::div(phi, T));, I found that the values of divphi_tmp.diag(), divphi_tmp.lower(). divphi_tmp.upper() are identifical no matter which schemes (i.e., upwind and linearUpwind) are used in fvSchemes, expect for divphi_tmp.source().

Where, \phi is a limiter, grad(T)_{p} is the gradient of T at the cell centroid P. How to calculate the grad(T) at the centroid? OpenFOAM will search the gradScheme in fvSchemes. For the Gauss linear scheme, grad(T) is computed by the sum of the product of T_{f} (i.e., T at faces around the cell P), direction vector and area respectively in the x, y, z directions, as explained in https://www.youtube.com/watch?v=oeA1Bg9GqQQ. So the contribution of fvm::div(phi, T), when using linearUpwind, enters TEqn.source() from the grad(T)_{p}.

So, the grad(T) is computed by T_{f}, and the grad(T) in the linearUpwind scheme contributes the divphi_tmp.source(). If grad(T) is computed by (T_{P}-T_{N})/d like \phi_f = \phi(C) + 0.5 (\phi(C) - \phi(U)), the contribution of fvm::div(phi, T) will affect divphi_tmp.lower() and divphi_tmp.upper(), and not affact divphi_tmp.source().
bany is offline   Reply With Quote

Reply

Tags
limitedlinear, linearupwind


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
linearUpwind scheme in OpenFOAM 2.0.1 ??? cabul OpenFOAM 8 November 9, 2011 07:57


All times are GMT -4. The time now is 22:35.