CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

Gmres

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By hjasak

Reply
 
LinkBack Thread Tools Display Modes
Old   January 11, 2010, 14:52
Default Gmres
  #1
OFU
New Member
 
Jennifer
Join Date: Aug 2009
Location: Germany
Posts: 28
Rep Power: 7
OFU is on a distinguished road
Hi,

for my work I need to implement the restarted generalized minimal residual method (GMRES(m)) in OpenFOAM. As I am new to OpenFOAM I have several problems with the types of the variables and the corresponding operations I need for the GMRES. So I hope somebody can give me some help or information on how to solve the problems.
Like shown in the attached picture the GMRES algorithm uses the Arnoldi process to construct an orthonormal basis Vm=[v1,,vm]. v1 is computed by v1=r0/beta with r0=b-Ax0 and beta=||r0||. r0 as well as beta are of the type volScalarField. Now I don't know of which type the vector v must be, so that I can store the components v1-vm in it. The same applies to the hessenberg matrix Hij and the vector wij. I don't know how to implement the matrix and the vector, so can anybody help me with this problem? I tried different ways of implementing these things but nothing works.

Perhaps is there already something like GMRES implemented in OpenFOAM, so that I can have look at how it is implemented there?

Thanks,
Jennifer
Attached Images
File Type: jpg Algorithmus GMRES.JPG (34.1 KB, 101 views)
OFU is offline   Reply With Quote

Old   January 12, 2010, 06:26
Default
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,758
Rep Power: 21
hjasak will become famous soon enough
Have a look at how I did it in the lduSolvers librari in 1.5-dev:

http://openfoam-extend.svn.sourcefor...79&view=markup

The two algorithms are close enough to each other to directly re-use most of the code.

Enjoy,

Hrv
mm.abdollahzadeh likes this.
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   January 4, 2013, 10:50
Default nDIrections?
  #3
New Member
 
Amir
Join Date: Jan 2013
Posts: 3
Rep Power: 4
a7ashraf is on a distinguished road
Hi all,

I am a new user to Openfoam and I am trying to run shallowWaterFoam simulations using the GMRES solver in the openfoam-1.6-ext package. When I changed the solver to GMRES it said that "nDirections is not defined" I added this parameter in the fvSolution file and gave it a value of 1, It started to run. I am not sure what this parameter means. Can anyone help?

Thank you in advance,
Amir
a7ashraf is offline   Reply With Quote

Old   January 4, 2013, 11:42
Default
  #4
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,758
Rep Power: 21
hjasak will become famous soon enough
This is a number of search directions GMRES uses - have a look at a book that expains the algorithm. nDirections 5; is a good choice.

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   January 4, 2013, 15:11
Default
  #5
New Member
 
Amir
Join Date: Jan 2013
Posts: 3
Rep Power: 4
a7ashraf is on a distinguished road
Thank you for your help.

Last edited by a7ashraf; January 7, 2013 at 20:48.
a7ashraf is offline   Reply With Quote

Old   January 7, 2013, 20:46
Default
  #6
New Member
 
Amir
Join Date: Jan 2013
Posts: 3
Rep Power: 4
a7ashraf is on a distinguished road
Hi all,
Does anyone have a guide on how to compile new linear solvers in openfoam 2.1.1? I am trying to compile the GMRES solver above but I cant get to work.

Thanks,
Amir
a7ashraf is offline   Reply With Quote

Old   January 8, 2013, 05:18
Default
  #7
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 12
Bernhard is on a distinguished road
Can you be much more specific in what is going wrong or where you are stuck? Do you get compilation errors?
Bernhard is offline   Reply With Quote

Old   March 10, 2013, 18:59
Default
  #8
Senior Member
 
chegdan's Avatar
 
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 538
Rep Power: 18
chegdan will become famous soon enough
Quote:
Originally Posted by a7ashraf View Post
Hi all,
Does anyone have a guide on how to compile new linear solvers in openfoam 2.1.1? I am trying to compile the GMRES solver above but I cant get to work.

Thanks,
Amir
Thats due to the fact that the lduSolvers library has classes which make it slightly incompatible with 2.1.x. You will have to go through the library the hjasak provided and change a few things to make the lduSolvers library work in 2.1.x and beyond.
__________________
Dan

Find me on twitter @dancombest and LinkedIn
chegdan is offline   Reply With Quote

Old   March 18, 2015, 10:12
Default
  #9
Senior Member
 
Join Date: Oct 2013
Posts: 237
Rep Power: 4
chriss85 is on a distinguished road
Is anyone still interested in this?
I have ported the GMRES solver from foam-extend to OpenFOAM 2.3.x.

I haven't tested it much, in my case the residuals behaved very weird, but the results were ok in the test case I used. Is this expected behavior?
chriss85 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Control volume renumbering for GMRES ztdep Main CFD Forum 1 October 26, 2009 08:37
GMRES Mehdi Main CFD Forum 3 December 31, 2006 12:03
Preconditioned Gmres carlos Main CFD Forum 2 April 14, 2003 05:24
GMRES zhaohuiyong Main CFD Forum 2 June 1, 1999 13:03
Nonlinear/Linear GMRES is... Saebyuk Main CFD Forum 0 May 10, 1999 08:31


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