# A question about Pure Convection solved by Discontinuous-Galerkin FEM

**URL:** <https://community.freefem.org/t/a-question-about-pure-convection-solved-by-discontinuous-galerkin-fem/4213>\
**Category:** General Discussion\
**Created:** [February 4, 2026, 7:06am UTC](https://community.freefem.org/t/a-question-about-pure-convection-solved-by-discontinuous-galerkin-fem/4213 "2026-02-04T07:06:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZZM](https://avatars.discourse-cdn.com/v4/letter/z/35a633/32.png) [@ZZM](https://community.freefem.org/u/ZZM)\
**Post date:** [February 4, 2026, 7:06am UTC](https://community.freefem.org/t/a-question-about-pure-convection-solved-by-discontinuous-galerkin-fem/4213/1 "2026-02-04T07:06:21Z")

</div>

The code in documentation is:

```auto
problem Adual(cc, w)
    = int2d(Th)(
          (cc/dt+(v1*dx(cc)+v2*dy(cc)))*w
    )
    + intalledges(Th)(
          (1-nTonEdge)*w*(al*abs(n)-n/2)*jump(cc)
    )
    - int2d(Th)(
          ccold*w/dt
    );

```

1 - nTonEdge = 0 where in the set of boundary edges

and = -1 where in the set of inner edges

So, the formulation should be

\sum\_{T \in T\_h} \int\_T \left( \frac{c^{n+1} - c^n}{\delta t} + u \cdot \nabla c\right) w + \sum\_{T \in T\_h} \int\_{\partial T \cap E} (-1)\left( \alpha | u \cdot n| - \frac{1}{2}u \cdot n \right)[c^{n+1}]w = 0,

where E is the set of inner edges. (E\_{\Gamma}^{-} is the set of boundary edges where u \cdot n \< 0 and in that case there is no such edges)

But when I read the artical to learn the so-called dual-P\_1^{DC} formulation  
(see [ERN2006]  
ERN, A. and GUERMOND, J. L. Discontinuous Galerkin methods for Friedrichs’ symmetric systems.I. General theory. SIAM J. Numer. Anal.)  
It shows:

 ![](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/d/deef6ebc5f8c6f30b01c45168df318753ec777ac.png)  
,  
 ![q2](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/8/8edd226b9caaa41a7d08c17795979bbfe78b4acc.png)  
and  
 ![q3](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/b/bfdd3b1c03846e5acfb067439aeebe91edc84f23.png)

so from (17) and (27) I got (ignore the term of E\_{\Gamma}^{-})

\sum\_{T \in T\_h} \int\_T \left( \frac{c^{n+1} - c^n}{\delta t} + u \cdot \nabla c\right) w + \sum\_{T \in T\_h} \int\_{\partial T \cap E} \left( S\_F - \frac{1}{2} \mathcal{D} \right)[c^{n+1}]w = 0,

I’m not sure where the mistake I make that caused the loss of the −1 corresponding to 1−nTonEdge. (And the program is correct)

---

<div class="post-metadata">

**Author:** ![fb77](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/fb77/32/3796_2.png) [@fb77](https://community.freefem.org/u/fb77)\
**Post date:** [February 4, 2026, 8:26pm UTC](https://community.freefem.org/t/a-question-about-pure-convection-solved-by-discontinuous-galerkin-fem/4213/2 "2026-02-04T20:26:53Z")

</div>

This is because in Ern, Guermond, the jump is taken as (internal)-(external), wherease in FreeFem it is the converse.
