0
Comment:

← Revision 36 as of 20130116 23:25:48 ⇥
2182

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 = <<TableOfContents>> == Motivation == The advection equation as it is imposed in the nonconservative 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 nonconservative 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. 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 <<latex($v = v(x,y,t) = \begin{array}{*{1}{c}} y \\ x \\ \end{array} \cdot sin(\pi t) $)>>. 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/wavemin`. 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
Contents
Motivation
The advection equation as it is imposed in the nonconservative 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 nonconservative 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.
Define the advection function based on the discr.interpolate_volume_function(function) method.
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) $)>>.
 Define the mentioned function.
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/wavemin.
 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.