# Impose a gradient boundary condition

**URL:** https://community.freefem.org/t/impose-a-gradient-boundary-condition/2644
**Category:** General Discussion
**Created:** [August 5, 2023, 9:53pm UTC](https://community.freefem.org/t/impose-a-gradient-boundary-condition/2644 "2023-08-05T21:53:36Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Drazer](https://avatars.discourse-cdn.com/v4/letter/d/eada6e/32.png) [@Drazer](https://community.freefem.org/u/Drazer)
#### Post date: [August 5, 2023, 9:53pm UTC](https://community.freefem.org/t/impose-a-gradient-boundary-condition/2644/1 "2023-08-05T21:53:36Z")

</div>

Hello everyone,

Recently, I have been working on solving \Delta \phi = 0. Here, \phi is the potential of speed (so v = \nabla \phi) in a fluid, around a cylinder (so there is a z-invariance to the problem and it can be solved in 2D). Because I work on a visquous fluid, I would like the speed around the cylinder to be equal to zero, so \frac{\partial \phi}{\partial x} = \frac{\partial \phi}{\partial y} = 0. How could I do this, knowing that I solve this problem :

![image](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/c/c6de3471dd158977cec6e525e6d35d927452bb45.png)

The boundary conditions on the square borders are that the speed is e\_y, hence the int1d that appears in the Laplacian problem.  
Thanks in advance to anyone trying to help me.

---

<div class="post-metadata">

### Author: ![Drazer](https://avatars.discourse-cdn.com/v4/letter/d/eada6e/32.png) [@Drazer](https://community.freefem.org/u/Drazer)
#### Post date: [August 5, 2023, 9:59pm UTC](https://community.freefem.org/t/impose-a-gradient-boundary-condition/2644/2 "2023-08-05T21:59:25Z")

</div>

ps : Here you can see the solution \phi

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/4/48cd204de71323ab647a8e1e5875439ddb76ee81.png)

---

<div class="post-metadata">

### Author: ![Drazer](https://avatars.discourse-cdn.com/v4/letter/d/eada6e/32.png) [@Drazer](https://community.freefem.org/u/Drazer)
#### Post date: [August 5, 2023, 10:00pm UTC](https://community.freefem.org/t/impose-a-gradient-boundary-condition/2644/3 "2023-08-05T22:00:20Z")

</div>

and the field of speed

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/9/9a240bc5e3cb7f70c69513d9d4d81e745a61f033.png)

---

<div class="post-metadata">

### Author: ![cmd](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/cmd/32/67_2.png) [@cmd](https://community.freefem.org/u/cmd)
#### Post date: [August 5, 2023, 10:59pm UTC](https://community.freefem.org/t/impose-a-gradient-boundary-condition/2644/4 "2023-08-05T22:59:18Z")

</div>

Your equation is for potential flow of an inviscid fluid. You cannot enforce those constraints on inviscid flow.
