Differences between revisions 35 and 36
 ⇤ ← Revision 35 as of 2012-10-19 16:21:28 → Size: 0 Editor: 46 Comment: ← Revision 36 as of 2013-01-16 23:25:48 → ⇥ Size: 2182 Editor: AndreasKloeckner Comment: Deletions are marked like this. Additions are marked like this. Line 1: Line 1: ## page was renamed from SciComp/Hedge/Exercises/ScalarAdvection## page was renamed from SciComp/HedgeExercises/ScalarAdvection= Scalar Advection Equation =<>== Motivation ==The advection equation as it is imposed in the non-conservative form <>does only allow constant speeds for the advection (e.g. <>. As this might be sufficient for many purposes, it might be necessary to define a more complex advection speed function in some cases. For this reasons the formulation of the equation has to be changed into the conservative form <>An example of the non-conservative form can be found in /examples/advection/advection.py.In the 2D case the advection speed is defined as <>, which is a constant advection to the right. == Imposing a space dependent advection ==The first step will be a space dependent advection function for the 2D case with <> which is a vortex. a. Define the advection function based on the discr.interpolate_volume_function(function) method. a. Build an operator by modifying: (use the allready existing AdvectionOperatorBase class in pde.py)  * the operator interface for the new advection function.   * the RHS to the conservative form.  * the BC's in order to provide a Dirichlet BC on the entire boundary. == Imposing a time dependent advection ==The second step will be a time and space dependent advection function for the 2D case with <>. a. Define the mentioned function. a. Provide necessary changes to the operator interface by using the TimeDependetGivenFunction class from data.py. (an example for the use of this function can be found in examples/wave/wave-min. a. Make sure to provide all necessary information to build the RHS. As the advection function now bases on data that changes every timestep it is important to provide them.

# Scalar Advection Equation

## Motivation

The advection equation as it is imposed in the non-conservative form

<<latex($u_{t} + v \nabla \cdot (u) = 0$)>>

does only allow constant speeds for the advection (e.g. <<latex($v = 1$)>>. As this might be sufficient for many purposes, it might be necessary to define a more complex advection speed function in some cases. For this reasons the formulation of the equation has to be changed into the conservative form

<<latex($u_{t} + \nabla \cdot (v u) = 0$)>>

An example of the non-conservative form can be found in /examples/advection/advection.py. In the 2D case the advection speed is defined as <<latex($v = \begin{array}{*{1}{c}} 2 \\ 0 \\ \end{array}$)>>, which is a constant advection to the right.

## Imposing a space dependent advection

The first step will be a space dependent advection function for the 2D case with <<latex($v = v(x,y) = \begin{array}{*{1}{c}} -y \\ x \\ \end{array}$)>> which is a vortex.

1. Define the advection function based on the discr.interpolate_volume_function(function) method.

2. Build an operator by modifying: (use the allready existing AdvectionOperatorBase class in pde.py)

• the operator interface for the new advection function.
• the RHS to the conservative form.
• the BC's in order to provide a Dirichlet BC on the entire boundary.

## Imposing a time dependent advection

The second step will be a time and space dependent advection function for the 2D case with <<latex($v = v(x,y,t) = \begin{array}{*{1}{c}} -y \\ x \\ \end{array} \cdot sin(\pi t)$)>>.

1. Define the mentioned function.
2. Provide necessary changes to the operator interface by using the TimeDependetGivenFunction class from data.py. (an example for the use of this function can be found in examples/wave/wave-min.

3. Make sure to provide all necessary information to build the RHS. As the advection function now bases on data that changes every timestep it is important to provide them.

Hedge/Exercises/ScalarAdvection (last edited 2013-01-16 23:25:48 by AndreasKloeckner)