CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Gmres (http://www.cfd-online.com/Forums/openfoam-programming-development/71672-gmres.html)

OFU January 11, 2010 14:52

Gmres
 
1 Attachment(s)
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

hjasak January 12, 2010 06:26

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

a7ashraf January 4, 2013 10:50

nDIrections?
 
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

hjasak January 4, 2013 11:42

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

a7ashraf January 4, 2013 15:11

Thank you for your help.

a7ashraf January 7, 2013 20:46

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

Bernhard January 8, 2013 05:18

Can you be much more specific in what is going wrong or where you are stuck? Do you get compilation errors?

chegdan March 10, 2013 18:59

Quote:

Originally Posted by a7ashraf (Post 400626)
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.

chriss85 March 18, 2015 10:12

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?

mgg October 18, 2015 10:26

Quote:

Originally Posted by chriss85 (Post 536956)
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?

Hallo Chriss,

it that ported GMRES solver still available? And is that solver compatible to OF 2.4? I have great interest to test it on my application. If my target is scalability and HPC performace, can I expect that on GMRES solver instead of PCG?

chriss85 October 19, 2015 04:57

2 Attachment(s)
Here it is. You can include it either directly in a solver or recompile the appropriate OpenFOAM library. I haven't tested it very much, since I didn't get better convergence in my application compared to the included linear solvers.

It should go in src/OpenFOAM/matrices/lduMatrix/solvers/GMRES/

mgg November 3, 2015 09:08

Hallo Chriss,

thank you very much. I will try to test it in my case. The reason I wanna use GMRES is that I am running a DNS heat transfer case using buoyantpimplefoam. For better scalability I use PCG for pressure equation. If I use perfect gas equation of state, the number of iterations using PCG solver will be around 100, which is acceptable. If I use polynom to describe the density as a function of temperature, the number of iterations will be around 4000! If I use GAMG for p equation, number of iteration will be under 5, but the scalability is poor with more than 500 cores. Do you have an opinion of that? Thank you very much.

Quote:

Originally Posted by chriss85 (Post 568995)
Here it is. You can include it either directly in a solver or recompile the appropriate OpenFOAM library. I haven't tested it very much, since I didn't get better convergence in my application compared to the included linear solvers.

It should go in src/OpenFOAM/matrices/lduMatrix/solvers/GMRES/



All times are GMT -4. The time now is 17:13.