[petsc-users] TS for incompressible NS equations

Jed Brown jedbrown at mcs.anl.gov
Wed Sep 28 14:14:40 CDT 2011


On Wed, Sep 28, 2011 at 10:37, Gianluca Meneghello <gianmail at gmail.com>wrote:

> I do have a constant Jacobian that never changes. What I understand is
> the matrix I should pass to TSSetIJacobian looks like
>
> J + a B
>
> together with TSComputeIJacobianConstant. Something like
>
>
> TSSetIFunction(ts,PETSC_NULL,TSComputeIFunctionLinear,PETSC_NULL);
> TSSetIJacobian(ts,A,A,TSComputeIJacobianConstant,PETSC_NULL);
>

I may have made a mistake by introducing TSComputeIJacobianConstant() at all
since it only works for constant time steps.


>
> where A = J + a B
>
> but then I don't understand how I can fix a before deciding the time
> integration method or even the time step, so I guess I'm wrong.
>

You can cache J and/or B in your application context and add them together
with the variable shift. PETSc does not store the matrices J and B because
they are not part of the solution process, just an artifact of how some
people choose to write the system. Their existence is entirely unnecessary,
and I would encourage you to benchmark before concluding that it's worth
storing them separately. It may be more cost-effective to just recompute A
on the fly whenever it is requested. You can choose to do this only when 'a'
changes, which might be infrequent or never depending on how the time
integration method and adaptive controller.

And do you really mean to solve transient linearized Navier-Stokes (constant
"wind")? I don't see any way this makes sense physically. For nonlinear
Navier-Stokes, the matrix J (which contains everything that is potentially
expensive to build) is changing on each time step.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110928/15211e48/attachment.htm>


More information about the petsc-users mailing list