<div dir="ltr">Hi,<div><br></div><div>Suppose the following is the residual function that TS needs:</div><div><br></div><div>void residualFunction(TS ts, PetscScalar t, Vec X, Vec dX_dt, Vec F, void *ptr)</div><div><br></div>
<div>and this returns the following finite volume residual at each grid point</div><div><br></div><div>dU_dt + gradF + sourceTerms = 0</div><div><br></div><div>where dU_dt are the time derivatives of the conserved variables.</div>
<div><br></div><div>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 following?</div>
<div><br></div><div>dU_dt = (U(X) - U(X_old) )/dt -- (1)</div><div><br></div><div>(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)</div>
<div><br></div><div>So, is computing dU_dt using (1) permissible using TS? The jacobian will be correctly assembled for implicit methods?</div><div><br></div><div>Cheers,</div><div>Mani</div></div>