# DG for incompressible NSE

**URL:** https://community.freefem.org/t/dg-for-incompressible-nse/3357
**Category:** General Discussion
**Created:** [June 27, 2024, 8:22am UTC](https://community.freefem.org/t/dg-for-incompressible-nse/3357 "2024-06-27T08:22:36Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Ravi](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/ravi/32/2468_2.png) [@Ravi](https://community.freefem.org/u/Ravi)
#### Post date: [June 27, 2024, 8:22am UTC](https://community.freefem.org/t/dg-for-incompressible-nse/3357/1 "2024-06-27T08:22:36Z")

</div>

![Screenshot (171)](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/c/ccbac65c9d3ab19ebc04e3c0a55a493f0ee5d799.png)  
In the above trilinear form we need to use the convect(.) operator for first term but for other terms how we can write them in freefem.

---

<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: [June 27, 2024, 3:30pm UTC](https://community.freefem.org/t/dg-for-incompressible-nse/3357/2 "2024-06-27T15:30:36Z")

</div>

You have an example of use of discontinuous Galerkin for the Laplace problem at  
[https://www.um.es/freefem/ff++/pmwiki.php?n=Main.DiscontinuousGalerkin](https://www.um.es/freefem/ff++/pmwiki.php?n=Main.DiscontinuousGalerkin)  
You will see the use of mean() and jump()

---

<div class="post-metadata">

### Author: ![noureddine](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@noureddine](https://community.freefem.org/u/noureddine)
#### Post date: [June 27, 2024, 9:39pm UTC](https://community.freefem.org/t/dg-for-incompressible-nse/3357/3 "2024-06-27T21:39:25Z")

</div>

Is it possible to modify the content of `mean()` and `jump()`? I would like to use a weighted DG method where the `mean` and `jump` functions are not defined with the standard definitions.

Thank you, N.

---

<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: [June 28, 2024, 10:20am UTC](https://community.freefem.org/t/dg-for-incompressible-nse/3357/4 "2024-06-28T10:20:13Z")

</div>

I would say that it is not possible to modify them, but maybe somebody has some ideas to do that (take a combination of mean and jump in order to get a weighted mean ?). It depends strongly on the precise formula you would like to implement…

---

<div class="post-metadata">

### Author: ![Ravi](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/ravi/32/2468_2.png) [@Ravi](https://community.freefem.org/u/Ravi)
#### Post date: [July 5, 2024, 2:39pm UTC](https://community.freefem.org/t/dg-for-incompressible-nse/3357/5 "2024-07-05T14:39:42Z")

</div>

Hello Sir, I am trying to apply DG for pressure correction scheme of navier stokes equation.  
In my code the bilinear form,:-  
problem U ([uu1,uu2], [v1,v2])= int2d(Th) (uu1_v1+uu2_ v2) + int2d(Th) (phi_dt_ (dx(v1) + dy(v2))) // velocity Correction  
-intalledges(Th) (dt \* mean(phi) \* (jump(v1)\*N.x+jump(v2)_N.y)/nTonEdge)  
-int2d(Th)(u1 \* v1+u2 \* v2)  
;  
isn’t working. Here phi is a known value, calculated from a previous bilinear form. I think the problem occurs when i am trying to integrate the product “mean(phi)_ ( jump(v1) \* N.x + jump(v2) \* N.y)”.  
So is there any other way of doing this integration or the problem is in somewhere else.  
Please enlighten me.

---

<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: [July 9, 2024, 1:03pm UTC](https://community.freefem.org/t/dg-for-incompressible-nse/3357/6 "2024-07-09T13:03:13Z")

</div>

What do you mean by “isn’t working”? Does it produce an error? Is it doing nothing? Is it doing something different than what you expect?  
It is difficult to answer without the code.
