CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Is iteration direction over a structured mesh important?

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 1 Post By FMDenaro
  • 1 Post By FMDenaro
  • 1 Post By sbaffini
  • 1 Post By LuckyTran

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 5, 2020, 07:13
Default Is iteration direction over a structured mesh important?
  #1
Senior Member
 
Sayan Bhattacharjee
Join Date: Mar 2020
Posts: 495
Rep Power: 8
aerosayan is on a distinguished road
I'm trying to code an explicit compressible Euler solver for a flow over a compression corner using a structured grid with the following wall configuration.


Left wall : Inlet
Right wall : Outlet
Top and bottom wall : Inviscid wall


AFAIK, the free-stream condition will be set as the initial condition throughout the domain.


The current plan is to start the iteration from the bottom wall and move layer by layer towards the top wall.


The figure below shows how the iterations are planned to be like.



FINISH

+----->-------->-------->-------+
+----->-------->-------->-------+
+----->-------->-------->-------+
+----->-------->-------->-------+
+----->-------->-------->-------+
+----->-------->-------->-------+
START


Here is my doubt though :


In commercial codes like Fluent/CFX, we get an option of "starting the solution from a certain boundary". And in college, we were taught that we should start the solution from the inlet boundary, otherwise it would take too much time or give wrong solution.



+ I don't understand how this "start solution from a certain boundary" is implemented in the code.



+ Does it mean that If the inlet is on the left and if the iterations are done as shown in the figure above, then we will get a wrong result or need large iterations till convergence?



+ Basically, is the iteration direction over a structured mesh important?


Thanks
aerosayan is offline   Reply With Quote

Old   April 5, 2020, 07:36
Default
  #2
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,849
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
I can answer using the example of Jacobi and Gauss-Seidel methods for linear algebric system.
Jacobi iteration updates each components at k+1 as function of the solely state k.
Gauss-Seidel iteration updates the components at k+1 depening on a part of available components at k+1 and the other part at k.


This way you can think that the GS accelerates if the sweep is done properly from the side of more relevant physical variation. Is it that really convenient? You can gain some interation but the method must converge independently from the chosen direction and the chose threshold must be reached by all the residuals.
aerosayan likes this.
FMDenaro is offline   Reply With Quote

Old   April 5, 2020, 08:03
Default
  #3
Senior Member
 
Sayan Bhattacharjee
Join Date: Mar 2020
Posts: 495
Rep Power: 8
aerosayan is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
You can gain some interation but the method must converge independently from the chosen direction and the chose threshold must be reached by all the residuals.

Thank you for the help.


I also thought that the direction of iteration would be important in case of GS acceleration.


Could you kindly ensure that I understood the quoted portion correctly?


I understood it as this : Using the optimal iteration direction and something like GS acceleration, we can gain some performance improvement and hence require less iterations. But if we select something like Jacobian iterations (which doesn't have an optimum iteration direction), the iterations will still converge to the correct solution, but it will take more iterations to do so.


Did I understand that correctly?


Thanks
aerosayan is offline   Reply With Quote

Old   April 5, 2020, 08:31
Default
  #4
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,849
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by aerosayan View Post
Thank you for the help.


I also thought that the direction of iteration would be important in case of GS acceleration.


Could you kindly ensure that I understood the quoted portion correctly?


I understood it as this : Using the optimal iteration direction and something like GS acceleration, we can gain some performance improvement and hence require less iterations. But if we select something like Jacobian iterations (which doesn't have an optimum iteration direction), the iterations will still converge to the correct solution, but it will take more iterations to do so.


Did I understand that correctly?


Thanks

yes, however Jacobi would be slower than GS also if you use a non-optimal sweep direction.

However, there are further issues to be considered, for example the adoption of the "for" cycle using the external index to face possible cache-miss. You can get an optimal number of iteration but the CPU time is relevant...
aerosayan likes this.
FMDenaro is offline   Reply With Quote

Old   April 5, 2020, 09:31
Default
  #5
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,190
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
No, Fluent, or any other major commercial CFD code, doesn't actually iterate from the inlet to the outlet, not in the common sense you understand this. They use AMG, that actually does something similar, but in a way that is completely different from classical iterations.

Still, of course, the order might be relevant in general, but is problem dependent, I guess.

A good source of information might be "Saad, Iterative Methods for Sparse Linear Systems"
aerosayan likes this.
sbaffini is offline   Reply With Quote

Old   April 5, 2020, 14:51
Default
  #6
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,747
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
Jacobi and Gauss-Seidel methods are solvers for linear systems in implicit solvers. The directionality of those methods are kinda different. There are sweeping directions and ways to sort the system to make it better for sweeping (e.g. the Reverse Cuthill-McKee algorithm). Still, Cuthill-Mckee is for making the Gaussian elimination faster and doesn't do anything for convergence.

If we're talking about fully explicit solvers then the task comes down to how to multiply a sparse square-ish matrix A by a column matrix x to get the updated solution x'. Your question is equivalent to which element in the matrix or which cell in the mesh should we calculate first?

How to multiply Ax is handled in the underlying library for doing sparse matrix calculations (e.g. a c library or whatever). The software doesn't know nor need to pick (although the linked library would). Then the question is, how does matrix multiplication algorithms works. And here you could turn to Coppersmith-Winograd algorithms and so on.

Convergence issues are dictated more-so by the problem physics (e.g. the characteristics of the matrix/linear system) than the algorithmic method you use to calculate/solve the system. Your choice of discretization schemes and so on in setting up the problem matter much more than where you start and which direction you sweep.
aerosayan likes this.
LuckyTran is offline   Reply With Quote

Reply

Tags
euler equation, iteration process, solver development


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
[mesh manipulation] Importing Multiple Meshes thomasnwalshiii OpenFOAM Meshing & Mesh Conversion 18 December 19, 2015 19:57
[snappyHexMesh] No layers in a small gap bobburnquist OpenFOAM Meshing & Mesh Conversion 6 August 26, 2015 10:38
[snappyHexMesh] snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Meshing & Mesh Conversion 2 March 27, 2011 22:11
[snappyHexMesh] external flow with snappyHexMesh chelvistero OpenFOAM Meshing & Mesh Conversion 11 January 15, 2010 20:43
Structured mesh refinement Andrea Panizza FLUENT 1 November 9, 2003 04:48


All times are GMT -4. The time now is 23:56.