# Resolute Wave equation with freefem

**URL:** <https://community.freefem.org/t/resolute-wave-equation-with-freefem/1484>\
**Category:** General Discussion\
**Created:** [February 10, 2022, 1:07am UTC](https://community.freefem.org/t/resolute-wave-equation-with-freefem/1484 "2022-02-10T01:07:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ozeira91](https://avatars.discourse-cdn.com/v4/letter/o/898d66/32.png) [@Ozeira91](https://community.freefem.org/u/Ozeira91)\
**Post date:** [February 10, 2022, 1:07am UTC](https://community.freefem.org/t/resolute-wave-equation-with-freefem/1484/1 "2022-02-10T01:07:19Z")

</div>

Hello everyone,  
I want to analyse the pressure on freefem for a tube  
Closed on the left side and open on the right side.  
We have 4 boundary conditions for the pressure (look the picture )  
À Newman condition “dp/dn=0(on the 3 side 1,2,4 but on the side number 3 we don’t have a Newman boundary condition ) but we have that P(L,t)=0  
How we resolute that in freefem with the helmoltz equation can anyone help me please ?  
Thanks

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/1X/74cd29d377dd207079890a3fd3824b1f08704c51.jpeg)

---

<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:** [February 12, 2022, 2:14pm UTC](https://community.freefem.org/t/resolute-wave-equation-with-freefem/1484/2 "2022-02-12T14:14:43Z")

</div>

This is triaval if you know the Variational form of helmoltz equation

```auto
int[int] ll=[2,3,4,1]; // to get you label numbering
mesh Th=square(100,10,[x*10,y],label=ll);
fespace Vh(Th,P1);

Vh P,v; 
real k = 10; 
real k2 = k*k;
macro grad(u) [dx(u),dy(u)] // Def of the grad
func f=1; 	
solve Helmholtz(P,v) = int2d(Th) ( grad(P)'*grad(v) - k2*P*v)- int2d(Th)(f*v) + on(3,P=0); // 0 on Gamma 3
plot(P,wait=1);

```

This is a stationary cas to make time depend see [https://www.um.es/freefem/ff++/pmwiki.php?n=Main.WaveEquation](https://www.um.es/freefem/ff++/pmwiki.php?n=Main.WaveEquation) ,  
[Wifi Propagation](https://doc.freefem.org/tutorials/wifiPropagation.html#physics) for example or  
[Acoustics](https://doc.freefem.org/tutorials/acoustics.html)

---

<div class="post-metadata">

**Author:** ![Ozeira91](https://avatars.discourse-cdn.com/v4/letter/o/898d66/32.png) [@Ozeira91](https://community.freefem.org/u/Ozeira91)\
**Post date:** [February 12, 2022, 8:40pm UTC](https://community.freefem.org/t/resolute-wave-equation-with-freefem/1484/3 "2022-02-12T20:40:08Z")

</div>

Hello thanks for u respond ,  
But why we have f ? And why we have fixed f to 1?  
Thanks A lot !

---

<div class="post-metadata">

**Author:** ![Ozeira91](https://avatars.discourse-cdn.com/v4/letter/o/898d66/32.png) [@Ozeira91](https://community.freefem.org/u/Ozeira91)\
**Post date:** [February 14, 2022, 12:30am UTC](https://community.freefem.org/t/resolute-wave-equation-with-freefem/1484/4 "2022-02-14T00:30:22Z")

</div>

Hello mister ,  
Why we don’t need to put the dp/dn on the label 3 please ? Cause we don’t have a Newman bundaty condition on this label.  
Best regards

---

<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:** [February 17, 2022, 12:54pm UTC](https://community.freefem.org/t/resolute-wave-equation-with-freefem/1484/5 "2022-02-17T12:54:59Z")

</div>

Because it is Homogeneous Neuman Boundary condition this imply the term in variation form.
