[petsc-users] Computing time derivatives in the residual for TS

Mani Chandra mc0710 at gmail.com
Thu Jun 26 13:19:40 CDT 2014


Suppose the following is the residual function that TS needs:

void residualFunction(TS ts, PetscScalar t, Vec X, Vec dX_dt, Vec F, void

and this returns the following finite volume residual at each grid point

dU_dt + gradF + sourceTerms = 0

where dU_dt are the time derivatives of the conserved variables.

The value of dU_dt needs to be computed from the values of the time
derivatives of the primitive variables given in dX_dt, i.e. dU_dt is an
analytic function of dX_dt. But is it possible to compute dU_dt numerically
using the vector X and it's value at a previous time step like the

dU_dt = (U(X) - U(X_old) )/dt -- (1)

(instead of analytically computing dU_dt which is a function of the vectors
X and dX_dt which is hard to do if the function is very complicated)

So, is computing dU_dt using (1) permissible using TS? The jacobian will be
correctly assembled for implicit methods?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140626/084d4e7a/attachment.html>

More information about the petsc-users mailing list