CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

How many boundary conditions do we need for the pressure?

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree7Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 2, 2023, 21:43
Default
  #21
Member
 
Join Date: Apr 2021
Location: Finland
Posts: 41
Rep Power: 4
Winston Virtaus is on a distinguished road
So to elaborate more on the proper use of tangential components, does the fundamental issue restrict us to use tangential components from the solution during the momentum predictor step or at the Poisson equation step or perhaps in both?

I'm trying to figure out if and/or when i should be interpolating the tangential components from the interior of the solution in cell centered FVM.
Winston Virtaus is offline   Reply With Quote

Old   June 2, 2023, 22:45
Default
  #22
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,764
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by Winston Virtaus View Post
So to elaborate more on the proper use of tangential components, does the fundamental issue restrict us to use tangential components from the solution during the momentum predictor step or at the Poisson equation step or perhaps in both?

I'm trying to figure out if and/or when i should be interpolating the tangential components from the interior of the solution in cell centered FVM.
After the projection step you have the correction step where the pressure gradient is added to the intermediate velocity. That could be done also for the tangential component on the boundary and you could check the resulting error, it does not produce exactly the physical tangential velocity. The practice is simply to set the value of the tangential component to the correct physical value.
If the error propagates or not depends on the orthogonality of the decomposition. Generally, a numerical boundary layer is produced.

This is a brief note, a full paper is addressed in reference.
https://www.researchgate.net/publica...ressible_flows
FMDenaro is offline   Reply With Quote

Old   June 3, 2023, 18:48
Default
  #23
Member
 
Join Date: Apr 2021
Location: Finland
Posts: 41
Rep Power: 4
Winston Virtaus is on a distinguished road
Thanks, I'll check out the paper!
Winston Virtaus is offline   Reply With Quote

Old   June 5, 2023, 21:50
Default
  #24
Member
 
Join Date: Apr 2021
Location: Finland
Posts: 41
Rep Power: 4
Winston Virtaus is on a distinguished road
I had a look at that paper which explained many of the questions I had. The treatment of boundary conditions was a bit more nuanced than I expected.

Here's what's my current understanding of the method:
1. Compute the intermediate velocity field v* subject to the boundary conditions v* = v(n+1) +deltaT*gradP(n)
2. After solving equation for the intermediate velocity, the Poisson equation is solved with boundary conditions gradP=0 and at the boundary v*.n = v(n+1).n is set.
3. Velocities are subsequently corrected to be divergence free as v(n+1) = v* - deltaT*gradP(n+1)

So if exact physical velocity with nonzero normal and tangential components is used at the boundary, there is no guarantee that after corrector step 3 the tangential components are satisfied? Does this also imply that there is a possibility that no-slip conditions aren't satisfied in the tangential direction?
Winston Virtaus is offline   Reply With Quote

Old   June 5, 2023, 23:03
Default
  #25
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,764
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by Winston Virtaus View Post
I had a look at that paper which explained many of the questions I had. The treatment of boundary conditions was a bit more nuanced than I expected.

Here's what's my current understanding of the method:
1. Compute the intermediate velocity field v* subject to the boundary conditions v* = v(n+1) +deltaT*gradP(n)
2. After solving equation for the intermediate velocity, the Poisson equation is solved with boundary conditions gradP=0 and at the boundary v*.n = v(n+1).n is set.
3. Velocities are subsequently corrected to be divergence free as v(n+1) = v* - deltaT*gradP(n+1)

So if exact physical velocity with nonzero normal and tangential components is used at the boundary, there is no guarantee that after corrector step 3 the tangential components are satisfied? Does this also imply that there is a possibility that no-slip conditions aren't satisfied in the tangential direction?
That’s correctl, of course you do not use the computed tangential components that could be wrong but you set the physical one for the next time step.
FMDenaro is offline   Reply With Quote

Old   June 7, 2023, 21:12
Default
  #26
Member
 
Join Date: Apr 2021
Location: Finland
Posts: 41
Rep Power: 4
Winston Virtaus is on a distinguished road
I had some more time to think about the boundary conditions

If the time continuous idea of v* = v*(t) would be used in a method where pressure gradient is retained in the intermediate velocity equation, would the correct boundary conditions then be v* = v(n+1) for such a case?

