# Second Order Temporal Discretization: Crank-Nicolson

**URL:** https://community.freefem.org/t/second-order-temporal-discretization-crank-nicolson/623
**Category:** General Discussion
**Created:** [October 23, 2020, 5:37pm UTC](https://community.freefem.org/t/second-order-temporal-discretization-crank-nicolson/623 "2020-10-23T17:37:19Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![D\_N\_Sarkar](https://avatars.discourse-cdn.com/v4/letter/d/0ea827/32.png) [@D\_N\_Sarkar](https://community.freefem.org/u/D_N_Sarkar)
#### Post date: [October 23, 2020, 5:37pm UTC](https://community.freefem.org/t/second-order-temporal-discretization-crank-nicolson/623/1 "2020-10-23T17:37:19Z")

</div>

I am trying to make an unsteady incompressible isothermal Navier-Stokes FreeFEM code for 2D lid-driven cavity flow for high Reynolds number (Re). The “convect” interpolation operator allows first order discretization. How can second order temporal discretization scheme Crank-Nicolson be implemented in FreeFEM?

---

<div class="post-metadata">

### Author: ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)
#### Post date: [October 23, 2020, 6:17pm UTC](https://community.freefem.org/t/second-order-temporal-discretization-crank-nicolson/623/2 "2020-10-23T18:17:29Z")

</div>

> **[FreeFem++ users | Main \>\> CN](https://www.um.es/freefem/ff++/pmwiki.php?n=Main.CN)**

---

<div class="post-metadata">

### Author: ![D\_N\_Sarkar](https://avatars.discourse-cdn.com/v4/letter/d/0ea827/32.png) [@D\_N\_Sarkar](https://community.freefem.org/u/D_N_Sarkar)
#### Post date: [October 23, 2020, 7:18pm UTC](https://community.freefem.org/t/second-order-temporal-discretization-crank-nicolson/623/3 "2020-10-23T19:18:23Z")

</div>

Thank you for sharing the above implementation. I had gone through this code earlier. The above code is for unsteady linear diffusion equation. I am looking for some code or FreeFEM implementation which involves convective terms also.

---

<div class="post-metadata">

### Author: ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)
#### Post date: [October 23, 2020, 7:58pm UTC](https://community.freefem.org/t/second-order-temporal-discretization-crank-nicolson/623/4 "2020-10-23T19:58:43Z")

</div>

You have to put them in the variational formulation.

---

<div class="post-metadata">

### Author: ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)
#### Post date: [October 24, 2020, 4:15pm UTC](https://community.freefem.org/t/second-order-temporal-discretization-crank-nicolson/623/5 "2020-10-24T16:15:22Z")

</div>

you can read this: [https://hal.inria.fr/inria-00072140](https://hal.inria.fr/inria-00072140)
