Navier Stokes : solvers in Chorin's projection method.

61 views
Skip to first unread message

Pankaj Kumar

unread,
Aug 15, 2015, 12:40:22 PM8/15/15
to deal.II User Group
Hallo,

I am confused about selecting solvers in chorin's projection method. As the matrix obtained in first step(velocity) is not positive definite so i am thinking about using gmres but i have no idea for implementing preconditioner in this case.

chorin's method is in attachment.
This is how i am implementing in code:-

void Navierstokes<dim>::solve ()
{
    std::cout<< "    Solving...."<<std::endl;

    std::cout<<"     Assembling Velocity matrix...."<<std::endl;

    assemble_velocity ();

        int    vel_max_its     = 1000;
        double vel_eps         = 1e-8;
        int    vel_Krylov_size = 30;


    {

        SolverControl solver_control (vel_max_its, vel_eps*velocity_rhs.l2_norm());
        SolverGMRES<Vector<double>> gmres (solver_control,
                           SolverGMRES<>::AdditionalData (vel_Krylov_size));
        gmres.solve (velocity_matrix, velocity_solution, velocity_rhs, preconditioner_velocity);
    }

    std::cout<<"     Assembling pressure matrix and rhs...."<<std::endl;
    assemble_pressure ();
    assemble_pressure_rhs ();
    {
        SolverControl solver_control (pressure_matrix.m(),
                                      1e-6*pressure_rhs.l2_norm());

        SolverControl           solver_control (1000, 1e-12);
        SolverCG<>              solver (solver_control);
        solver.solve (pressure_matrix, pressure_solution, pressure_rhs,
                    PreconditionIdentity());

        std::cout << "   " << solver_control.last_step()
                << " CG iterations needed to obtain convergence."
                << std::endl;

    }

    std::cout<<"     Assembling update velocity matrix...."<<std::endl;

    assemble_update ();
    assemble_update_rhs ();
    {

        SolverControl solver_control (vel_max_its, vel_eps*velocity_rhs.l2_norm());
        SolverGMRES<Vector<double>> solver (solver_control);

        solver.solve (update_matrix, update_velocity_solution, update_velocity_rhs,  PreconditionIdentity());

    }

}

Thanks,
Pankaj
chorins_projection_method.png

Sungho Yoon

unread,
Aug 15, 2015, 2:19:54 PM8/15/15
to deal.II User Group
One "simple" way is you make it try and error in testing the possible choices for preconditioner until finding satisfactory convergent rate. However it also depends on the boundary conditions.   GMRES+ILU is one possible set.

2015년 8월 15일 토요일 오전 9시 40분 22초 UTC-7, Pankaj Kumar 님의 말:

k3daevin

unread,
Aug 17, 2015, 11:40:06 AM8/17/15
to deal.II User Group
Dear Pankaj,

You can use any Preconditioner that deal.II offers, I'd suggest Jacobi (fast but not so good) or ILU (slower but better, especially with fill-in).
Reply all
Reply to author
Forward
0 new messages