# Navier Stokes demo

I have a math question about the Navier-Stokes demo. It uses the Chorin projection method and in the second step, the new pressure is computed from the tentative velocity. The problem to be solved at this step is laplace p=(grad u*)/k_n. So, in the variational formulation I would expect something like

-<grad p, grad q>+integral over boundary from (q times normal derivative of p) = rhs

However, in the implementation, this "boundary integral" is missing. If the variational problem is satisfied for all q in the demo, than it implies a boundary condition \partial_n p=0 everywhere on the boundary. However, in addition to this, the line
[bc.apply(A2, b2) for bc in bcp] ...
seems to require also a dirichlet boundary condition at the inflow and outflow. Aren't here too many boundary conditions on p?

Thanks for an explanation and sorry if I misunderstood something. Peter

## Question information

Language:
English Edit question
Status:
Solved
For:
FEniCS Project Edit question
Assignee:
No assignee Edit question
Solved by:
Kent-Andre Mardal
Solved:
Last query:
 Revision history for this message Kent-Andre Mardal (kent-and) said on 2013-03-18: #1

On 17 March 2013 22:50, Peter Franek

> New question #224508 on FEniCS Project:
>
> I have a math question about the Navier-Stokes demo. It uses the Chorin
> projection method and in the second step, the new pressure is computed from
> the tentative velocity. The problem to be solved at this step is laplace
> p=(grad u*)/k_n. So, in the variational formulation I would expect
> something like
>
> -<grad p, grad q>+integral over boundary from (q times normal derivative
> of p) = rhs
>
> However, in the implementation, this "boundary integral" is missing. If
> the variational problem is satisfied for all q in the demo, than it implies
> a boundary condition \partial_n p=0 everywhere on the boundary. However, in
> addition to this, the line
> [bc.apply(A2, b2) for bc in bcp] ...
> seems to require also a dirichlet boundary condition at the inflow and
> outflow. Aren't here too many boundary conditions on p?
>
> Thanks for an explanation and sorry if I misunderstood something. Peter
>

The splitting scheme requires that you set boundary conditions everywhere
for both velocity
and pressure, in contrast to the Navier-Stokes equations themselves that
require one less condition.
For Neumann conditions, nu du/dn - pn = g , it is common to translate this
condition into
a Neumann condition for the velocity and a Dirichlet condition for the
pressure, which should add up to g.
Dirichlet conditions translates to Dirichlet for the velocity and Neumann
for the pressure.

Kent

>
> --
> You received this question notification because you are a member of
> FEniCS Team, which is an answer contact for FEniCS Project.
>

 Revision history for this message Peter Franek (peter-franek) said on 2013-03-18: #2

Hello, let me put my question more clearly. In the current implementation of the pressure-calculation step (A2, b2), the calculated pressure does, or does not satisfy a von Neuman condition "normal derivative of p is zero everywhere on the boundary"? Thanks a lot.

 Revision history for this message Kent-Andre Mardal (kent-and) said on 2013-03-18: #3

On 18 March 2013 16:11, Peter Franek

> Question #224508 on FEniCS Project changed:
>
>
> Peter Franek is still having a problem:
> Hello, let me put my question more clearly. In the current
> implementation of the pressure-calculation step (A2, b2), the calculated
> pressure does, or does not satisfy a von Neuman condition "normal
> derivative of p is zero everywhere on the boundary"? Thanks a lot.
>

Not where Dirichlet BC for the pressure is enforced. But here the test
function
q is zero at the boundary.

Kent

>
> --
> You received this question notification because you are a member of
> FEniCS Team, which is an answer contact for FEniCS Project.
>

 Revision history for this message Peter Franek (peter-franek) said on 2013-03-18: #4

Thanks Kent-Andre Mardal, that solved my question.