Dear PETSc developers Hi, Recently, I am using PETSc to write a one-dimensional hydrodynamics solver. At present, I use SNES object to complete the development of steady-state (excluding time term) program, and the result is very good. I want to continue with the dynamic solver, but have some problems. As shown in the attachment, I solve three conservation equations (partial differential equations), and use finite difference to separate one-dimensional meshes. The three main variables I solved are velocity V, pressure P, and energy E. therefore, I have the following question when writing transient programs using TS objects:
1. Three equations correspond to three variables. I used *TSSetIfunction* to set the residual equation. In theory, I can use *Vec u_t* (time derivative of state vector) to set the time term. But the time term in *Eq1* is the time partial derivative of density *\ rho*. The density *\rho* is a function of energy E and pressure P. How to set this time term which is not a main variable, but an intermediate variable (*\rho (E, P)*)) which is composed of two main variables? (In the equations, the direction of the mesh is z. g represents the acceleration of gravity. f_vis for resistance pressure drop, Q for heat source) I need some advices, if there are examples better. Thanks, Yingjie
Equation.pdf
Description: Adobe PDF document
