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

How to setup second order schemes for all variables

Register Blogs Community New Posts Updated Threads Search

Like Tree6Likes
  • 1 Post By msuaeronautics
  • 5 Post By Tobi

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 28, 2014, 09:22
Thumbs up How to setup second order schemes for all variables
  #1
Member
 
Liam
Join Date: Aug 2013
Posts: 40
Rep Power: 13
Many is on a distinguished road
Hi Foamers,

I am here again because I am not understanding well how to setup fvSchemes for second order discretization for all variables.

I attach my case of a simpleFoam calculation with heat equation implemented. When I changes something the log files gives an error (something related to stack). I have only tried to put all schemes to linear and in laplacian terms I switched all to linear corrected. Are those second order schemes? What is the equivalence between put all second order schemes in FLUENT?

If somebody could give me any hint realted to the setup of my fvSchemes file it would be really aprecciated...

Thanks!
Attached Files
File Type: gz fvSchemes.tar.gz (639 Bytes, 105 views)
Many is offline   Reply With Quote

Old   January 28, 2014, 10:35
Default
  #2
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 15
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
hi,

see this link:

http://www.openfoam.org/docs/user/fv...hp#x20-1130159
adambarfi is offline   Reply With Quote

Old   January 28, 2014, 13:28
Default
  #3
Member
 
Eric Robertson
Join Date: Jul 2012
Posts: 95
Rep Power: 15
msuaeronautics is on a distinguished road
You have specified first order upwinding on your divergence schemes.

If you want to use 2nd order upwind, the syntax is:

div(phi,U) Gauss linearUpwind grad(U)

The "grad(U)" term tacked on tells the code that you want to use the same gradient scheme (which is necessary) that you used on grad(U).
tonnykz likes this.
msuaeronautics is offline   Reply With Quote

Old   January 28, 2014, 15:06
Thumbs up
  #4
Member
 
Liam
Join Date: Aug 2013
Posts: 40
Rep Power: 13
Many is on a distinguished road
Hi,

Thanks for all the replies. I have seen the page about numerical schemes in OF website, but it looks like there are several kinds of second order schemes and I am not sure which one could be the best for my problem.

If I use the setup suggested by msuaeronautics, I get an error message and the execution stops. I attach the log file.

Anybody have ideas?

Thanks in advance.
Attached Files
File Type: gz log.tar.gz (3.2 KB, 16 views)
Many is offline   Reply With Quote

Old   January 29, 2014, 00:41
Default
  #5
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 15
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
according to your log file:

Code:
--> FOAM Warning : 
    From function Foam::List<Foam::tetIndices> Foam::polyMeshTetDecomposition::faceTetIndices(const polyMesh&, label, label)
    in file meshes/polyMesh/polyMeshTetDecomposition/polyMeshTetDecomposition.C at line 570
    No base point for face 1754699, 4(53953 450466 860736 292725), produces a valid tet decomposition.
--> FOAM Warning : Suppressing any further warnings.
--> FOAM Warning : 
    From function findElements::findElements(const fvMesh&)
    in file probes/probes.C at line 105
    Did not find location (0.021718 0.0177167 0.0168408) in any cell. Skipping location.
I think there is some problem in your grids. did you check it 'checkMesh'? what is the number of cells with skewness?

If your mesh is generated with snappyHexMesh, try the following:

In snappyhexMeshDict file, look for "minTetQuality".

//- Minimum quality of the tet formed by the face-centre
// and variable base point minimum decomposition triangles and
// the cell centre. Set to very negative number (e.g. -1E30) to
// disable.
// <0 = inside out tet,
// 0 = flat tet
// 1 = regular tet

For a regular tet, it should be positive. Try setting it to 1. If it does not work, set it to a very low positive number. Say 1e-10.

One way to check whether the issue with face tet is resolved or not before the start of the simulation is to do an "checkMesh -allGeometry". It will report if there are any issues with face tets.
adambarfi is offline   Reply With Quote

Old   January 29, 2014, 14:47
Thumbs up
  #6
