### Demo Stokes Equation

216

views

1

Hello there,

I am not quite sure if this is the right place to post it.

But I have some questions concerning the Stokes-Demos, like in https://bitbucket.org/fenics-project/dolfin/src/593e93e79a866e56f5188abe9b89daa32f51cfad/python/demo/documented/stokes-iterative/demo_stokes-iterative.py.rst?at=master&fileviewer=file-view-default .

In the beginning the sign of the pressure is flipped, to get a symmetric system of equations, so the strong formulation yields:

\[\begin{align*}

-\nabla \cdot (\nabla u + pI) &=f,\\

\nabla \cdot u &= 0.

\end{align*}

\]

This would lead to the billinear part of the weak formulation \(a\):

\(a((u, p), (v, q)) = \int_{\Omega} \nabla u \cdot \nabla v + \nabla \cdot v\,p + \nabla \cdot u\,q \,\text{d} x\).

But in the example I posted, there is :

\(a((u, p), (v, q)) = \int_{\Omega} \nabla u \cdot \nabla v - \nabla \cdot v\,p + \nabla \cdot u\,q \,\text{d} x\),

which would be the correct weak formulation for the stokes-equation without flipping the sign of the pressure.

But later in the implementation there is the correct formulation:

https://fenicsproject.org/olddocs/dolfin/2016.2.0/python/demo/documented/stokes-iterative/python/documentation.html

Secondly, isn't it neccessary to flipp the sign of the pressure after the simulation is done to get the real physical one?

Than, what are the boundaries \(\Gamma_D\) and \(\Gamma_N\)? In all stoke demos there is only a blanked line in the defintion.

Also, the linear part of the weak formulation is

\(L((v,q))=\int_\Omega f\cdot v \, \text{d}x + \int_{\delta \Omega_N}g\cdot v \text{d}s\)

and we considere the conditions:

\[\begin{align*}

f &= (0.0, 0.0) \\

g&= (0.0, 0.0)

\end{align*}

\]

Why is in the implementation only the first integral left?

I am not quite sure if this is the right place to post it.

But I have some questions concerning the Stokes-Demos, like in https://bitbucket.org/fenics-project/dolfin/src/593e93e79a866e56f5188abe9b89daa32f51cfad/python/demo/documented/stokes-iterative/demo_stokes-iterative.py.rst?at=master&fileviewer=file-view-default .

In the beginning the sign of the pressure is flipped, to get a symmetric system of equations, so the strong formulation yields:

\[\begin{align*}

-\nabla \cdot (\nabla u + pI) &=f,\\

\nabla \cdot u &= 0.

\end{align*}

\]

This would lead to the billinear part of the weak formulation \(a\):

\(a((u, p), (v, q)) = \int_{\Omega} \nabla u \cdot \nabla v + \nabla \cdot v\,p + \nabla \cdot u\,q \,\text{d} x\).

But in the example I posted, there is :

\(a((u, p), (v, q)) = \int_{\Omega} \nabla u \cdot \nabla v - \nabla \cdot v\,p + \nabla \cdot u\,q \,\text{d} x\),

which would be the correct weak formulation for the stokes-equation without flipping the sign of the pressure.

But later in the implementation there is the correct formulation:

`a = inner(grad(u), grad(v))*dx + div(v)*p*dx + q*div(u)*dx`

In an earlier version of this demo the weak formulation is also right, see:https://fenicsproject.org/olddocs/dolfin/2016.2.0/python/demo/documented/stokes-iterative/python/documentation.html

Secondly, isn't it neccessary to flipp the sign of the pressure after the simulation is done to get the real physical one?

Than, what are the boundaries \(\Gamma_D\) and \(\Gamma_N\)? In all stoke demos there is only a blanked line in the defintion.

Also, the linear part of the weak formulation is

\(L((v,q))=\int_\Omega f\cdot v \, \text{d}x + \int_{\delta \Omega_N}g\cdot v \text{d}s\)

and we considere the conditions:

\[\begin{align*}

f &= (0.0, 0.0) \\

g&= (0.0, 0.0)

\end{align*}

\]

Why is in the implementation only the first integral left?

`L = inner(f, v)*dx`

Community: FEniCS Project

### 2 Answers

3

Why don't you play around with the demos to figure some of your questions?

> Why is in the implementation only the first integral left?