Also wouldn't that mean that the pressure equation with v*.n = v(n+1).n and subsequent projection would still produce a divergence free solution?
Winston Virtaus is offline   Reply With Quote

Old   June 8, 2023, 02:06
Default
  #27
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,764
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by Winston Virtaus View Post
I had some more time to think about the boundary conditions

If the time continuous idea of v* = v*(t) would be used in a method where pressure gradient is retained in the intermediate velocity equation, would the correct boundary conditions then be v* = v(n+1) for such a case?

Also wouldn't that mean that the pressure equation with v*.n = v(n+1).n and subsequent projection would still produce a divergence free solution?
You can retain only the old pressure gradient but not the total integral in time of the pressure gradient. Therefore you have some terms to add in the BC for the intermediate velocity.

The Poisson pressure does not need the value of V* on the boundary.
FMDenaro is offline   Reply With Quote

Old   June 13, 2023, 21:14
Default
  #28
Member
 
Join Date: Apr 2021
Location: Finland
Posts: 41
Rep Power: 4
Winston Virtaus is on a distinguished road
Thanks for the info, I think I see the universality behind the Poisson equation now.

One side note, if div(V)=0 is enforced, would it also require that the exact physical boundary velocity field would fulfill an additional compatibility condition div(ω)=0, when ω = curl(V)?
Winston Virtaus is offline   Reply With Quote

Old   June 14, 2023, 03:46
Default
  #29
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,764
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by Winston Virtaus View Post
Thanks for the info, I think I see the universality behind the Poisson equation now.

One side note, if div(V)=0 is enforced, would it also require that the exact physical boundary velocity field would fulfill an additional compatibility condition div(ω)=0, when ω = curl(V)?
There is an issue because the vorticity cannot be specified in general as Dirichlet BC. But you can see in my paper how the vorticity can be introduced in the Hodge decomposition along with the potential vector function.
FMDenaro is offline   Reply With Quote

Old   June 15, 2023, 18:06
Default
  #30
New Member
 
Join Date: Jun 2023
Posts: 1
Rep Power: 0
fouadiboukhoulef is on a distinguished road
Hello! It's great to hear that you're starting your masters degree in CFD and exploring fluid flow simulations. Your question is not dumb at all, and it's important to seek clarification to deepen your understanding.

In the context of simulating the 2D incompressible Poiseuille flow in a channel, it is indeed true that the incompressible Navier-Stokes equations (INSE) are second order in velocity components (u, v), while they are first order in pressure (p). This distinction has implications for the boundary conditions that need to be specified.

The no-slip condition (Dirichlet condition) you mentioned on the top and bottom walls is appropriate since it ensures zero velocity at these solid walls, reflecting the physical behavior of the fluid. Similarly, the velocity inlet condition (Dirichlet condition) at the inlet defines the desired velocity profile for the Poiseuille flow.

Regarding the pressure boundary conditions, it is common to enforce a homogeneous Neumann condition (also known as a zero-gradient condition) at the outlet. This means that the pressure gradient in the flow direction is assumed to be zero, which is a reasonable assumption for fully developed flow. This condition allows the pressure to adjust naturally throughout the domain while preserving the overall pressure drop imposed by the velocity inlet condition.

As for the pressure boundary condition at the top and bottom walls, applying a homogeneous Neumann condition is a common approach. This condition assumes that the pressure gradients in the normal direction (y-coordinate in your case) are also zero, meaning there are no pressure variations along these walls. This assumption is often reasonable for channels with a sufficiently large aspect ratio, where the flow is primarily influenced by the velocity profile and not the pressure distribution.

You correctly noted that the pressure can be shifted by a constant (p --> p + p0) without affecting the velocity field, as the INSE are invariant under such constant pressure shifts. This is why only specifying boundary conditions for pressure on the bottom and left walls is mathematically sufficient to determine the solution. However, by also enforcing the homogeneous Neumann condition on the top and outlet boundaries, you provide additional information to the solver, which can help stabilize the pressure calculation and ensure better numerical behavior in the simulation.

