# I am facing a problem to handel non-linearity in FreeFem++

**URL:** <https://community.freefem.org/t/i-am-facing-a-problem-to-handel-non-linearity-in-freefem/3654>\
**Category:** General Discussion\
**Created:** [December 19, 2024, 4:30pm UTC](https://community.freefem.org/t/i-am-facing-a-problem-to-handel-non-linearity-in-freefem/3654 "2024-12-19T16:30:48Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Monirul25](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/monirul25/32/3287_2.png) [@Monirul25](https://community.freefem.org/u/Monirul25)\
**Post date:** [December 19, 2024, 4:30pm UTC](https://community.freefem.org/t/i-am-facing-a-problem-to-handel-non-linearity-in-freefem/3654/1 "2024-12-19T16:30:48Z")

</div>

Hello all expert,  
I am trying to solve Navier-stokes equation using Backward Euler scheme. I am facing problem with the convection term.

Here, is the weak formulation

 ![ns](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/4/47ce305a143ae76d7be2ea0b3e65b370807a3acd.png)

 ![Backward-Euler](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/e/e527d5b16ff31cc41ff142530dba437be2c4e26c.png)

Here, F(u,p) has u koronecker u which will given by the following figure  
**IN 2D:**  
 ![Kr](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/d/d77500e1142a5bd809e254260b45c11605aa39ce.png)

**Here, are the details formulations:**

 ![nsone](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/1/1bada65981cf711253f3ee25e4f8eef08357f729.png)  
 ![nstwo](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/2/2019fe2fb864db28b97283a7b99bcbf85ad43575.png)  
 ![nsthree](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/d/d1dc88dd6fe961507ae7c58d593fcf2ca5083a62.png)

Here, in two question marks terms i am facing issue to write in FreeFem++ as it has non-linearities.

 ![nsfour](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/b/b37f1a6ba49a5f5d81eca442d2e789ac21ea4479.png)

Can you pls help me to write this two terms properly??.

**But there will be four terms that are product of unkowns which will be not solvable by FreeFem++**. Is there an way to solve this problem easily??. I need a minimal example to solve this. I will be very grateful if i get some idea to solve this.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![RdMl](https://avatars.discourse-cdn.com/v4/letter/r/a88e57/32.png) [@RdMl](https://community.freefem.org/u/RdMl)\
**Post date:** [December 20, 2024, 2:04pm UTC](https://community.freefem.org/t/i-am-facing-a-problem-to-handel-non-linearity-in-freefem/3654/2 "2024-12-20T14:04:39Z")

</div>

Bonjour,

Des exemples de résolution de NS avec FF++ sont disponibles  
dans la documentation et aussi, et surtout, dans les exemples que FH donnent  
dans ses cours. les plus récents sont ceux des FF Days de décembre.  
On peut les trouver en suivant le lien  
[https://github.com/FreeFem/FreeFem-days/raw/master/2024/pdf/FH-ffday24.zip](https://github.com/FreeFem/FreeFem-days/raw/master/2024/pdf/FH-ffday24.zip)

Bon courage  
et merci.

---

<div class="post-metadata">

**Author:** ![Monirul25](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/monirul25/32/3287_2.png) [@Monirul25](https://community.freefem.org/u/Monirul25)\
**Post date:** [December 20, 2024, 2:24pm UTC](https://community.freefem.org/t/i-am-facing-a-problem-to-handel-non-linearity-in-freefem/3654/4 "2024-12-20T14:24:54Z")

</div>

Thank you Sir. I will see.

---

<div class="post-metadata">

**Author:** ![RdMl](https://avatars.discourse-cdn.com/v4/letter/r/a88e57/32.png) [@RdMl](https://community.freefem.org/u/RdMl)\
**Post date:** [December 20, 2024, 2:54pm UTC](https://community.freefem.org/t/i-am-facing-a-problem-to-handel-non-linearity-in-freefem/3654/5 "2024-12-20T14:54:41Z")

</div>

Je vous en prie,

de plus,  
si vous avez le temps jeter un coup d’oeil au fichier

${HOMEFF\_INSTALL}/share/FreeFEM/4.14//examples/examples/NSNewton.edp

Il s’agit d’une méthode de Newton pour la non linéarité combinée avec une méthode de continuation sur la viscosité. Un exemple inspirant.

Je vous remercie.

---

<div class="post-metadata">

**Author:** ![Monirul25](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/monirul25/32/3287_2.png) [@Monirul25](https://community.freefem.org/u/Monirul25)\
**Post date:** [December 20, 2024, 3:28pm UTC](https://community.freefem.org/t/i-am-facing-a-problem-to-handel-non-linearity-in-freefem/3654/6 "2024-12-20T15:28:39Z")

</div>

Okay sir. But your file is not opening sir.

---

<div class="post-metadata">

**Author:** ![RdMl](https://avatars.discourse-cdn.com/v4/letter/r/a88e57/32.png) [@RdMl](https://community.freefem.org/u/RdMl)\
**Post date:** [December 20, 2024, 3:35pm UTC](https://community.freefem.org/t/i-am-facing-a-problem-to-handel-non-linearity-in-freefem/3654/7 "2024-12-20T15:35:55Z")

</div>

This file (NS by Newton with continuation) is available in your local installation of FF++.  
My previous reply do not contain any link to a file. Just the name of the file that can helps you.

---

<div class="post-metadata">

**Author:** ![Monirul25](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/monirul25/32/3287_2.png) [@Monirul25](https://community.freefem.org/u/Monirul25)\
**Post date:** [December 20, 2024, 3:38pm UTC](https://community.freefem.org/t/i-am-facing-a-problem-to-handel-non-linearity-in-freefem/3654/8 "2024-12-20T15:38:25Z")

</div>

Okay sir. Thank you.

---

<div class="post-metadata">

**Author:** ![Monirul25](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/monirul25/32/3287_2.png) [@Monirul25](https://community.freefem.org/u/Monirul25)\
**Post date:** [December 20, 2024, 3:55pm UTC](https://community.freefem.org/t/i-am-facing-a-problem-to-handel-non-linearity-in-freefem/3654/9 "2024-12-20T15:55:57Z")

</div>

Your Pdf is good sir. I have seen. But, i need more. Actually, i am trying to compute the formulation that i have shared in the images. I am facing problem to write the term u koronecker u.

I **am thinking that u koronecker u becomes u^{n-1} koronecker u^{n} when i will apply fully-discrete backward-euler. But i don’t know am i correct or not. Also, u^{n-1} is known .**
