# Velocity field with phase

**URL:** https://bempp.discourse.group/t/velocity-field-with-phase/245
**Category:** Applications
**Created:** [12 March 2024 19:15 UTC](https://bempp.discourse.group/t/velocity-field-with-phase/245 "2024-03-12T19:15:09Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![soundintubes](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@soundintubes](https://bempp.discourse.group/u/soundintubes)
#### Post date: [12 March 2024 19:15 UTC](https://bempp.discourse.group/t/velocity-field-with-phase/245/1 "2024-03-12T19:15:09Z")

</div>

Hello, apologies in advance but I am an engineer not a mathematician(!)

I’m working on an acoustics problem of a cube with one face radiating.  
I based it on this tutorial: [https://nbviewer.org/github/mscroggs/bempp-acoustic-tutorials/blob/main/tutorials/5\_loudspeaker.ipynb](https://nbviewer.org/github/mscroggs/bempp-acoustic-tutorials/blob/main/tutorials/5_loudspeaker.ipynb)

It works quite nicely, but now I would like to try making the opposite face radiate with an amplitude and phase difference to look at the directivity patterns and generally play around with it.  
I have my tagged mesh set up with different IDs for the different faces.

How do I set up the two velocity fields in Bempp with different amplitude and phase?  
How do I set up the solver with the multiple spaces?

Thanks!

---

<div class="post-metadata">

### Author: ![soundintubes](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@soundintubes](https://bempp.discourse.group/u/soundintubes)
#### Post date: [14 March 2024 15:10 UTC](https://bempp.discourse.group/t/velocity-field-with-phase/245/2 "2024-03-14T15:10:39Z")

</div>

I worked this out.

The velocity field is defined in this function:

@bempp.api.complex\_callable  
def u\_total\_callable(x, n, domain\_index, result):  
if domain\_index == 2:  
result[0] = n[2];  
else:  
result[0] = 0

To add another field to another domain, I included an elif for that domain index/tag.  
The complex values for each field can be entered as required.

---

<div class="post-metadata">

### Author: ![Kevin](https://avatars.discourse-cdn.com/v4/letter/k/2acd7d/32.png) [@Kevin](https://bempp.discourse.group/u/Kevin)
#### Post date: [7 October 2024 05:23 UTC](https://bempp.discourse.group/t/velocity-field-with-phase/245/3 "2024-10-07T05:23:25Z")

</div>

I am an engineering student working on a similar problem. I have a few questions and It would be really helpful if we can connect. Could you please suggest a way for me to contact you?

---

<div class="post-metadata">

### Author: ![soundintubes](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@soundintubes](https://bempp.discourse.group/u/soundintubes)
#### Post date: [7 October 2024 10:24 UTC](https://bempp.discourse.group/t/velocity-field-with-phase/245/4 "2024-10-07T10:24:40Z")

</div>

Hi Kevin, post your questions here.  
I’m not an expert in the field, but there are experts on this forum.