Overall, the choice of pressure boundary conditions depends on the specific problem and its boundary characteristics. The approach you described, where the pressure boundary conditions are only specified on the bottom and left walls, can indeed be valid in certain cases. However, enforcing homogeneous Neumann conditions on the top and outlet boundaries is a common practice that can help achieve more stable and accurate results, especially in complex flow scenarios.

I hope this explanation clarifies the rationale behind the pressure boundary conditions in the OpenFOAM tutorial cases and provides you with a better understanding. Feel free to ask further questions if you need more information
fouadiboukhoulef is offline   Reply With Quote

Old   June 15, 2023, 18:20
Default
  #31
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,152
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Quote:
Originally Posted by fouadiboukhoulef View Post
Hello! It's great to hear that you're starting your masters degree in CFD and exploring fluid flow simulations. Your question is not dumb at all, and it's important to seek clarification to deepen your understanding.

In the context of simulating the 2D incompressible Poiseuille flow in a channel, it is indeed true that the incompressible Navier-Stokes equations (INSE) are second order in velocity components (u, v), while they are first order in pressure (p). This distinction has implications for the boundary conditions that need to be specified.

The no-slip condition (Dirichlet condition) you mentioned on the top and bottom walls is appropriate since it ensures zero velocity at these solid walls, reflecting the physical behavior of the fluid. Similarly, the velocity inlet condition (Dirichlet condition) at the inlet defines the desired velocity profile for the Poiseuille flow.

Regarding the pressure boundary conditions, it is common to enforce a homogeneous Neumann condition (also known as a zero-gradient condition) at the outlet. This means that the pressure gradient in the flow direction is assumed to be zero, which is a reasonable assumption for fully developed flow. This condition allows the pressure to adjust naturally throughout the domain while preserving the overall pressure drop imposed by the velocity inlet condition.

As for the pressure boundary condition at the top and bottom walls, applying a homogeneous Neumann condition is a common approach. This condition assumes that the pressure gradients in the normal direction (y-coordinate in your case) are also zero, meaning there are no pressure variations along these walls. This assumption is often reasonable for channels with a sufficiently large aspect ratio, where the flow is primarily influenced by the velocity profile and not the pressure distribution.

You correctly noted that the pressure can be shifted by a constant (p --> p + p0) without affecting the velocity field, as the INSE are invariant under such constant pressure shifts. This is why only specifying boundary conditions for pressure on the bottom and left walls is mathematically sufficient to determine the solution. However, by also enforcing the homogeneous Neumann condition on the top and outlet boundaries, you provide additional information to the solver, which can help stabilize the pressure calculation and ensure better numerical behavior in the simulation.

Overall, the choice of pressure boundary conditions depends on the specific problem and its boundary characteristics. The approach you described, where the pressure boundary conditions are only specified on the bottom and left walls, can indeed be valid in certain cases. However, enforcing homogeneous Neumann conditions on the top and outlet boundaries is a common practice that can help achieve more stable and accurate results, especially in complex flow scenarios.

I hope this explanation clarifies the rationale behind the pressure boundary conditions in the OpenFOAM tutorial cases and provides you with a better understanding. Feel free to ask further questions if you need more information
Just to be clear, this is pure non sense which could only be written by some AI.
sbaffini is offline   Reply With Quote

Old   June 15, 2023, 21:19
Default
  #32
Member
 
Join Date: Apr 2021
Location: Finland
Posts: 41
Rep Power: 4
Winston Virtaus is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
There is an issue because the vorticity cannot be specified in general as Dirichlet BC. But you can see in my paper how the vorticity can be introduced in the Hodge decomposition along with the potential vector function.

Thanks for the tip, I'll see what I can find. Non-primitive formulations can sometimes be a bit unintuitive at first.
Winston Virtaus is offline   Reply With Quote

Old   June 19, 2023, 22:32
Default
  #33
Member
 
Join Date: Apr 2021
Location: Finland
Posts: 41
Rep Power: 4
Winston Virtaus is on a distinguished road
If i understood the paper correctly, the vorticity can be solved explicitly from the intial value problem

d(ω)/dt = curl(a*)

where a* is the intermediate acceleration. As result, one ends up with the correct values of vorticity for time step n+1.

