Code Monkey home page Code Monkey logo

byrneta / computational-fluid-dynamics Goto Github PK

View Code? Open in Web Editor NEW
35.0 4.0 12.0 885 KB

:cyclone: Selected MATLAB code I wrote while taking a CFD class in graduate school. Finite-difference and finite volume approximations are compared to analytical solutions. Project descriptions are included. :cyclone:

License: GNU General Public License v3.0

MATLAB 100.00%
cfd computational-fluid-dynamics matlab octave finite-difference finite-volume

computational-fluid-dynamics's Introduction

Computational Fluid Dynamics

Here is a collection of MATLAB code (compatible with Octave) that might be of some help in solving various types of computational fluid dynamics problems. Functionally the codes produce valid results; however, I am sure there is room for improvement from an efficiency standpoint. The original project description from my professor is also posted for each type of problem.

Octave Compatibility

Tested with Octave 6.2.0 (arm64 Mac)

Diffusion PDE

Finite difference approximation of a given couette flow between two parallel plates. The fluid has a constant kinematic viscosity and density. The upper plate is stationary and the lower one is suddenly set in motion with a constant velocity. Governing partial differential equation (PDE) is discretized using a first-order forward-time and second-order central space (FTCS) scheme.

See Description

Example Plot

Diffusion PDE Plot

Convection-Diffusion PDE

Comparison between finite difference and finite volume approximations of wave propagation inside a one-dimensional channel. Fluid velocity and diffusion coefficient are given in addition to initial conditions along the channel and boundary conditions at the inlet and outlet. Forward Time-Centered Space (FTCS) and first-order upwind are used for finite volume approximations while FTCS, first-order upwind, Lax-Wendroff and MacCormack are used for finite difference.

See Description

Example Plot

Convection-Diffusion PDE Plot

Elliptic PDE

Steady-state temperature distribution of a two-dimensional rectangular plate is approximated using finite difference method. Plate dimensions and boundary conditions at the edges are given. Different types of relaxation are applied: Point Successive Over-Relaxation (PSOR), Line Successive Over-Relaxation (LSOR), and Alternative Direction Implicit (ADI).

See Description

Example Plots

Elliptic PDE Plot #1 Elliptic PDE Plot #2 Elliptic PDE Plot #2

Vorticity-Stream Function Method

The steady-state u-velocity profile of an incompressible laminar flow within a plane channel is approximated using finite difference. The flow is governed by both vorticity and stream-function transport equations.

See Description

Example Plots

Vorticity PDE Plot #2 Vorticity PDE Plot #2

computational-fluid-dynamics's People

Contributors

byrneta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

computational-fluid-dynamics's Issues

Compatible to octave?

Are this exemples compatible to octave?

than you can extend your infos about this.

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.