Coder Social home page Coder Social logo

louis-finegan / convection-diffusion-models-finite-difference-method-python3 Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 72.29 MB

Applying the finite-difference method to the Convection Diffusion equation in python3. Examples included: One dimensional Heat equation, Transport equation, Fokker-Plank equation and some two dimensional examples.

Home Page: https://louis-finegan.github.io/Convection-Diffusion-Models-Finite-Difference-Method-Python3/

Python 100.00%
convection-diffusion finite-difference-method fokker-planck-equation heat-equation jupyter-notebook mathematical-modelling matplotlib matplotlib-animation numpy python3 transport-equation

convection-diffusion-models-finite-difference-method-python3's Introduction

Diffusion Convection Equation

Introduction

The Diffusion Convection Equation is a Partial Differential Equation writen in the form:

$$\frac{\partial u}{\partial t} = \nabla ( D \nabla u) + \nabla \cdot (\mathbf{c} u)$$

This Equation can model most physical phenomena involving the transfer of a quantity by 'Diffusion' and 'Convection' (Advection).

  1. $\nabla(D \nabla u)$ is the diffusion term. Diffusion describes the net movement of a quantity $u$, generally from a region of higher concentration to lower concentraction.

  2. $\nabla \cdot (\mathbf{c} u)$ is the convection term. Convection (Advection) describes the bulk motion of a quantity $u$ under the a velocity field $\mathbf{c}$.

Click here for more information on the Diffusion Convection Equation.

Simplifications

There are a number of simplifications made to this model.

  1. Let the diffusion coefficient $D$ be constant, this means it can come outside of the gradient operator resulting in the dot product of the gradients becoming the Laplacian. Hence the diffusion is written as $D \nabla^2 u$.

  2. Let the convection vector field be constant, this means the convection term siplifies to $\mathbf{c} \cdot \nabla u$.

Diffusion Equation

Suppose a model where $\mathbf{c} = 0$. This can be interpreted as a quantity $u$ under going diffusion only, so $u$ is not flowing with any vector field. instead it is moving into the less concentrated areas. This model is governed by the following Partial Differential Equation:

$$\frac{\partial u}{\partial t} = D\nabla^2 u$$

Convection Equation

Suppose a model where $D = 0$. this can be interpreted as a under going convection only, so $u$ is being transported with the same density distribution by a constant vector field $\mathbf{c}$. This model is governed by the following Partial Differential Equation:

$$\frac{\partial u}{\partial t} = \mathbf{c} \cdot \nabla u$$

Examples

Consider a Diffusion Convection model in 2 dimension with the vector $\mathbf{c}$ having equal vector components and $D$ is constant.

Let $\mathbf{c} = [-0.1, -0.1]$ and $D = 0.009$. (Neumann boundary condition and 3d animations can be found in Two dimensional examples)

Diffusion Convection Model

Solution:

Diffusion Model

Solution:

Convection Model

Solution:

Applications

Some applications of these models include:

  1. Heat Transfer or cooling of a system.

  2. Tranportation of a fluids density distribution that is flowing uniformly.

  3. Fokker Plank Equation of a Stochastic Differential Equation with uniform drift and standard deviation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.