CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Main CFD Forum (
-   -   recover solution from dual grid (

jamesproctor July 30, 2010 15:31

recover solution from dual grid
Hi all,
I'm new to solving pdes. I coded up a finite volume scheme for advection on a dual grid, and I'm seeing some weird behavior. I'll recap my scheme (seems pretty standard), but my real question is on recovering the solution.

So I start out with a triangular mesh, which I then break up into a barycentric dual grid. I'll call the function I wish to represent u(x,y,t), and so initially I set the cell value w for the volume V of the dual equal to the average value of the initial condition
w_i^{0} = \frac{1}{\left|V_i\right|} \int_{V_i} u(x,y,0) dxdy

Then my simplified update is (f is velocity field, n_j is normal from edge E_ij between cell i and cell j, alpha is upwind parameter)
w_i^{\prime} = -\frac{1}{\left|V_i\right|} \sum\limits_{j\in \mbox{neighbors}_i} \left|E_{ij}\right| \left(n_j \cdot f\right) \left(\alpha_j w_j +(1-\alpha_j)w_i\right)

Anyways, when I plot the result, I see advection, and my little 2d gaussian moves, but it diffuses as well. But I think that's because I should be looking at the function value u(x,y,t), not w(i,t). Perhaps u(x,y,t) isn't diffusing?

So my question is how to recover u(x,y,t) from w(i,t). Using the barycentric dual scheme, the value of each dual cell is the average value over that cell, so maybe if I do something like
u(\cdot) = \left|V\right| \nabla w_i
but that seems iffy.

tldr; Is there a standard way of recovering the function value from a dual grid?

edit: in all the scenarios I've tried, the max(w) is decaying exponentially. This makes me think the scheme isn't working as it should. Do you see any problems there?

All times are GMT -4. The time now is 11:15.