Is it then permissible to deduce the exact physical tangential velocities for time step n+1 from the now available vorticity and carry on with the solution strategy as described in earlier posts?
Winston Virtaus is offline   Reply With Quote

Old   June 20, 2023, 04:42
Default
  #34
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,764
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by Winston Virtaus View Post
If i understood the paper correctly, the vorticity can be solved explicitly from the intial value problem

d(ω)/dt = curl(a*)

where a* is the intermediate acceleration. As result, one ends up with the correct values of vorticity for time step n+1.

Is it then permissible to deduce the exact physical tangential velocities for time step n+1 from the now available vorticity and carry on with the solution strategy as described in earlier posts?



What is your final goal?



First, in order to be well posed the problem, the physical velocity BC.s must be known for any type of approach, they are not deduced from a formulation.


The problem appears because in the Hodge decomposition only one BC is required. Using the vorticity, you cannot prescribe the normal velocity component. That can be done only by prescribing the elliptic problem for the potential vector.

Note that the Hodge decomposition applies at any time but has never to do with a time evolution from tn to tn+1.

The initial condition at t0 allows to do one step for the vorticity but then you have to approximate the vorticity at the walls.


Maybe I can help you more if you give more details about the numerical method you want to implement.
FMDenaro is offline   Reply With Quote

Old   June 20, 2023, 20:59
Default
  #35
Member
 
Join Date: Apr 2021
Location: Finland
Posts: 41
Rep Power: 4
Winston Virtaus is on a distinguished road
My idea was to get good estimates for the tangential velocity components at outlet boundaries and evolve these through the time somehow using d(ω)/dt = curl(a*). There is usually very little information available beforehand to what these tangential velocity components should actually be at flow outlets. Tangential velocity components at inlets and walls have usually been well known beforehand.

However, I think I had mixed some key concepts between the different decompositions and their limitations.

So am I safe to assume that if I'm using the decomposition

v = v*-deltaT*gradP

with gradP=0 and v*.n = v.n on the boundary at Poisson step, that the only correct way to get a proper decomposition would be to set v to have zero tangential velocity components at boundaries? Therefore making the search for tangential velocities reduntant as they must be set to zero anyhow?

I did some small testing using the above decomposition but with nonzero tangential velocities and had the impression that vorticity didn't pass through the outlet boundary, like it did with the usual p=0 and grad(v).n = 0 conditions. That led me to suspect that I had improperly set my tangential velocity components at the outlet thus affecting the vorticity.
Winston Virtaus is offline   Reply With Quote

Old   June 21, 2023, 04:26
Default
  #36
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,764
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by Winston Virtaus View Post
My idea was to get good estimates for the tangential velocity components at outlet boundaries and evolve these through the time somehow using d(ω)/dt = curl(a*). There is usually very little information available beforehand to what these tangential velocity components should actually be at flow outlets. Tangential velocity components at inlets and walls have usually been well known beforehand.

However, I think I had mixed some key concepts between the different decompositions and their limitations.

So am I safe to assume that if I'm using the decomposition

v = v*-deltaT*gradP

with gradP=0 and v*.n = v.n on the boundary at Poisson step, that the only correct way to get a proper decomposition would be to set v to have zero tangential velocity components at boundaries? Therefore making the search for tangential velocities reduntant as they must be set to zero anyhow?

I did some small testing using the above decomposition but with nonzero tangential velocities and had the impression that vorticity didn't pass through the outlet boundary, like it did with the usual p=0 and grad(v).n = 0 conditions. That led me to suspect that I had improperly set my tangential velocity components at the outlet thus affecting the vorticity.



Be careful, the Hodge decomposition in this case does not prescribe anything about the tangential velocity component.

After having performed the decomposition with the normal velocity component, from a theoretical point of view you have to compute the tangential component



v.t = v*.t-deltaT*(gradP).t

on the all the boundary. Of course, no one will do that on the boundaries when you have a known physical value for the tangential velocity, for example on a wall. You set the known physical value and go to the next time step.
Have a look to page 59 here:


https://www.researchgate.net/publica...ary_conditions
FMDenaro is offline   Reply With Quote

