improvements in Navier-Stokes example

Asked by Nico Schlömer

Hi all,

I started playing around with Dolfin's Navier--Stokes capabilities and used http://fenicsproject.org/documentation/dolfin/dev/python/demo/pde/navier-stokes/python/documentation.html to take off.

Unfortunately, starting with the given example code, it was quite hard to achieve. For example, I tried to model a box with no inflow or outflow, just the force of gravity acting. You'd expect no flow, but replacing the respective boundary conditions in the demo example and setting f=(0,-1) does give something. This is because the boundary conditions on the tentative velocity step and the pressure update don't correctly incorporate f.

Other than that, I noticed that one doesn't really need to solve an equation system for the final step u1: Just setting
u1 -= k * grad(p1) should suffice.

I would give that example a revision unless that is something you rather want to keep it the way it is.

--Nico

Question information

Language:
English Edit question
Status:
Answered
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Kent-Andre Mardal (kent-and) said :
#1

On 6 March 2013 00:30, Nico Schlömer
<email address hidden>wrote:

> New question #223502 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/223502
>
> Hi all,
>
> I started playing around with Dolfin's Navier--Stokes capabilities and
> used
> http://fenicsproject.org/documentation/dolfin/dev/python/demo/pde/navier-stokes/python/documentation.htmlto take off.
>
> Unfortunately, starting with the given example code, it was quite hard to
> achieve. For example, I tried to model a box with no inflow or outflow,
> just the force of gravity acting. You'd expect no flow, but replacing the
> respective boundary conditions in the demo example and setting f=(0,-1)
> does give something. This is because the boundary conditions on the
> tentative velocity step and the pressure update don't correctly incorporate
> f.
>

Agree that f should be included, this is a bug (although f is zero in the
example).

>
> Other than that, I noticed that one doesn't really need to solve an
> equation system for the final step u1: Just setting
> u1 -= k * grad(p1) should suffice.
>

The gradient will be discontinuous at nodal points. Therefore we solve a
linear system, ie. we project
the gradient onto the field of continuous functions.

>
> I would give that example a revision unless that is something you rather
> want to keep it the way it is.
>

Good!

Kent

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

Can you help with this problem?

Provide an answer of your own, or ask Nico Schlömer for more information if necessary.

To post a message you must log in.