Because integral of zero is zero so the surface term is not needed. On the other hand zero volume term is there to represent a zero linear form part. There is currently really no way representing a zero form in a simpler way - it's kinda a technical limitation (filed somewhere on the UFL issue tracker).

An usual definition of pressure is converse, see https://en.wikipedia.org/wiki/Navier-Stokes_equations. The definition in the demo is flipped. But you can always recover the usual pressure by flipping the sign.

You can make the Stokes system always symmetric by flipping the sign of the pressure test function, regardless of the chosen pressure convention.
Contributions (in the form of pull requests) fixing the demos are welcome.

> Why is in the implementation only the first integral left?

Because integral of zero is zero so the surface term is not needed. On the other hand zero volume term is there to represent a zero linear form part. There is currently really no way representing a zero form in a simpler way - it's kinda a technical limitation (filed somewhere on the UFL issue tracker).

An usual definition of pressure is converse, see https://en.wikipedia.org/wiki/Navier-Stokes_equations. The definition in the demo is flipped. But you can always recover the usual pressure by flipping the sign.

You can make the Stokes system always symmetric by flipping the sign of the pressure test function, regardless of the chosen pressure convention.

written
5 months ago by
Jan Blechta

1

Pressure, oh sweet pressure.

Of course, the only meaning is of the gradient of pressure. But note carefully that this is an incompressible example. What you call pressure is just a Lagrange multiplier enforcing (through its gradient) condition \[ \nabla \cdot u = 0 \]

"Secondly, isn't it neccessary to flipp the sign of the pressure after the simulation is done to get the real physical one?"

What is the real physical one depends on your thermodynamic sign conventions... there is no such physical principle, that pressure cannot be negative etc... People interpret pressure through first law of thermodynamics, and if you agree with the current days sign convention then yes, incompressible limit has the pressure with flipped sign, such, that it stands for \[ -p I \] in the Cauchy stress tensor.

In the right hand side there is just trivial

What are the conditions on Dirichlet and Neumann boundaries is the matter of PDE, search in literature.

Of course, the only meaning is of the gradient of pressure. But note carefully that this is an incompressible example. What you call pressure is just a Lagrange multiplier enforcing (through its gradient) condition \[ \nabla \cdot u = 0 \]

"Secondly, isn't it neccessary to flipp the sign of the pressure after the simulation is done to get the real physical one?"

What is the real physical one depends on your thermodynamic sign conventions... there is no such physical principle, that pressure cannot be negative etc... People interpret pressure through first law of thermodynamics, and if you agree with the current days sign convention then yes, incompressible limit has the pressure with flipped sign, such, that it stands for \[ -p I \] in the Cauchy stress tensor.

In the right hand side there is just trivial

`f`

explicitly included, because FEniCS needs some (uni)linear form `L`

to be given. It is just a technical issue of supplying all-zero (uni)linear form to the `assemble_system`

method (due to my best knowledge). You can add there another zero in the form of `g`

...What are the conditions on Dirichlet and Neumann boundaries is the matter of PDE, search in literature.

Regarding the termodynamic pressure, the sign has a role, https://en.wikipedia.org/wiki/Pressure#Negative_pressures. Pressure in some kind of incompressible thermodynamic limit is a tricky question...

written
5 months ago by
Jan Blechta

I agree, incompressible limit is to be understood very intuitively...

On the other hand, thermodynamic sign of pressure is result of convention in first law of thermodynamics, i.e. if the work done by the surrounding on the system is positive or negative. That is all I meant. Let alone interpretation of pressure in statistical physics...

On the other hand, thermodynamic sign of pressure is result of convention in first law of thermodynamics, i.e. if the work done by the surrounding on the system is positive or negative. That is all I meant. Let alone interpretation of pressure in statistical physics...

written
5 months ago by
Michal Habera

1

Sure, I agree in principle. But defining pressure with the opposite sign would be silly similarly as defining velocity as \( -\frac{\mathrm{d}x}{\mathrm{d}t} \)

written
5 months ago by
Jan Blechta

Please login to add an answer/comment or follow this question.

>On the other hand zero volume term is there to represent a zero linear form part

Ah ok, that make sense.

Since I need the solution from the typical Stokes-Equation

\[\begin{align*}

\nabla(\nabla u - p I ) &= f\\

\nabla u &= 0

\end{align*}

\]

I will then have to flip the sign. I just found it irritating how the equations are formulated in the demos