RHANWA23
RHANWA23
RHANWA23
Convection
In this section, we introduce the concept of convection, which is the transport of physical quan-
tities (such as heat, mass, or momentum) through a fluid. Convection occurs when a quantity
is carried by the flow of a fluid, and it plays a crucial role in many physical and engineering
processes.
Convection is described by the advection equation, which models how a scalar field ϕ(x, t) is
transported by a velocity field u(x, t). The general form of the advection equation is:
∂ϕ
+ u · ∇ϕ = 0
∂t
where:
∂ϕ
• ∂t
is the time derivative of the scalar field, representing how ϕ changes with time at a fixed
point,
The advection equation essentially states that the change in ϕ at a point is due to the fluid carrying
ϕ from one place to another.
In convection, the quantity ϕ (such as heat, pollutant concentration, or dye in a liquid) is carried
along with the flow of the fluid. If the velocity field u(x, t) is known, we can predict how ϕ(x, t)
will evolve over time.
- If u · ∇ϕ > 0, it means the scalar field ϕ is increasing in the direction of the velocity field,
indicating that more of the scalar quantity is being carried into that region. - If u · ∇ϕ < 0, the
1
scalar field is decreasing in the direction of the velocity, meaning the quantity is being transported
away.
The advection equation assumes that the quantity is conserved and that there are no sources or
sinks in the system.
where u is the velocity in the x-direction and v is the velocity in the y-direction. The advection
equation in two dimensions is:
∂ϕ ∂ϕ ∂ϕ
+u +v =0
∂t ∂x ∂y
Similarly, in three dimensions, the velocity field is:
2
1.5. Total Derivative and Material Derivative
In the context of convection, we often introduce the material derivative, which describes the
rate of change of a quantity as experienced by an observer moving with the fluid. The material
derivative of ϕ(x, t) is given by:
Dϕ ∂ϕ
= + u · ∇ϕ
Dt ∂t
The term Dϕ
Dt
represents the total time derivative of ϕ for a particle moving along with the fluid
flow. It captures both the local rate of change of ϕ at a point and the transport of ϕ by the fluid.
The advection equation can now be rewritten using the material derivative:
Dϕ
=0
Dt
This equation expresses that the quantity ϕ is conserved as it is carried by the flow; the rate of
change of ϕ along a fluid particle’s path is zero.
• Numerical Diffusion: One issue is that many numerical schemes introduce artificial smooth-
ing or ”diffusion” of the scalar field, which can lead to a loss of sharp features in ϕ(x, t).
• Stability: Many methods for solving the advection equation require a careful balance
between time step size and spatial resolution to maintain stability. The Courant-Friedrichs-
Lewy (CFL) condition is often used to ensure stability:
∆x
∆t ≤
|u|
where ∆t is the time step, ∆x is the spatial grid size, and |u| is the magnitude of the velocity
field.
To address some of these challenges, several numerical methods have been developed, including
upwind schemes. These methods take into account the direction of the flow when updating the
3
values of ϕ(x, t). In an upwind scheme, the value of ϕ at a point is computed based on the
information coming from the ”upwind” direction (the direction opposite to the flow).
Other methods include:
• Godunov Scheme: A more advanced approach that solves a series of Riemann problems
at each grid cell interface to accurately capture discontinuities.
• Heat Transfer: In fluids, convection is a major mechanism for heat transfer. Hot fluid
moves to colder regions, and vice versa, distributing thermal energy.
In the context of the level set method, convection describes the motion of an interface or surface
as it is carried by a velocity field. The level set function ϕ(x, t), which represents the surface, is
updated according to the advection equation:
∂ϕ
+ u · ∇ϕ = 0
∂t
This equation models how the surface evolves over time as it is advected by the fluid.
4
Note
Convection is a key process in fluid dynamics, governing the transport of various scalar quantities
such as heat and mass. The advection equation provides a mathematical framework for under-
standing and modeling convection. However, solving this equation numerically requires careful
consideration of issues such as numerical diffusion and stability. Advanced numerical schemes
like upwind methods, Lax-Wendroff, and Godunov schemes are used to improve accuracy and
capture the sharp features of the transported quantity.
2. Upwind Differencing
In this section, we explore the upwind differencing scheme, a numerical method used to solve the
advection equation. Upwind differencing addresses challenges related to stability and numerical
diffusion in solving the advection equation.
∂ϕ ∂ϕ
+u =0
∂t ∂x
where:
This equation describes how the scalar quantity ϕ(x, t) evolves over time as it is carried by the
velocity field u.
• Time: We divide time into small intervals of size ∆t, where tn represents the time at the
n-th step.
5
• Space: We divide space into intervals of size ∆x, where xi represents the position at the
i-th grid point.
The goal is to approximate the derivatives in the advection equation using these discrete points.
The upwind differencing scheme accounts for the direction of the velocity u. The idea is to use
values of ϕ from the ”upwind” direction — the direction opposite to the flow.
• ϕi is the value of ϕ at xi ,
∂ϕ ϕi+1 − ϕi
≈
∂x ∆x
where:
• ϕi is the value of ϕ at xi ,
6
2.4. Time Discretization Using the Forward Euler Method
∂ϕ
For the time derivative ∂t
, we use a forward difference:
∂ϕ ϕn+1 − ϕni
≈ i
∂t ∆t
where:
• ϕn+1
i is the value of ϕ at the next time step tn+1 ,
u∆t n
ϕn+1 = ϕni − (ϕ − ϕni−1 )
i
∆x i
This formula updates the value of ϕ at xi for the next time step based on the values at xi and xi−1 .
u∆t n
ϕn+1 = ϕni − (ϕi+1 − ϕni )
i
∆x
This formula updates the value of ϕ at xi for the next time step based on the values at xi and xi+1 .
7
2.6. CFL Condition for Stability
To ensure the stability of the upwind differencing scheme, we need to satisfy the Courant-
Friedrichs-Lewy (CFL) condition:
|u|∆t
≤1
∆x
This condition ensures that the numerical solution remains stable and does not ”skip over” in-
formation during the propagation of ϕ through the grid. The time step ∆t must be chosen small
enough based on the grid spacing ∆x and the velocity u.
2.7. Summary
The upwind differencing scheme is an effective method to solve the advection equation when the
flow direction is known. By using backward or forward differences depending on the direction
of the velocity, the method avoids issues like oscillations and instability. The key points are:
By following these principles, we can reliably solve the advection equation for various practical
applications.
In this section, we derive and explain the Essentially Non-Oscillatory (ENO) scheme for solving
the Hamilton-Jacobi equation, which is commonly used in level set methods. The ENO scheme
is designed to handle sharp gradients and discontinuities in the solution while avoiding spurious
oscillations.
8
3.1. Hamilton-Jacobi Equation
The general form of the Hamilton-Jacobi equation is:
∂ϕ
+ H(∇ϕ) = 0
∂t
where:
This equation describes how the scalar field ϕ evolves over time according to the Hamiltonian.
The Hamilton-Jacobi equation arises in many physical and mathematical models, including me-
chanics, control theory, and the level set method for tracking moving interfaces.
• ϕni is the value of ϕ at the i-th grid point and at time step n,
ϕn+1
i = ϕni − ∆t · H(∇ϕni )
9
3.2.2. Spatial Discretization and Gradient Approximation
∂ϕ
To approximate the gradient ∇ϕ, we need to discretize space. In one dimension, the gradient ∂x
can be approximated by finite differences. The ENO scheme is used to choose the appropriate
stencil that avoids oscillations near sharp gradients.
∂ϕ
The gradient ∂x
at grid point xi can be approximated using different finite difference methods:
• Forward difference:
∂ϕ ϕi+1 − ϕi
≈
∂x ∆x
• Backward difference:
∂ϕ ϕi − ϕi−1
≈
∂x ∆x
• Central difference (second-order accuracy):
∂ϕ ϕi+1 − ϕi−1
≈
∂x 2∆x
However, near discontinuities or sharp gradients, central differencing can introduce spurious
oscillations. The ENO scheme dynamically chooses either forward, backward, or central differ-
ences based on the smoothest neighboring points, avoiding oscillations.
• Check the neighboring points xi−1 , xi+1 , and further points if needed.
• Choose the stencil (backward, forward, or central) that minimizes the local oscillations.
This process is done recursively to build up higher-order accurate stencils.
This approach allows the ENO scheme to switch between different finite difference stencils as
needed to avoid oscillations while maintaining high accuracy in smooth regions.
10
3.4. Numerical Hamiltonian
The next step is to compute the numerical Hamiltonian. In many applications, the Hamiltonian
H(∇ϕ) is not linear and can involve complex terms such as the norm of the gradient |∇ϕ|.
For example, in level set methods, the Hamiltonian is often given by:
H(∇ϕ) = F|∇ϕ|
where F is a given speed function (which could depend on position, time, or ϕ) and |∇ϕ| is the
magnitude of the gradient.
For 1D problems, |∇ϕ| is approximated by:
ϕi+1 − ϕi−1
|∇ϕ| ≈
2∆x
For higher dimensions, the gradient is computed in each direction and combined using the Eu-
clidean norm.
Once the stencil is chosen and the gradient is computed, the Hamiltonian is evaluated. The
ENO scheme ensures that the computed Hamiltonian remains stable even in the presence of
discontinuities or sharp changes in the gradient of ϕ.
For example, if the Hamiltonian is H(∇ϕ) = F|∇ϕ|, the ENO scheme would compute |∇ϕ| using
the smoothest available stencil and then multiply by F.
The basic ENO scheme described above is first-order accurate. To achieve higher-order accuracy,
the ENO scheme can be extended by constructing higher-order finite difference approximations
recursively.
For example:
• Second-order ENO: The scheme selects the best stencil by checking the smoothness at
neighboring points and then uses a combination of first and second-order differences.
11
• Third-order ENO: The scheme builds on the second-order method by adding an addi-
tional layer of recursive stencil selection.
Each higher-order ENO scheme improves the accuracy while still avoiding oscillations near sharp
gradients.
The ENO scheme provides a powerful method for solving the Hamilton-Jacobi equation, partic-
ularly when dealing with problems that have discontinuities or sharp gradients. The key steps of
the ENO scheme are:
• Discretize space using finite differences, with a focus on choosing the stencil that mini-
mizes oscillations.
The ENO scheme is particularly useful in level set methods, where the evolving interface often
develops sharp features that require careful numerical handling to avoid introducing artificial
oscillations.
In this section, we introduce the Weighted Essentially Non-Oscillatory (WENO) scheme for solv-
ing the Hamilton-Jacobi equation. The WENO scheme is an extension of the ENO scheme and
provides higher-order accuracy while maintaining the ability to handle discontinuities and sharp
gradients without introducing oscillations.
12
4.1. Hamilton-Jacobi Equation
The Hamilton-Jacobi equation, which we aim to solve, is given by:
∂ϕ
+ H(∇ϕ) = 0
∂t
where:
The goal of the WENO scheme is to compute high-order accurate numerical solutions for ϕ(x, t)
while avoiding oscillations near sharp gradients or discontinuities.
∂ϕ ϕn+1 − ϕni
≈ i
∂t ∆t
where:
ϕn+1
i = ϕni − ∆t · H(∇ϕni )
Thus, the value of ϕ at the next time step is computed based on the Hamiltonian at the current
time step.
13
4.2.2. Spatial Discretization and the WENO Scheme
For spatial discretization, the WENO scheme is used to approximate the gradient ∇ϕ. The
WENO scheme builds on the ENO scheme by combining multiple stencils to achieve higher-
order accuracy while avoiding oscillations near discontinuities.
The main idea of WENO is to:
• Use several candidate stencils to compute multiple approximations of the spatial derivative.
• Assign weights to each stencil based on the smoothness of the function in that region.
• Combine these approximations using the weights to get a high-order accurate approxima-
tion of the gradient.
∂ϕ
For each stencil, we compute a candidate approximation for the derivative ∂x
.
1
D1 ϕ = (ϕi − 3ϕi−1 + 2ϕi−2 )
3∆x
1
D2 ϕ = (−ϕi+1 + 2ϕi + ϕi−1 )
3∆x
14
• For Stencil 3 (right-biased):
1
D3 ϕ = (2ϕi+2 − 3ϕi+1 + ϕi )
3∆x
These candidate approximations are combined using weights to compute the final approximation
of the gradient.
The smoothness of each stencil is measured using smoothness indicators, which are designed to
detect regions where the solution has large gradients or discontinuities. The smoothness indicator
for each stencil is computed as:
!2
X dl ϕ
βk = ∆x 2l−1
l
dxl k
where k refers to the stencil, and the sum is over the derivatives of ϕ in the stencil.
The final approximation of the spatial derivative is computed by combining the candidate ap-
proximations using nonlinear weights wk . The weights are chosen to favor the smoothest stencils
and to downplay the contribution of stencils in regions with large gradients or discontinuities.
The nonlinear weights wk are computed as:
αk
wk = P
j αj
where αk are the linear weights for each stencil, modified by the smoothness indicators:
ck
αk =
(ϵ + βk )2
Here:
• ck are the linear weights (typically chosen to achieve high-order accuracy in smooth re-
gions),
15
• ϵ is a small number to prevent division by zero.
The nonlinear weights wk are designed such that stencils in smooth regions (with small βk ) receive
higher weights, while stencils in regions with large gradients or discontinuities receive lower
weights.
Once the gradient ∇ϕ is computed using the WENO scheme, we evaluate the Hamiltonian H(∇ϕ).
As in the ENO scheme, the Hamiltonian may take various forms depending on the application.
For example, in level set methods, the Hamiltonian might be:
H(∇ϕ) = F|∇ϕ|
where F is a speed function and |∇ϕ| is the magnitude of the gradient. The WENO scheme
ensures that the computed Hamiltonian remains stable and oscillation-free even in the presence
of sharp gradients.
The WENO scheme provides a high-order accurate method for solving the Hamilton-Jacobi
equation while avoiding oscillations near discontinuities. The key steps are:
• Approximate the spatial derivative using multiple stencils and combine them using nonlin-
ear weights.
• Compute the smoothness indicators for each stencil to determine the weights.
16
• Evaluate the Hamiltonian based on the WENO approximation of the gradient.
The WENO scheme is widely used in numerical simulations because it combines high-order
accuracy with the ability to handle discontinuities without introducing spurious oscillations.
In this section, we introduce the Total Variation Diminishing (TVD) Runge-Kutta method, a nu-
merical scheme used to solve time-dependent partial differential equations (PDEs), such as the
advection equation, while preventing the introduction of new oscillations and ensuring stability.
The TVD property is important because it prevents spurious oscillations that often arise when
solving hyperbolic PDEs near steep gradients or discontinuities.
where ϕi and ϕi+1 are values of the function at adjacent grid points.
A numerical scheme is said to be Total Variation Diminishing (TVD) if the total variation does
not increase over time. Mathematically, a scheme is TVD if:
T V(ϕn+1 ) ≤ T V(ϕn )
where ϕn and ϕn+1 are the values of ϕ at time steps n and n + 1, respectively. The TVD property
ensures that the scheme does not introduce spurious oscillations or create new extrema in the
numerical solution.
17
Runge-Kutta methods advance the solution over time by combining multiple evaluations of the
function over a single time step.
ϕn+1
i = ϕni + ∆t · L(ϕni )
where:
• L(ϕni ) is the discrete approximation of the spatial derivative (i.e., the advection term).
This method is first-order accurate and is not TVD on its own. For higher accuracy and to ensure
the TVD property, we need higher-order methods.
ϕ(1)
i = ϕi + ∆t · L(ϕi )
n n
18
5.3.2. Third-Order TVD Runge-Kutta Method
The third-order TVD Runge-Kutta method improves accuracy while still maintaining the TVD
property. It consists of the following three steps:
ϕ(1)
i = ϕi + ∆t · L(ϕi )
n n
3 n 1 (1)
ϕ(2) = ϕ + ϕ + ∆t · L(ϕ(1)
)
i
4 i 4 i i
This method is third-order accurate in time and, like the second-order TVD Runge-Kutta method,
ensures that the solution remains TVD.
TVD Runge-Kutta methods are designed to handle problems with steep gradients or discontinu-
ities without introducing oscillations. The main advantages are:
• High-order accuracy: TVD Runge-Kutta methods can achieve second- and third-order
accuracy in time, making them suitable for problems requiring high precision.
• Easy to combine with spatial discretization schemes: TVD Runge-Kutta methods work
well with TVD spatial discretization schemes such as ENO and WENO, making them a
popular choice for solving hyperbolic PDEs.
19
5.5. TVD Condition and CFL Restriction
For the TVD property to hold, the time step ∆t must satisfy the Courant-Friedrichs-Lewy (CFL)
condition. The CFL condition for a typical advection problem is:
u∆t
≤1
∆x
where u is the velocity and ∆x is the grid spacing. The time step ∆t must be small enough to
ensure that information does not travel more than one grid point in a single time step, maintaining
the stability of the numerical scheme.
The TVD Runge-Kutta method provides a robust approach for solving time-dependent PDEs,
particularly those with sharp gradients and discontinuities. The key features of the method are:
• Time integration: High-order accurate time integration is achieved through multiple stages
of the Runge-Kutta process.
• TVD property: The method ensures that the total variation does not increase over time,
preventing oscillations.
• Combination with spatial schemes: The method is designed to work seamlessly with
spatial schemes like ENO and WENO, which also preserve the TVD property.
By combining TVD Runge-Kutta time integration with TVD spatial discretization, we obtain a
powerful tool for solving hyperbolic PDEs with sharp gradients and discontinuities.
Both TVD and WENO methods are designed to handle problems with steep gradients and dis-
continuities, but they differ in their approach, accuracy, and applications. Below is a detailed
comparison between these two methods.
20
6.1. 1. Basic Concept
• TVD (Total Variation Diminishing):
– The goal of TVD methods is to ensure that the total variation of the numerical solu-
tion does not increase over time. This property prevents spurious oscillations near dis-
continuities, which are common in hyperbolic partial differential equations (PDEs).
T V(ϕn+1 ) ≤ T V(ϕn )
– WENO schemes combine multiple stencils and assign weights to them based on
smoothness, allowing the scheme to adapt to regions of smoothness and steep gradi-
ents.
– The weights allow WENO to achieve high-order accuracy in smooth regions while
avoiding oscillations near steep gradients.
6.2. 2. Accuracy
• TVD:
– TVD methods are typically first- or second-order accurate in time. The focus is
on stability and avoiding oscillations rather than achieving high accuracy in smooth
regions.
21
– TVD schemes may sacrifice accuracy near smooth extrema because they are designed
to damp oscillations.
• WENO:
– WENO methods achieve higher-order accuracy, often third-, fifth-, or even higher-
order in space, making them more accurate in regions where the solution is smooth.
– WENO schemes are particularly good at preserving fine details in smooth regions
while controlling oscillations in regions with steep gradients or discontinuities.
• TVD:
– TVD methods use a single, monotonicity-preserving stencil. This ensures that the so-
lution remains stable but can reduce accuracy in smooth regions due to the limitation
on oscillations.
• WENO:
– WENO methods combine multiple stencils. The weights for each stencil are deter-
mined dynamically, based on the smoothness of the solution in each region.
– The smoothest stencil receives the largest weight, allowing WENO to achieve high
accuracy in smooth regions and avoid oscillations near discontinuities.
• TVD:
– The TVD condition ensures that no new oscillations are introduced, but this can lead
to excessive numerical diffusion, causing sharp features to be smeared (e.g., shock
waves).
• WENO:
22
– WENO schemes effectively control oscillations in a more adaptive way, allowing the
scheme to retain sharp features while reducing oscillations only near discontinuities.
• TVD:
– TVD methods are often simpler to implement and are widely used for problems
where stability and oscillation-free solutions are more important than high accuracy.
They are common in first- or second-order schemes for hyperbolic PDEs.
– TVD schemes are less flexible in achieving high-order accuracy in smooth regions
but are more stable.
• WENO:
– WENO methods are more complex and computationally expensive but are highly
favored in applications requiring both high-order accuracy and oscillation control,
such as computational fluid dynamics (CFD) simulations involving shock waves and
turbulence.
– WENO is suitable for a wide range of problems, from smooth regions to sharp dis-
continuities, due to its adaptability.
• TVD:
– TVD methods are generally computationally efficient because they use simpler, lower-
order methods and involve fewer calculations.
• WENO:
23
– WENO methods require more computational resources due to the use of multiple
stencils and the calculation of smoothness indicators and weights. This increased
cost is justified by the improved accuracy and control over oscillations.
24