Member
 
Liam
Join Date: Aug 2013
Posts: 40
Rep Power: 13
Many is on a distinguished road
Hi adambarfi,

Thanks for the reply. The mesh is created with snappy, but I have to disable quality controls at this step, because I am trying to introduce layers near the wall.

I will try this settings with another mesh (one that pass all checkMesh tests), but I think I'ĺl need more possibilities for second order numerical schemes. I am not sure which ones I am speciying and I am not understanding many things of OF website. If I want to use second order schemes, what changes have I to do in the fvSchemes file of my first post?

I have converged my case for the settings of this dictionary, but now I need to be sure my simulation is converging at least with second order, and I guess it will not be so easy. Maybe some changes are need to be done in fvSolution?

Thanks!
Many is offline   Reply With Quote

Old   January 30, 2014, 06:58
Default
  #7
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 15
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
AFAIK the fvSolution just controls the equation solvers, tolerances and algorithms. the discretization is set in the fvScheme.
in the OpenFOAM userGuide the way you can specify different discretization schemes is mentioned. For example, for gradient you can use 'Gauss <interpolationScheme>' and 'leastSquares' which are second order or you can use 'fourth' which is fourth order!

in the same way you can change the Laplacian or Divergence schemes.
adambarfi is offline   Reply With Quote

Old   January 30, 2014, 07:25
Default
  #8
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
Hello Many,

to know which schemes are available you can use the banana trick:

Code:
 
div(U,phi)        banana;
After starting the solver you will find a message which schemes you can use.
Additionally you can have a look at my homepage. There I investigated numerical schemes in a very simple geometry.

http://www.holzmann-cfd.de/index.php/numerische-schemen

Still just in german.
But you can see that all schemes except of the gauss upwind can calculate un-phyisical results.
In most cases I use 2nd order limited schemes to avoid un-physical results. Additionally you see that the
results depend on the mesh and the flow direction passing through the cells.

Especially with scalar Transport equations in which the variable is defined in a interval.
Example:

- i made a very huge Research of the SLFM (laminar steady flamelet model). Therefor all physical varables phi can be described with Z and Z_var.

Those two variables are valid in the interval:

Code:
0 <= Z <= 1              // 0 = oxidator       1 = fuel
0 <= Z_var <= 0.25    // 0 = no turbulence          0.25 maxium turbulence
Therefor I use limited limited 2nd order schemes:

Code:
div(phi,Z)             Gauss limitedLimitedLinear 1 0 1;
div(phi,Z_var)       Gauss limitedLimitedLinear 1 0 0.25;
The first number is for the limiter:

-> 1 full limiter function
-> 0 non limiter function

Therefor the following Expression should be the same (I am not 100% sure):
Code:
 
Gauss limitedLinear 0;       // 2nd Order with limiter function but limiter weight = 0
Gauss linear;                   // 2nd Order
The second and third value are the lower and upper bounds for the variable.

Hope it is getting clear.

Regards Tobi
wenxu, Aaron_L, tonnykz and 2 others like this.
Tobi is offline   Reply With Quote

Old   January 30, 2014, 15:07
Thumbs up
  #9
Member
 
Liam
Join Date: Aug 2013
Posts: 40
Rep Power: 13
Many is on a distinguished road
Thanks Mostafa and Tobias for your help,

Mostafa, I'll try with leastSquares. Anyway I'll give a sight at OF Userś Guide again.

Tobias, I know your web page. I have been reading some of your post and they are great. Nice to meet you. I would like to understand what you are doing in your research about numerical schemes, but I don't speak German so it will be a mess!

My problem is an airflow inside a nose. I can get converged results with Gauss linear for gradients, Gauss upwind for divergence terms and Gauss linear uncorrected for laplacians. But to be sure that my results are OK I'd like to switch to second order (I guess this means to put linear instead of upwind in divergences, and Gauss linear corrected for laplacian). With those settings simulation just crashes after 2 iterations.I don't expect to converge it at the first try, but I cannot understand why it crashes...

