{"id":22462577,"url":"https://github.com/louis-finegan/convection-diffusion-models-finite-difference-method-python3","last_synced_at":"2025-08-02T05:31:56.288Z","repository":{"id":209698767,"uuid":"724732281","full_name":"Louis-Finegan/Convection-Diffusion-Models-Finite-Difference-Method-Python3","owner":"Louis-Finegan","description":"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.","archived":false,"fork":false,"pushed_at":"2024-07-18T10:48:36.000Z","size":74047,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-07-18T19:12:41.858Z","etag":null,"topics":["convection-diffusion","finite-difference-method","fokker-planck-equation","heat-equation","jupyter-notebook","mathematical-modelling","matplotlib","matplotlib-animation","numpy","python3","transport-equation"],"latest_commit_sha":null,"homepage":"https://louis-finegan.github.io/Convection-Diffusion-Models-Finite-Difference-Method-Python3/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Louis-Finegan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-28T17:21:55.000Z","updated_at":"2024-07-18T10:48:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"129c4734-74b7-48e2-9abb-4aa0783bbde0","html_url":"https://github.com/Louis-Finegan/Convection-Diffusion-Models-Finite-Difference-Method-Python3","commit_stats":null,"previous_names":["louis-finegan/convection-diffusion-models-finite-difference-method-python3"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Louis-Finegan%2FConvection-Diffusion-Models-Finite-Difference-Method-Python3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Louis-Finegan%2FConvection-Diffusion-Models-Finite-Difference-Method-Python3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Louis-Finegan%2FConvection-Diffusion-Models-Finite-Difference-Method-Python3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Louis-Finegan%2FConvection-Diffusion-Models-Finite-Difference-Method-Python3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Louis-Finegan","download_url":"https://codeload.github.com/Louis-Finegan/Convection-Diffusion-Models-Finite-Difference-Method-Python3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228439502,"owners_count":17920025,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["convection-diffusion","finite-difference-method","fokker-planck-equation","heat-equation","jupyter-notebook","mathematical-modelling","matplotlib","matplotlib-animation","numpy","python3","transport-equation"],"created_at":"2024-12-06T09:10:13.375Z","updated_at":"2024-12-06T09:10:51.134Z","avatar_url":"https://github.com/Louis-Finegan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Diffusion Convection Equation\n\n## Introduction\n\nThe Diffusion Convection Equation is a Partial Differential Equation writen in the form:\n\n$$\\frac{\\partial u}{\\partial t} = \\nabla ( D \\nabla u) + \\nabla \\cdot (\\mathbf{c} u)$$\n\nThis Equation can model most physical phenomena involving the transfer of a quantity by 'Diffusion' and 'Convection' (Advection).\n\n1. $\\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.\n\n2. $\\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}$.\n\nClick [here](https://en.wikipedia.org/wiki/Convection%E2%80%93diffusion_equation) for more information on the Diffusion Convection Equation.\n\n## Simplifications\n\nThere are a number of simplifications made to this model.\n\n1. 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$.\n\n2. Let the convection vector field be constant, this means the convection term siplifies to $\\mathbf{c} \\cdot \\nabla u$.\n\n## Diffusion Equation\n\nSuppose 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:\n\n$$\\frac{\\partial u}{\\partial t} = D\\nabla^2 u$$\n\n## Convection Equation\n\nSuppose 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:\n\n$$\\frac{\\partial u}{\\partial t} = \\mathbf{c} \\cdot \\nabla u$$\n\n## Examples\n\nConsider a Diffusion Convection model in 2 dimension with the vector $\\mathbf{c}$ having equal vector components and $D$ is constant.\n\nLet $\\mathbf{c} = [-0.1, -0.1]$ and $D = 0.009$. (Neumann boundary condition and 3d animations can be found in  [Two dimensional examples](examples/Two_Dimensional_Models.ipynb))\n\n### Diffusion Convection Model\n\nSolution:\n\n\u003cimg src=\"README_img\\animation_convection_diffusion_2dims_dirichlet_color.gif\" width=\"\" height=\"\" /\u003e\n\n### Diffusion Model\n\nSolution:\n\n\u003cimg src=\"README_img\\animation_diffusion_2dims_dirichlet_color.gif\" width=\"\" height=\"\" /\u003e\n\n### Convection Model\n\nSolution:\n\n\u003cimg src=\"README_img\\animation_convection_2dims_color.gif\" width=\"\" height=\"\" /\u003e\n\n## Applications\n\nSome applications of these models include:\n\n1. Heat Transfer or cooling of a system.\n\n2. Tranportation of a fluids density distribution that is flowing uniformly.\n\n3. Fokker Plank Equation of a Stochastic Differential Equation with uniform drift and standard deviation.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flouis-finegan%2Fconvection-diffusion-models-finite-difference-method-python3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flouis-finegan%2Fconvection-diffusion-models-finite-difference-method-python3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flouis-finegan%2Fconvection-diffusion-models-finite-difference-method-python3/lists"}