Dear Giovanni, 

I think you are mixing the concept of solution value *on the boundary* with the 
solution on the (exterior) domain.

You are right that if you take the gradient of  1/2(x+y+z) you don’t get what 
you expect, but that is not the gradient of the analytical solution. That is 
the value of the solution *on the boundary*. The analytical solution in R^3 for 
a sphere moving with velocity 1 in the x direction has the expression (in 
spherical coordinates):

phi(r,theta) = -1/2 U a^3/r^2 cos(theta)

outside the sphere, and zero inside the sphere.

On the boundary (i.e., r=a), such a function happens to be exactly x/2 = 1/2 a 
cos(theta).

The principle is that you add two more solutions of the same type, along y, and 
z, (i.e., the wind is not 1,0,0, but 1,1,1), and then the exact solution, *on 
the boundary only* happens to be (x+y+z)/2. 

The exact solution, however, is not constant along the radial direction, so the 
gradient of the function (x+y+z)/2 is not the gradient of the exact solution. 
You are still missing what the component of the gradient along the normal 
direction is.

You need to take the gradient of the analytical solution in the direction of 
the normal, and this is what you need to match to your boundary conditions.

Indeed, there is a mistake in the writing of the analytical solution (it is as 
I wrote it above, not as in the tutorial). I’m going to open a PR to fix this. 
But the fact that phi = 1/2 (x+y+z) on the boundary does *not* mean that its 
normal gradient is (1/2, 1/2, 1/2).

I will expand a bit in the documentation of the tutorial to better clarify this 
point. 

Best,
Luca.


> On 17 Feb 2025, at 20:28, Giovanni Maria Bonvini <gio.bo...@gmail.com> wrote:
> 
> Dear everyone,
> 
> I am currently adapting step-34 for a BEM project in my university. I am 
> having some issues because I believe that the proposed analytical solution 
> for the 3D problem is wrong.
> 
> The problem has the following Neumann boundary conditions:
> grad(phi)*n = v_inf*n
> 
> and the following analytical solution on the boundary:
> phi = 1/2*(x+y+z)
> 
> The issue with this is that if we compute the gradient of this function we 
> get:
> grad(phi)*n = 1/2*(1,1,1)*(x,y,z) = 1/2*(x+y+z)
> 
> BUT since the v_inf = (1,1,1) then v_inf*n = (x+y+z) != 1/2*(x+y+z)
> 
> (we are using n=(x,y,z) since the domain is a sphere of radius 1)
> 
> So there is this 1/2 that i disagree with. Nonetheless, the simulations 
> perfectly converge to the proposed exact solution (the one with the 1/2) and 
> I don't understand why since i believe its wrong.
> 
> Maybe some of you have already encountered this issue and you found an 
> answere.
> 
> Thank you very much, any help is appreciated!!
> 
> Giovanni Maria Bonvini
> 
> 
> -- 
> The deal.II project is located at http://www.dealii.org/
> For mailing list/forum options, see 
> https://groups.google.com/d/forum/dealii?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "deal.II User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to dealii+unsubscr...@googlegroups.com.
> To view this discussion visit 
> https://groups.google.com/d/msgid/dealii/2c963891-aea4-4caa-b7a1-4f8b50898b49n%40googlegroups.com.

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/dealii/107B578C-9286-4108-942F-64B0F5CC3D17%40gmail.com.

Reply via email to