Coder Social home page Coder Social logo

computational_fluid_dynamics_assignment's Introduction

Computational Fluid Dynamics Assignment

Question:

Consider 1-D Hyperbolic equation U_t + cU_x = 0 where U is scalar and 𝑐 is a constant wave speed (c > 0). Taking the computational domain 0 ≤ x ≤ 1, start with the following initial condition,

a) U (x,0) = sin⁡(2πx)

b) U (x,0) = {(1 when x≤0.25 and 0 when x>0.25)}

Use Courant-Isaacson-Rees (CIR) method and Lax-Wendroff Scheme, advance the solutions by a distance equal to the half of the length of the computational domain with courant number λ=0.25,0.5,0.75,1.0 . Make plots of exact and computed solution for a given λ. Comment on the results based on the theoretical analysis

Answers for Initial condition (a):

The code " CIR-scheme-initial1.m " is for CIR scheme when initial condition is U (x, 0) = sin(2πx), periodic boundary condition and when N = 100.

Graphs obtained for CIR-Scheme: When N = 100; Screenshot (1518) When N = 50; Screenshot (1522)

The code "LW-SCHEME-func1.m " is for Lax-Wendroff scheme when initial condition is U (x,0) = sin(2πx), periodic boundary condition and when N = 100.

Graphs obtained for Lax-Wendroff Scheme: When N = 100; Screenshot (1523) When N = 50; Screenshot (1519)

Comments on obtained results:

When the step size is lower, that is when N = 50, we see the graph deviates more than the exact solution. But when we increased N to 100, we are getting more accurate results. Similarly, for different lambda value or the Courant number we are getting solutions which are deviated from the exact solution. So, it is important to select the correct ratio value for dt/dx as well as more step size gives more accurate results. Now, coming to the type or error we can clearly see that while using CIR scheme we are getting smears in our graph which is the effect of numerical dissipation. In case of Lax-Wendroff scheme we are getting wiggle which is the effect of numerical dispersion.

Answers for Initial condition (b):

The code " CIR-scheme-initial2.m " is for CIR scheme when initial condition is U(x,0) = (1 when x≤0.25 and 0 when x>0.25) when N = 100.

Graphs obtained for CIR-Scheme: When N = 100; Screenshot (1524) When N = 50; Screenshot (1525)

The code "LW-SCHEME-func2.m " is for Lax-Wendroff scheme for the second initial condition.

Graphs obtained for Lax-Wendroff scheme: When N = 100; Screenshot (1527) When N = 50; Screenshot (1528)

Comments on obtained results:

Coming to the type or error in linear initial condition, we can clearly see that while using CIR scheme we are getting smears in our graph. This is the effect of numerical dissipation which we have already seen when our initial condition was a function of sine. Dissipative errors depend on the sizes of the steps and therefore affect the accuracy of solution. In case of Lax-Wendroff scheme we are getting wiggles in our line graphs which is the effect of numerical dispersion. The Lax-Wendroff algorithm is second-order accurate, which is why some dispersion error is expected. The oscillatory behaviour of the solution for the smaller Courant number clearly indicates the errors developed in the solution. The amplitude of the solution remains the same (within small errors) unlike the amplitude in CIR Scheme.

computational_fluid_dynamics_assignment's People

Contributors

vaishnu7 avatar

Stargazers

 avatar

Watchers

 avatar

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.