Sorry if this question has been asked before, but I was wondering which method I should use to compute the following computation:
[tex]$$u^s_{\infty}(\hat{r}) = \dfrac{e^{\frac{\pi i}{4}}}{\sqrt{8\pi k}} \int_{\partial\Omega}u(x)\dfrac{\partial e^{-i\omega_0\hat{r}\cdot x}}{\partial n} - \dfrac{\partial u(x)}{\partial n}e^{-i\omega_0\hat{r}\cdot x},dS(x)$$[/tex]
I have my current file attached with my attempt in it, but I get a 0 as the result. Thanks in advance for any help!
https://ngsolve.org/media/kunena/attachments/1496/Forward Pass Code.txt
Attachment: ForwardPassCode.txt
Hi Emilio4d46,
BoundaryFromVolumeCF(u) does not give you the normal derivative of u. It is used for discontinuous functions to evaluate them at boundaries. Thus, your integrand always cancels out to 0.
With
n = specialcf.normal(2)
us_n = BoundaryFromVolumeCF(Grad(u_s)*n)
ecomp = exp(-1j*omega_0*(cos(r)*x + sin(r)*y))
ecomp_n = CoefficientFunction((ecomp.Diff(x),ecomp.Diff(y)))*n
I get non-zero values for your code. However, you have to be careful with normal derivatives at boundaries. By replacing BoundaryFromVolumeCF(Grad(u_s)*n) with Grad(u_s)*n I get different results, as the normal derivative has a jump over the boundary. So I’m not sure if the above code does 100% what you would like to have.
Best,
Michael
Thank you mneunteufel, that was a big help. The discrepancy between:
BoundaryFromVolumeCF(Grad(u_s)*n)
and
Grad(u_s)*n
Is confusing not to mention the sizable discrepancy between the first order approximation of the far field and the full integral.