General Conservation Equation¶
The equations that model the evolution of physical, chemical and biological systems often have a remarkably universal form. Indeed, PDEs have proven necessary to model complex physical systems and processes that involve variations in both space and time. In general, given a variable of interest \(\phi\) such as species concentration, pH, or temperature, there exists an evolution equation of the form
where \(H\) is a function of \(\phi\), other state variables \(\lambda_i\), and higher order derivatives of all of these variables. Examples of such systems are wide ranging, but include problems that exhibit a combination of diffusing and reacting species, as well as such diverse problems as determination of the electric potential in heart tissue, of fluid flow, stress evolution, and even the Schrödinger equation.
A general conservation equation, solved using FiPy, can include any combination of the following terms,
where \(\rho\), \(\vec{u}\) and \(\Gamma_i\) represent coefficients in the transient, convection and diffusion terms, respectively. These coefficients can be arbitrary functions of any parameters or variables in the system. The variable \(\phi\) represents the unknown quantity in the equation. The diffusion term can represent any higher order diffusion-like term, where the order is given by the exponent \(n\). For example, the diffusion term can represent conventional Fickian diffusion [i.e., \(\nabla\cdot(\Gamma\nabla\phi)\)] when the exponent \(n = 1\) or a Cahn-Hilliard term [i.e., \(\nabla \cdot (\Gamma_1 \nabla [ \nabla \cdot \Gamma_2 \nabla \phi ) ] )\) [18] [19] [20]] when \(n = 2\), or a phase field crystal term [i.e., \(\nabla \cdot (\Gamma_1 \nabla [ \nabla \cdot \Gamma_2 \nabla \{ \nabla \cdot \Gamma_3 \nabla \phi ) \} ) ] )\) [21]] when \(n = 3\), although spectral methods are probably a better approach. Higher order terms (\(n > 3\)) are also possible, but the matrix condition number becomes quite poor.