1 of 17

COMPARISION OF ACCURACY BETWEEN DIFFERENT NUMERICAL SOLVERS WITH EULER EQUATION

Submitted by Indira Ghimire

Reg.No:21UMPY06

Under the Sepervision of

Dr. Rupak Mukherjee

Department of Physics School of Physical Sciences Sikkim University,

Gangtok-737102

2 of 17

Introduction

  • The Euler equations are a set of quasilinear partial differential equations governing adiabatic and inviscid flow. They are named after Leonhard Euler in 1748.
  • They correspond to the Navier–Stokes equations with zero viscosity and zero thermal conductivity.
  • It can be applied to compressible or incompressible flow.
  • It can be expressed as: ∂v/∂t + v∇v = -(1/ρ)∇p
  • Where t represent the time, v represent the velocity vector of the fluid, p represent the pressure and represent the gradient operator.

∂v/∂t + v∇v = -(1/ρ)∇p

∂v/∂t + v∇v = -(1/ρ)∇p

3 of 17

Methods

  • Finite Difference Method (FDM)

i. Forward Difference

ii. Backward Difference

iii. Central Difference

  • Runge-Kutta Methods (RK)

i.Runge-Kutta first-order

ii.Runge-Kutta second-order

iii.Runge-Kutta third-order

iv.Runge-Kutta fourth-order

4 of 17

Finite Difference Methods

  • Finite-difference methods (FDM) are a class of numerical techniques for solving differential equations by approximating derivatives with finite differences.
  • The spatial domain is discretized, or broken into a finite number of steps, and the value of the solution at these discrete points is approximated by solving algebraic equations containing finite differences and values from nearby points.
  • FDM is basically of three types : forward , backward and central difference.

Fig 1: Forward ,backward and central difference method

5 of 17

Forward Difference Method

  • The forward difference method is a simple way to estimate the slope of a curve at a point by looking at the difference between function values at that point and a nearby point.
  • It helps us approximate the steepness of a curve without knowing the exact equation of the curve.
  • It is given by the formula: f'(x) ≈ (f(x + h) - f(x)) / h
  • Where, f'(x) is the derivative of the function f(x) at point x, and h is a small step size.
  • It's important to note that the forward difference method provides an approximation of the derivative and the accuracy of the approximation depends on the choice of h and the smoothness of the function being analyzed.
  • Using smaller values of h generally leads to better approximations, but extremely small values can introduce numerical errors due to limitations in floating-point arithmetic.

6 of 17

Backward difference method

  • The backward difference is a finite difference approximation method used in estimate the derivative of a function at a particular points.
  • In this method the derivative at a point is approximated by taking the difference between the function values at the current point and the previous point, and dividing it by the step size or interval between the two point.
  • It is given by the formula: f'(x) ≈ (f(x) - f(x - h)) / h
  • Where, f'(x) is the derivative of the function, f(x) is the function evaluated at the current point, f(x-h) is the fuction evaluated at the previous point and h is the step size or distance between the cutternt point and the previous points.

7 of 17

Central difference method

  • The central difference method is a finite difference method that optimizes the approximation for the differential operator in the central node of the considered patch and provides numerical solutions to differential equations.
  • It is given by the formula: f'(x) ≈ (f(x + h) - f(x - h)) / (2 * h)
  • It is easy to understand and implement, at least for simple material relations and that its convergence rate is faster than some other finite difference methods, such as forward and backward difference.
  • The right side basically represent the diffusion terms, using central difference approximation and left side represent the convective terms.Therefore it gives equal grid on both sides.

8 of 17

Advection Equation

  • The advection equation is a fundamental partial differential equation used to describe the transport of a quantity by advection, which refers to the bulk motion or flow of a medium.
  • It is based on the principle that the rate of change of the quantity with respect to time is balanced by the rate of change with respect to the spatial coordinate, multiplied by the advection velocity.
  • It is can be written as: ∂u/∂t + c ∂u/∂x = 0�
  • where u(x, t) represents the quantity being transporte, t is time, x is the spatial coordinate, and c is the advection velocity or speed at which the quantity is being transported.

The term ∂u/∂t represents the rate of change of the quantity with respect to time.

  • The term ∂u/∂x represents the rate of change of the quantity with respect to the spatial coordinate x.

9 of 17

Runge-Kutta Method(RK)

  • It is a numerical algorithm used to solve ordinary differential equations (ODEs).
  • It approximates the solution by dividing the interval into smaller subintervals and calculating the solution at discrete points within each subinterval.
  • The most commonly used form is the fourth-order Runge-Kutta (RK4) method.The general formula is:
  • k₁ = h * f(t, y)
  • k₂ = h * f(t + h/2, y + k₁/2)
  • k₃ = h * f(t + h/2, y + k₂/2)
  • k₄ = h * f(t + h, y + k₃)

  • y(t + h) = y(t) + (k₁ + 2k₂ + 2k₃ + k₄) / 6
  • Where, t is the current time, y is the current solution, h is the step size, and f(t, y) is the derivative of the solution y with respect to t
  • By repeatedly applying RK4 with smaller step sizes, a more accurate approximation of the ODE solution can be obtained.
  • The RK4 method is widely used in scientific computing and engineering for solving differential equations.