Old   June 21, 2023, 04:48
Default
  #37
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,764
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
As far as the specific issue on the outlet, what normal condition you prescribed? Did you get convergence in the Poisson solver without problems?
FMDenaro is offline   Reply With Quote

Old   June 21, 2023, 21:36
Default
  #38
Member
 
Join Date: Apr 2021
Location: Finland
Posts: 41
Rep Power: 4
Winston Virtaus is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
Be careful, the Hodge decomposition in this case does not prescribe anything about the tangential velocity component.

After having performed the decomposition with the normal velocity component, from a theoretical point of view you have to compute the tangential component



v.t = v*.t-deltaT*(gradP).t

on the all the boundary. Of course, no one will do that on the boundaries when you have a known physical value for the tangential velocity, for example on a wall. You set the known physical value and go to the next time step.
Have a look to page 59 here:


https://www.researchgate.net/publica...ary_conditions
Thanks for the elaboration, I think I have a more complete understanding now. So in practice the tangential components are a byproduct of the projection method and these can be nonzero but are often discarded and physical ones are described instead.

I'll see if incrementing the tangential components using the method described in the paper has any effect.


Quote:
Originally Posted by FMDenaro View Post
As far as the specific issue on the outlet, what normal condition you prescribed? Did you get convergence in the Poisson solver without problems?
I used a zero normal gradient condition for the normal velocity component. If tangential components were determined using second order upwinding (e.g. V = V+distance*gradV) the results were slightly better than just using zero normal gradient for the tangential components.

The Poisson solver didn't have any noticeable problems.

Actually now that i think of it, the boundaries that seem to work properly have one thing in common, they are all steady. The outlet is the only unsteady one. I think i need to double check my solver.
FMDenaro likes this.
Winston Virtaus is offline   Reply With Quote

Old   July 4, 2023, 14:54
Default
  #39
Member
 
Join Date: Apr 2021
Location: Finland
Posts: 41
Rep Power: 4
Winston Virtaus is on a distinguished road
I finally had some success with the Poisson equation with Neumann conditions in a basic 2D backward-facing step case. The case converged nicely and appeared to be physically acceptable.

Turns out, my velocity boundary condition wasn't behaving correctly and it let some inflow at the outlet boundary resulting in vorticity.
I was manually modifying the outlet velocities to satisfy global continuity and did not properly handle the possible backflow situation. This resulted in small short circuiting of momentum.

My initial impression is that Neumann conditions result in lower div(V) values in general than with the Dirichlet condition case.

I need to see how well the method scales with respect to time step and test more in 3D when Im back in office after the summer break.

Thanks for the tips!
Winston Virtaus is offline   Reply With Quote

Old   July 4, 2023, 15:14
Default
  #40
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,764
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by Winston Virtaus View Post
I finally had some success with the Poisson equation with Neumann conditions in a basic 2D backward-facing step case. The case converged nicely and appeared to be physically acceptable.

Turns out, my velocity boundary condition wasn't behaving correctly and it let some inflow at the outlet boundary resulting in vorticity.
I was manually modifying the outlet velocities to satisfy global continuity and did not properly handle the possible backflow situation. This resulted in small short circuiting of momentum.

My initial impression is that Neumann conditions result in lower div(V) values in general than with the Dirichlet condition case.

I need to see how well the method scales with respect to time step and test more in 3D when Im back in office after the summer break.

Thanks for the tips!
I had no problem with Neumann conditions, tested both on analytical solutions and on the 3D backward facing step.
On outflow I adopted fully developed flow, that is zero normal derivative for the velocity. Consequently, at the outflow you have the Poisson equation only in a plane.
Winston Virtaus likes this.
FMDenaro is offline   Reply With Quote

Reply

Tags
pressure b.c

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
What are the best settings for a channel flow simulation? Ashkan Kashani CFX 3 October 13, 2022 21:36
Fail to converge when solving with a fabricated solution zizhou FLUENT 0 March 22, 2021 06:33
Basic Nozzle-Expander Design karmavatar CFX 20 March 20, 2016 08:44
Problem in setting Boundary Condition Madhatter92 CFX 12 January 12, 2016 04:39
Error finding variable "THERMX" sunilpatil CFX 8 April 26, 2013 07:00


All times are GMT -4. The time now is 18:35.