I'll keep trying anyway!
Many is offline   Reply With Quote

Old   January 31, 2014, 12:55
Default
  #10
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
Hi,

thanks for your feedback and the words.
I will translate my page into english as soon as I can and additionally I will make more schemes analyses.

Regards
Tobi
Tobi is offline   Reply With Quote

Old   November 19, 2014, 03:56
Default
  #11
Senior Member
 
Freedom
Join Date: May 2014
Posts: 209
Rep Power: 13
wenxu is on a distinguished road
Dear Mostafa Mahmoudi,
please see this link http://www.cfd-online.com/Forums/ope...tml#post519862 and help me..
thank you in advance.
wen
wenxu is offline   Reply With Quote

Old   November 19, 2014, 04:14
Default
  #12
Senior Member
 
Freedom
Join Date: May 2014
Posts: 209
Rep Power: 13
wenxu is on a distinguished road
Dear Tobias,
when i use the upwind scheme for the div(phi,U), the simulation results is somehow reasonable. But when i changed it into linear,the maximum value of velocity will be two times as the inlet value and the flow field seems terrible. please see my link: http://www.cfd-online.com/Forums/ope...tml#post519862 and help me. thank you very much!
PS: i also do research on turbulent combustion model resently, i need your precious guideness.

best wishes,
wen
wenxu is offline   Reply With Quote

Old   November 19, 2014, 10:15
Default
  #13
Member
 
Join Date: May 2014
Posts: 40
Rep Power: 12
Phil_ is on a distinguished road
Quote:
Originally Posted by msuaeronautics View Post
If you want to use 2nd order upwind, the syntax is:

div(phi,U) Gauss linearUpwind grad(U)

The "grad(U)" term tacked on tells the code that you want to use the same gradient scheme (which is necessary) that you used on grad(U).
Is this specific for linearUpwind? And it is necessary to use the same gradient scheme used in grad(U)? Why is that?

Best regards

Philip
Phil_ is offline   Reply With Quote

Old   November 19, 2014, 10:42
Default
  #14
Senior Member
 
Freedom
Join Date: May 2014
Posts: 209
Rep Power: 13
wenxu is on a distinguished road
Quote:
Originally Posted by Phil_ View Post
Is this specific for linearUpwind? And it is necessary to use the same gradient scheme used in grad(U)? Why is that?

Best regards

Philip
  • Surely no, such as LUST also use the same form.
  • I think that't not necessary, i use the cellMDLimited Gauss linear 1; for the div(phi,U),and the grad(U) i use linear.(i think this may be the openfoam's dictionary function,that we can simpilfy the use of fvScheme , we can use the grad(U) to substitute for the cellMDLimited Gauss linear 1; long characters... )
best,
wen
wenxu is offline   Reply With Quote

Old   November 19, 2014, 12:52
Default
  #15
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 15
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
Quote:
Originally Posted by wenxu View Post
Dear Mostafa Mahmoudi,
please see this link http://www.cfd-online.com/Forums/ope...tml#post519862 and help me..
thank you in advance.
wen
sorry, I didn't get the question!!! but it seems Tobi answered you and you got it.
adambarfi is offline   Reply With Quote

Old   November 19, 2014, 20:45
Default
  #16
Senior Member
 
Freedom
Join Date: May 2014
Posts: 209
Rep Power: 13
wenxu is on a distinguished road
Yeah,Mostafa, Thank you all the same!
best,
wen
wenxu is offline   Reply With Quote

Reply


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
first and second order schemes Thomashoffmann Main CFD Forum 3 January 22, 2013 08:50
First order simulation better than second order Torque_Converter CFX 7 January 8, 2013 05:07
order of time integration schemes fisch OpenFOAM Running, Solving & CFD 0 January 26, 2012 04:03
Gradient Estimation for Higher Order Schemes jianxia Main CFD Forum 0 June 6, 2000 20:40
LES - numerics David Hunt Main CFD Forum 8 May 23, 2000 03:08


All times are GMT -4. The time now is 01:05.