10 of 17

Runge-Kutta First-Order(RK1)

  • y(t + h) = y(t) + h * f(t, y)
  • Where, t is the current time, y is the current solution, h is the step size, f(t,y) represents the derivative of the solution y with respect to t.
  • It involves updating the solution by taking a single step of size h, and adding it to the current solution.
  • While the RK1 method is the simplest form of the Runge-Kutta family, it has limitations in terms of accuracy and stability.
  • It is generally less accurate than higher-order methods like RK4 but it can still be useful for solving simple ODEs or as a starting point for more advanced methods.
  • These are the graph for Advection equation(RK1) in forward, backward and central difference method.

11 of 17

Runge-Kutta Second-Order(RK2)

  • k₁ = h * f(t, y)
  • k₂ = h * f(t + h/2, y + k₁/2)
  • y(t + h) = y(t) + k₂
  • Where, t is the current time, y is the current solution, h is the step size, f(t,y) represents the derivative of the solution y

with respect to t, k₁ and k₂ are intermediated slopes calculated within a subinterval.

  • It calculate two intermediate slopes, k₁ and k₂, based on the derivative of the solution at different points within the subinterval.
  • Compared to the RK1 method, RK2 provides a more accurate approximation of the ODEs.
  • It is a widely used method for solving ODEs in scientific and engineering applications.
  • It is still less accurate than higher-order methods like RK4.
  • These are the graph for Advection equation(RK2) in forward, backward and central difference method.

12 of 17

Runge-Kutta Third-Order(RK3)

  • k₁ = h * f(t, y)
  • k₂ = h * f(t + h/2, y + k₁/2)
  • k₃ = h * f(t + h, y - k₁ + 2k₂)
  • y(t + h) = y(t) + (k₁ + 4k₂ + k₃) / 6
  • Where, t is the current time, y is the current solution, ,h is the step size, f(t, y) represents the derivative of the solution y with respect to t,
  • k₁, k₂, and k₃ are intermediate slopes calculated within a subinterval.
  • It involves calculating three intermediate slopes, k₁, k₂, and k₃, based on the derivative of the solution at different points within

the subinterval.

  • As compared to the RK1 and RK2 methods, RK3 provides a more accurate approximation of the ODEs .It strikes a

balance between accuracy and computational complexity.

  • These are the graph for Advection equation(RK3) in forward, backward and central difference method.

13 of 17

Runge-Kutta Fourth-Order(RK4)

  • k₁ = h * f(t, y)
  • k₂ = h * f(t + h/2, y + k₁/2)
  • k₃ = h * f(t + h/2, y + k₂/2)
  • k₄ = h * f(t + h, y + k₃)

  • y(t + h) = y(t) + (k₁ + 2k₂ + 2k₃ + k₄) / 6
  • Where, t is the current time,
  • y is the current solution,
  • h is the step size,
  • f(t, y) represents the derivative of the solution y with respect to t,
  • k₁, k₂, k₃, and k₄ are intermediate slopes calculated within a subinterval.

14 of 17

Continue.......

  • It involves calculating four intermediate slopes, k₁, k₂, k₃, and k₄, based on the derivative of the solution at different points within the subinterval.
  • Compared to lower-order methods like RK1, RK2, and RK3, RK4 provides a higher level of accuracy in approximating the ODEs solution. It is known for its stability and accuracy.
  • These are the graph for Advection equation(RK4) in forward, backward and central difference method.

15 of 17

Burger Equation

  • It is a nonlinear partial differential equation used to model fluid dynamics and nonlinear wave phenomena. It is given by the expression: ∂u/∂t + u * ∂u/∂x = ν * ∂²u/∂x²
  • Where, u represents the dependent variable (velocity, density, or wave amplitude), t is time, x is spatial position, and ν is the kinematic viscosity.
  • The equation combines convection (u * ∂u/∂x) and diffusion (ν * ∂²u/∂x²), representing how the fluid or wave moves and spreads over time.
  • It describes important phenomena such as shock waves, rarefaction waves, and turbulence, allowing us to understand and analyze these nonlinear effects.
  • Understanding and studying the Burger's equation helps us gain insights into the behavior of fluids and waves in real-world situations.
  • These are the graph for Burger equation(RK4) in forward, backward and central difference method.

16 of 17

Conclusion

  • In conclusion, the higher-order numerical methods such as RK4 tend to provide better accuracy compared to lower-order methods like Euler's method.
  • Central dierence schemes are generally more accurate for Advection problems and capturing shocks in Burger's equation.
  • However, the suitability and accuracy of a specic method can depend on various factors such as grid resolution, stability criteria, and the nature of the problem being solved.
  • It is recommended to perform a comparative analysis using specifc test cases to determine the most accurate method for a given scenario.

17 of 17

THANK YOU