# The boundary condition in FreeFem

**URL:** <https://community.freefem.org/t/the-boundary-condition-in-freefem/3932>\
**Category:** General Discussion\
**Created:** [May 23, 2025, 11:57am UTC](https://community.freefem.org/t/the-boundary-condition-in-freefem/3932 "2025-05-23T11:57:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![weixj](https://avatars.discourse-cdn.com/v4/letter/w/4da419/32.png) [@weixj](https://community.freefem.org/u/weixj)\
**Post date:** [May 23, 2025, 11:57am UTC](https://community.freefem.org/t/the-boundary-condition-in-freefem/3932/1 "2025-05-23T11:57:44Z")

</div>

Now, I need to solve the MHD system with the following condition  
 ![image](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/a/ae03c97071814cd8d462b46314c6637973fbf92b.png)  
But I don’t know how this boundary condition is represented in the code

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/9/9fb304d774d2d626e791b4dcc1a6588ec7fbe0c0.png)  
This is the equations

---

<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:** [May 23, 2025, 8:33pm UTC](https://community.freefem.org/t/the-boundary-condition-in-freefem/3932/2 "2025-05-23T20:33:43Z")

</div>

You can look at

> [@The boundary condition of Hall-MHD model](https://community.freefem.org/t/the-boundary-condition-of-hall-mhd-model/3484):
>
> Hello, everyone. Now I’m using freefem++ to solve the incompressible hall-MHD equations, but I’ve encountered a problem regarding the boundary conditions of the magnetic field. \mu\nabla\times (\nabla\times\mathbf{B})+(\mathbf{u}^n\cdot\nabla)\mathbf{B}^n-(\mathbf{B}^n\cdot\nabla)\mathbf{u}^n+\eta\nabla\times\left((\nabla\times\mathbf{B}^n)\times\mathbf{B}^n\right)=\mathbf{g} \nabla\cdot\mathbf{B}=0 Before solving, assume that the velocity field \mathbf{u}^n,\mathbf{B}^n is already known (I …
