# ApproxFun.jl Spectral method for 2D Helmholtz equation on unbounded domains

**URL:** <https://discourse.julialang.org/t/approxfun-jl-spectral-method-for-2d-helmholtz-equation-on-unbounded-domains/102255>\
**Category:** General Usage\
**Tags:** question, approxfun\
**Created:** [July 29, 2023, 9:07pm UTC](https://discourse.julialang.org/t/approxfun-jl-spectral-method-for-2d-helmholtz-equation-on-unbounded-domains/102255 "2023-07-29T21:07:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mleprovost](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mleprovost/32/7166_2.png) [@mleprovost](https://discourse.julialang.org/u/mleprovost)\
**Post date:** [July 29, 2023, 9:07pm UTC](https://discourse.julialang.org/t/approxfun-jl-spectral-method-for-2d-helmholtz-equation-on-unbounded-domains/102255/1 "2023-07-29T21:07:09Z")

</div>

Hello,

I would like to solve the following homogeneous Helmholtz problem with a spectral method on an 2D unbounded domain:  
(i \alpha - \Delta) \hat{\omega} = 0, \;\alpha \> 0 with a Dirichlet boundary condition for the velocity \hat{u} on a surface S\_b.

For 2D incompressible flows, we have the following relation between the velocity \hat{u} and the vorticity \hat{\omega}:  
We define the streamfunction \hat{\psi} by the Poisson equation \Delta \hat{\psi} = -\hat{\omega},  
then we obtain the velocity field by \hat{u} = \nabla \times( \hat{\psi} \boldsymbol{e}\_z)

The boundary conditions for the velocity field \hat{u} is \hat{u}(\boldsymbol{x}) = \hat{u}\_b(\boldsymbol{x}) for \boldsymbol{x} \in S\_b and ||\hat{u}|| \to 0 \text{ as } x \to \infty.

\hat{\omega}, \hat{\psi} are complex-valued scalar functions, while \hat{u} is a complex-valued vector function.

Is it something that can be done with ApproxFun.jl?

---

<div class="post-metadata">

**Author:** ![dlakelan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlakelan/32/8491_2.png) [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Post date:** [July 30, 2023, 12:34pm UTC](https://discourse.julialang.org/t/approxfun-jl-spectral-method-for-2d-helmholtz-equation-on-unbounded-domains/102255/2 "2023-07-30T12:34:07Z")

</div>

> [@mleprovost](#):
>
> Is it something that can be done with ApproxFun.jl?

I don’t follow the entirety of the problem, but if you want to represent the solution in terms of orthogonal polynomials you can do that yes. You’ll have to come up with a way to impose the required behavior. A typical method is collocation. Are you aware of John Boyds book

> **[Boyd.pdf](https://depts.washington.edu/ph506/Boyd.pdf)**

---

<div class="post-metadata">

**Author:** ![mleprovost](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mleprovost/32/7166_2.png) [@mleprovost](https://discourse.julialang.org/u/mleprovost)\
**Post date:** [August 21, 2023, 5:50pm UTC](https://discourse.julialang.org/t/approxfun-jl-spectral-method-for-2d-helmholtz-equation-on-unbounded-domains/102255/3 "2023-08-21T17:50:00Z")

</div>

Thank you for pointing to this reference.
