next up previous contents
Next: Conv_Step Up: Source Code Previous: Comp_F_Dr

advection.C

This code uses DGM to solve the convection equation.

For simplicity, we first consider an convection equation for a state vector v.

\(\frac{\partial v}{\partial t}+\frac{\partial F^{x}}{\partial x}+\frac{\partial F^{y}}{\partial y}+\frac{\partial F^{z}}{\partial z}\)

Where F(v) is a function of the state vector.

Using the discontinuous Galerkin formulation, each element is treated separately, corresponding to the following variational statement:

\(\frac{\partial (w,v)_{E_i}}{\partial t}=-(w,\frac{\partial F^{x}}{\partial x}+...
...{E_i}-(w,(\hat F^x-F^x)n_x+(\hat F^y-F^y)n_y+(\hat F^z-F^z)n_z)_{\partial E_i}\)

Computations on each element are performed separately, and the connection between elements is a result of the way boudnary conditions are applied. Here, boundary conditions are enforced via the flux F(v) that appears in equation above. Because this value is computed at the boundary between adjacent elements, it may be computed from the value of v given at either element. These two possible values are denoted here as vI(internal) and vE(external), and the boundary flux written $\hat F(v^I,v^E)$.Upwinding considerations dictate how this flux is computed(in Upwind_edge_flux_euler). For the case of a hyperbolic system of equations, an approximate Riemann solver would be used to compute a value of $\hat F$ based on vI and vE.

In this code,to solve the eqn above,first it calculates the upwinded fluxes at the Guass quadrature points on the element interfaces. Second,calculates the Euler flux terms at the element quadrature points. Third computes the divergence of the Euler fluxes.forth scales the upwinded fluxes with the edge Jacobian divided by the volume Jacobians and adds this to the divergence of the Euler fluxes. Finally, takes the inner product of the fluxes with the orthogonal basis.



 
next up previous contents
Next: Conv_Step Up: Source Code Previous: Comp_F_Dr
Guang Lin
2001-03-08