[petsc-users] Implementing TS routine
Manuel Valera
mvalera-w at sdsu.edu
Wed Jun 26 16:17:40 CDT 2019
Hi PETSc,
I am trying to implement the Time stepping routines in my model, i have a
working runge-kutta time scheme that goes to the following steps:
- Interpolate u,v,w to the time advancing variable position.
- Calculate nonlinear coefficients and advect velocities with a
forward-backward shock capturing scheme.
- Calculate the variable laplacian
- Sum terms to create RHS (nonlinear advected velocities + laplacian)
- Finally, the runge kutta integration is done in a typical way that
looks like:
newtemp(t+1) = prevtemp(t) + dt*RHS
So my questions are:
- I think my problem is nonlinear, but is being made linearized by the
advecting scheme, is this correct? this is to know if i should use the
linear or nonlinear routines for TS.
- How do i know what are the appropriate routines i should be using
here? so far i think i should use the following:
call TSCreate(PETSC_COMM_WORLD,ts,ierr)
call TSSetProblemType(ts,TS_LINEAR,ierr)
call TSSetTimeStep(ts,dt,ierr)
call TSSetFromOptions(ts,ierr)
call TSSetRHSFunction(ts,NULL,TSComputeRHSFunctionLinear,NULL,ierr)
call TSSolve(ts,loctemperature,ierr)
Should i use call TSSetRHSJacobian for the temperature jacobian in this
case?
I am using
https://www.mcs.anl.gov/petsc/petsc-current/src/ts/examples/tutorials/ex4.c.html
as
a general guide, is there a more appropriate example?
The dt value and total timesteps are controlled by the model,
Thanks for your help,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20190626/50b5a418/attachment.html>
More information about the petsc-users
mailing list