# Finite Difference solution to nonlinear diffusion equation

Versión 1.1.0.0 (196 KB) por
Numerical solution to nonlinear diffusion equation and creates movie of results
3K descargas

Ver licencia

Solves nonlinear diffusion equation which can be linearised as shown for the general nonlinear diffusion equation in Richtmyer & Morton [1]. The approach is to linearise the pde and apply a Crank-Nicolson implicit finite difference scheme to solve the equation numerically.
Matlab run command
--------------------------

type:
IsoFreeSurfaceSolver

solves the pde:
-------------------

\frac{\partial h}{\partial t}=\frac{1}{12}\frac{\partial^2 h^4}{\partial x^2}

The pde has the application to isothermal viscous fluid flow spreading on a horizonatal substrate under gravity - Huppert [2]. Note that PDE has been nondimensionlised.

Initial conditions:

t=0: h = (1 - x^2)_{+} + 10^-6 (has prewetting film)

The spatial domain is discretised taking account of symmetry at x = 0:

\frac{\partial h}{\partial x} = 0

and is also used to close the free surface model at the end of the discretised domain (x = xend) - assumes fluid won't reach this boundary.

The pde can be solved analytically using similarity equations as discussed by Barenblatt [3]; used below to validate numerical solution.

References
--------------

[1] "Difference Methods for initial value problems," R. D. Richtmyer and K. W. Morton, John Wiley and Sons, 1967.

[2] "The Propagation of two-dimensional and axisymmetric visous gravity currents over a rigid horizontal surface," H. E. Huppert, Journal of Fluid Mechanics, 1982.

[3] "On some unsteady motions of a liquid or gas in a porous medium, Russian journal Prikladnaya Matematika i Mekhanika, 1952.

### Citar como

Ahmos Sansom (2024). Finite Difference solution to nonlinear diffusion equation (https://www.mathworks.com/matlabcentral/fileexchange/27890-finite-difference-solution-to-nonlinear-diffusion-equation), MATLAB Central File Exchange. Recuperado .

##### Compatibilidad con la versión de MATLAB
Se creó con R2015a
Compatible con cualquier versión
Windows macOS Linux