[petsc-users] Using TS

Matthew Knepley knepley at gmail.com
Sat Mar 12 12:04:19 CST 2016


On Sat, Mar 12, 2016 at 5:41 AM, Max la Cour Christensen <mlcch at dtu.dk>
wrote:

>
> Hi guys,
>
> We are making preparations to implement adjoint based optimisation in our
> in-house oil and gas reservoir simulator. Currently our code uses PETSc's
> DMPlex, Vec, Mat, KSP and PC. We are still not using SNES and TS, but
> instead we have our own backward Euler and Newton-Raphson implementation.
> Due to the upcoming implementation of adjoints, we are considering changing
> the code and begin using TS and SNES.
>
> After examining the PETSc manual and examples, we are still not completely
> clear on how to apply TS to our system of PDEs. In a simplified
> formulation, it can be written as:
>
> \partial( \phi( p ) \rho_o( p ) S_o )/ \partial t = F_o(p,S)
> \partial( \phi( p ) \rho_w( p ) S_w )/ \partial t = F_w(p,S)
> S_o + S_w = 1,
>
> where p is the pressure,
> \phi( p ) is a porosity function depending on pressure,
> \rho_x( p ) is a density function depending on pressure,
> S_o is the saturation of oil,
> S_g is the saturation of gas,
> t is time,
> F_x(p,S) is a function containing fluxes and source terms. The primary
> variables are p, S_o and S_w.
>
> We are using a lowest order Finite Volume discretisation.
>
> Now for implementing this in TS (with the prospect of later using
> TSAdjoint), we are not sure if we need all of the functions:
> TSSetIFunction, TSSetRHSFunction, TSSetIJacobian and TSSetRHSJacobian and
> what parts of the equations go where. Especially we are unsure of how to
> use the concept of a shifted jacobian (TSSetIJacobian).
>
> Any advice you could provide will be highly appreciated.
>

Barry and Emil,

I am also interested in this, since I don't know how to do it.

  Thanks,

     Matt


> Many thanks,
> Max la Cour Christensen
> PhD student, Technical University of Denmark
>



-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160312/3e286f73/attachment.html>


More information about the petsc-users mailing list