Stokes flow under pressure gradient boundary conditions - an unexpected solution

74 views
Skip to first unread message

Oded Yaakobi

unread,
Oct 4, 2017, 11:20:13 AM10/4/17
to deal.II User Group

Hello,

 

I tried to solve a slightly modified version of step-22 and obtained strange results. The only difference in my case with respect to step-22 is the definition of the boundary conditions. In my case, no Dirichlet boundary conditions are applied on the velocity. Instead of that, a pressure boundary condition is applied such that If x =- 2 then p(x) = -2, and if x = 2 then x = 2.


I expected to get a solution showing a pressure gradient along the x-axis, and a velocity field with a non-positive x-component. However, for some reason, the solution is different. Attached are the resulting VTK files from running my code.


In terms of the implementation, here is the list of modifications in the attached step-22.cc file:

1)    The boundary_id was set to 1 on the faces where |x| = 2. The boundary_id of the rest of the faces is 0.

2)    The boundary conditions were applied on the pressure field and not ton he velocity field by using the appropriate component_mask.

3)    The function BoundaryValues::value was modified to the requested form.   

 

I commented the places where I changed the code and added the comment “Oded Yaakobi - October 4, 2017” to allow locating those places easily.

 

It would be great to know if someone has an idea what is wrong in my implementation.

 

Thanks,

Oded


solution-00.vtk
solution-01.vtk
solution-02.vtk
solution-03.vtk
solution-04.vtk
solution-05.vtk
step-22.cc

Wolfgang Bangerth

unread,
Oct 4, 2017, 11:39:08 AM10/4/17
to dea...@googlegroups.com

Oded,

> I tried to solve a slightly modified version of step-22 and obtained strange
> results. The only difference in my case with respect to step-22 is the
> definition of the boundary conditions. In my case, no Dirichlet boundary
> conditions are applied on the velocity. Instead of that, a pressure boundary
> condition is applied such that If x =- 2 then p(x) = -2, and if x = 2 then x = 2.
>
>
> I expected to get a solution showing a pressure gradient along the x-axis, and
> a velocity field with a non-positive x-component. However, for some reason,
> the solution is different. Attached are the resulting VTK files from running
> my code.
> [...]
> It would be great to know if someone has an idea what is wrong in my
> implementation.

You are asking too much of the people on this mailing list -- namely, to debug
your code. You will need to learn the skills to figure out what the issue is
yourself, because you will need to debug these problems many times over in
your career.

I will note that the Stokes equation does not allow prescribing a pressure. It
allows prescribing a boundary traction (the normal component of the stress). I
have no idea whether that's related to your problem, but it at least seems
like an issue.

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

Reply all
Reply to author
Forward
0 new messages