[petsc-users] TS for incompressible NS equations

Gianluca Meneghello gianmail at gmail.com
Wed Sep 28 08:02:23 CDT 2011


Hi,

I would have a question concerning the TS solver in PETSc.

I need to solve the linearized, incompressible Navier Stokes equation
in time. I have reformulated the problem as

B du/dt = J u

where J is the Jacobian of the Navier Stokes equations and u is a
vector containing {u,v,,w,p}.
B is a diagonal matrix which is 0 in the lines corresponding to the
pressure equation (enforcing the divergence free condition) and
Dirichlet BC's and 1 otherwise.

Backward Euler would then solve it as

 u(t+1) = (B-dt J)^-1 B u(t)

as in page 115 of the user guide (is there a typing error there?
Should it be " (B - dt A) u(n+1) = B u(n) " ?)

Using PETSc 3.2, I pass J to the TS object as

TSSetRHSFunction(ts,PETSC_NULL,TSComputeRHSFunctionLinear,PETSC_NULL);CHKERRQ(ierr);
TSSetRHSJacobian(ts,A,A,TSComputeRHSJacobianConstant,PETSC_NULL);CHKERRQ(ierr);

but I don't understand how I can set B (or whether I am using a wrong approach).

Thanks in advance for your help

Gianluca

-- 
"[Je pense que] l'homme est un monde qui vaut des fois les mondes et
que les plus ardentes ambitions sont celles qui ont eu l'orgueil de
l'Anonymat" -- Non omnibus, sed mihi et tibi
Amedeo Modigliani


More information about the petsc-users mailing list