July 19, 2014

1D Nonlinear Convection

19.7.14 Posted by Florin No comments
1D Nonlinear convection equation is similar with the linear convection; the change is in that the wave is not moving with the constant speed of c=1, but with the speed u:
ut+uux=0


This makes the equation non-linear and more difficult to solve;
the differential equation is approximated in the following way:
un+1iuniΔt+uniuniuni1Δx=0

After separating the unknown
un+1ithe finite deference scheme is the following:
un+1i=uniuniΔtΔx(uniuni1)

This is implemented in Python; similar IC as in the step 1 apply.
The code is written as follows:
Python code for solving the 1D Nonlinear Convection
The solution after 400 iteration is the following:
Wave profile after 400 iterations
Plotting all 400 steps on the same graph we get the following:
Wave profile - all 400 iterations on the same plot
Comparing the solution with that from the linear convection, the following observations can be made:
- the wave has moved to the right, with a change in shape;
- in the same time, the height is decreased (similar to linear);
- increasing the total time will make the scheme unstable if there are not enough time-steps;
- that is if the time step is increased the problem loose resolution;
- as a good practice, the time step dt must be correlated with the element size, dx;
- if the size of element, dx is decreased, so should be the time-step;
- the time step should be smaller than the time needed for the wave to pass one grid cell;
- for this case, the max velocity is 2, therefore the time step should be less than half of the grid cell size;

- dt<dx/vmax.

The code for 1D Nonlinear Convection can be downloaded from GitHub, here.

In the next step I will be solving the 1D Diffusion component from the Navier Stokes equation.

If you have and questions, feel free to leave a comment below.

0 comments:

Post a Comment