# Deriving entropy function and entropy flux for a system of equations

I've been reading up on the concept of entropy as a useful way of developing a natural residual for a system of equations. For example, the entropy function for compressible Navier-Stokes is $$H(U)=-\rho \ln(p\rho^{-\gamma})$$ with entropy flux $$F^i(U)=-\rho \ln(p\rho^{-\gamma})u_i$$ and for isentropic flow the entropy function is $$H(U)=\frac{p}{\gamma-1}+\frac{1}{2}\rho u_i u_i$$ with entropy flux $$F^i(U)=(e+p)u_i\,.$$

What I am unclear on however, is the process by which to derive such an entropy function for a given system of equations. I'm aware it is probably not possible to generate one in general, but I'm interested in systems which are generally well behaved by other criteria, so I'm optimistic an entropy function can be derived for them.

My Google searches have not yielded constructive help on the topic, so could someone point me to a source on how to derive these entropy functions?

I'm most familiar with entropy in the analysis of non-linear hyperbolic conservation laws. From what I understand the entropy/entropy flux pair $(\Phi,\Psi)$ provided a tool to examine properties of the PDE like stability and irreversibility in time.
The derivation of the entropy pair $(\Phi,\Psi)$ for a given conservation law is quite involved and from what I've seen the only detailed outline of the procedure (involving the compressible Euler equations) is in Chap. 5 of Lecture notes for "Entropy and PDEs" by Evans. Evans gives a lot of background information and a mathematically thorough treatment of the topic. Once you're used to his notation and style, the computation of the entropy/entropy flux pair begins on page 138.