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

Inlet velocity boundary conditions and pressure-poisson equation

Register Blogs Community New Posts Updated Threads Search

Like Tree11Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 17, 2018, 13:53
Default
  #21
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,773
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
This condition generates a du/dx term that must be balanced by the dv/dy in the continuity. You will see a slight deviation of the streamlines, depending on the Reynolds number. This is typical for a spatially developping boundary layer
But I suggested to prescribe the Poiseuille velocity everywhere to see if it is mantained. In such a case no deviation at the corner must appear
selig5576 likes this.

Last edited by FMDenaro; April 17, 2018 at 16:07.
FMDenaro is offline   Reply With Quote

Old   April 17, 2018, 14:41
Default Poiseuille flow
  #22
Senior Member
 
Selig
Join Date: Jul 2016
Posts: 213
Rep Power: 10
selig5576 is on a distinguished road
Just to make sure I understand you. When you say "prescribe the Poiseuille velocity everywhere" you mean as the inlet BC (as opposed to an initial condition.) The profile I'm working with is

u_{1,j} = (2.0/3.0)*(1.0 - (y_{1,j}/4.0)^{2}),
4.0 is the width of my channel.
selig5576 is offline   Reply With Quote

Old   April 17, 2018, 14:43
Default
  #23
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,773
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by selig5576 View Post
Just to make sure I understand you. When you say "prescribe the Poiseuille velocity everywhere" you mean as the inlet BC (as opposed to an initial condition.) The profile I'm working with is

u_{1,j} = (2.0/3.0)*(1.0 - (y_{1,j}/4.0)^{2}),
4.0 is the width of my channel.

yes a parabolic profile, the constant of the parabola depends on the flow rate...
selig5576 likes this.
FMDenaro is offline   Reply With Quote

Old   April 17, 2018, 15:10
Default Poiseuille flow
  #24
Senior Member
 
Selig
Join Date: Jul 2016
Posts: 213
Rep Power: 10
selig5576 is on a distinguished road
After testing my solver with a Poiseuille profile my pressure profile still looks incorrect. To me, this points to an issue at the bottom left corner and top left corner BC for pressure, yet I don't see anything incorrect about the way I'm setting the BC.

R_{2,ny-1} = \left(\frac{uf^{*}_{2,ny-1} - u_{1,ny-1}^{n+1}}{\Delta x} - \frac{v^{n+1}_{2,ny} - vf^{*}_{2,ny-2}}{\Delta y}\right)
P_{2,ny-1} = (1-\omega)P_{2,ny-1} + \frac{\omega}{\frac{1}{dx^{2}} + \frac{1}{dy^{2}}}\left(\frac{1}{dx^{2}} P_{3,ny-1} + \frac{1}{dy^{2}} P_{2,ny-2}\right)

Code:
!Top left corner
R(2,ny-1) = (rho/dt)*(inv_dx*(ufs(2,ny-1) - un(1,ny-1)) + inv_dy*(vn(2,ny) - vfs(2,ny-2)))
P(2,ny-1) = (1.0-omega)*P(2,ny-1) + omega/(inv_dxx + inv_dyy)*(inv_dxx*P(3,ny-1) + inv_dyy*P(2,ny-2) - R(2,ny-1))
Code:
!Bottom left corner
R(2,2) = (rho/dt)*(inv_dx*(ufs(2,2) - un(1,2)) + inv_dy*(vfs(2,2) - vn(2,1)))
P(2,2) = (1.0-omega)*P(2,2) + omega/(inv_dxx + inv_dyy)*(inv_dxx*P(3,2) + inv_dyy*P(2,3) - R(2,2))
Note: [MATH]uf,vf[/MATH} refer to the cell faces which I use simple arithmetic averaging.

EDIT 1: At step 550 the velocity profile seems to look better.
Attached Images
File Type: png PoiseuillePresStep35.png (9.0 KB, 4 views)
File Type: png PoiseuilleVelstep35.png (10.6 KB, 5 views)
File Type: png PoiseuilleVelStep550.png (15.8 KB, 7 views)
selig5576 is offline   Reply With Quote

Old   April 17, 2018, 15:34
Default
  #25
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,773
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by selig5576 View Post
After testing my solver with a Poiseuille profile my pressure profile still looks incorrect. To me, this points to an issue at the bottom left corner and top left corner BC for pressure, yet I don't see anything incorrect about the way I'm setting the BC.

R_{2,ny-1} = \left(\frac{uf^{*}_{2,ny-1} - u_{1,ny-1}^{n+1}}{\Delta x} - \frac{v^{n+1}_{2,ny} - vf^{*}_{2,ny-2}}{\Delta y}\right)
P_{2,ny-1} = (1-\omega)P_{2,ny-1} + \frac{\omega}{\frac{1}{dx^{2}} + \frac{1}{dy^{2}}}\left(\frac{1}{dx^{2}} P_{3,ny-1} + \frac{1}{dy^{2}} P_{2,ny-2}\right)

Code:
!Top left corner
R(2,ny-1) = (rho/dt)*(inv_dx*(ufs(2,ny-1) - un(1,ny-1)) + inv_dy*(vn(2,ny) - vfs(2,ny-2)))
P(2,ny-1) = (1.0-omega)*P(2,ny-1) + omega/(inv_dxx + inv_dyy)*(inv_dxx*P(3,ny-1) + inv_dyy*P(2,ny-2) - R(2,ny-1))
Code:
!Bottom left corner
R(2,2) = (rho/dt)*(inv_dx*(ufs(2,2) - un(1,2)) + inv_dy*(vfs(2,2) - vn(2,1)))
P(2,2) = (1.0-omega)*P(2,2) + omega/(inv_dxx + inv_dyy)*(inv_dxx*P(3,2) + inv_dyy*P(2,3) - R(2,2))
Note: [MATH]uf,vf[/MATH} refer to the cell faces which I use simple arithmetic averaging.

EDIT 1: At step 550 the velocity profile seems to look better.


The solution appears still like the inlet profile you prescribed is not the correct parabolic solution.
FMDenaro is offline   Reply With Quote

Old   April 18, 2018, 15:21
Default Poiseuille flow
  #26
Senior Member
 
Selig
Join Date: Jul 2016
Posts: 213
Rep Power: 10
selig5576 is on a distinguished road
Disregard what the 2/3 I wrote. I am doing u_{1,j} = \dot{m} (1 - (y/L_{x})^{2}. With that said I am still getting the two "dots" for pressure. In terms of plotting the profile I am in fact getting a parabolic profile.One screenshot is after 150 time steps and the second image is after 22k time steps, in which it converged to a steady state.
Attached Images
File Type: png Channel.png (10.8 KB, 1 views)
File Type: png ChannelTFinal.png (29.5 KB, 7 views)
selig5576 is offline   Reply With Quote

Old   April 18, 2018, 15:33
Default
  #27
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,773
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by selig5576 View Post
Disregard what the 2/3 I wrote. I am doing u_{1,j} = \dot{m} (1 - (y/L_{x})^{2}. With that said I am still getting the two "dots" for pressure. In terms of plotting the profile I am in fact getting a parabolic profile.One screenshot is after 150 time steps and the second image is after 22k time steps, in which it converged to a steady state.
As you see, the inlet parabolic profile is strongly modified in the interior. If you prescribe the exact solution that would not happen, the inlet profile repeats itself along x
FMDenaro is offline   Reply With Quote

Old   April 18, 2018, 15:38
Default Poiseuille flow
  #28
Senior Member
 
Selig
Join Date: Jul 2016
Posts: 213
Rep Power: 10
selig5576 is on a distinguished road
Maybe I am not understanding you, but are you saying I should not be prescribing the profile I gave in the previous post, but rather the analytical solution to the plane Poiseuille problem?
selig5576 is offline   Reply With Quote

Old   April 18, 2018, 15:41
Default
  #29
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,773
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by selig5576 View Post
Maybe I am not understanding you, but are you saying I should not be prescribing the profile I gave in the previous post, but rather the analytical solution to the plane Poiseuille problem?

yes, you have to check if your code accept the exact solution without changing
FMDenaro is offline   Reply With Quote

Old   April 19, 2018, 11:58
Default Plane Poiseuille flow
  #30
Senior Member
 
Selig
Join Date: Jul 2016
Posts: 213
Rep Power: 10
selig5576 is on a distinguished road
So I'm using the analytical solution to plane Poiseuille flow u_{1,j} = \frac{1}{2 \mu} \frac{dP}{dx} \left(y^{2} - h^2\right), but my solution instantly diverges due to the pressure gradient in x.
selig5576 is offline   Reply With Quote

Old   April 19, 2018, 12:08
Default
  #31
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,773
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by selig5576 View Post
So I'm using the analytical solution to plane Poiseuille flow u_{1,j} = \frac{1}{2 \mu} \frac{dP}{dx} \left(y^{2} - h^2\right), but my solution instantly diverges due to the pressure gradient in x.
After one time step?? that is not a numerical instability but is due to a bug in the code...
FMDenaro is offline   Reply With Quote

Old   April 19, 2018, 15:18
Default Bug
  #32
Senior Member
 
Selig
Join Date: Jul 2016
Posts: 213
Rep Power: 10
selig5576 is on a distinguished road
When determining dp/dx I read I should use the difference between the inflow and outflow pressure, is that correct? Otherwise I do not think there is a bug in my BC routine.
selig5576 is offline   Reply With Quote

Old   April 19, 2018, 15:45
Default
  #33
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,773
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
The velocity in a channel of height H for y=(-H/2:+H/2) is

u(y) = -(6Q/H^3)*(y^2-H^2/4)

The parameter being Q=u_average*H.

If you are using non-dimensional values you can just make non-dimensional the previous law
selig5576 likes this.
FMDenaro is offline   Reply With Quote

Old   April 20, 2018, 12:13
Default Channel flow profile
  #34
Senior Member
 
Selig
Join Date: Jul 2016
Posts: 213
Rep Power: 10
selig5576 is on a distinguished road
Thank you for bite. It seems like my profile seems to be actually correct. So far, no dots in the vicinity of the inlet appear.
Attached Images
File Type: png VelocityProfilePoiseuilleStep150.png (15.1 KB, 5 views)
File Type: png PressureProfilePoiseuilleStep150.png (9.8 KB, 5 views)
File Type: png PressureProfileStep2000.png (7.9 KB, 8 views)
File Type: png VelocityStep2000.png (9.5 KB, 10 views)
selig5576 is offline   Reply With Quote

Old   April 20, 2018, 12:21
Default
  #35
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,773
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
The last figure seems a correct solution, what about the first one? Is it at the first time step and you set an inviscid initial condition?
FMDenaro is offline   Reply With Quote

Old   April 20, 2018, 12:23
Default Poiseuille flow
  #36
Senior Member
 
Selig
Join Date: Jul 2016
Posts: 213
Rep Power: 10
selig5576 is on a distinguished road
Sorry I did not caption them . The first one is only after 150 time steps, so its quite immature in the development of the flow.

EDIT: The pressure profiles seem to be consistent from what we would expect given the type of problem.
selig5576 is offline   Reply With Quote

Old   April 20, 2018, 12:24
Default
  #37
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,773
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by selig5576 View Post
Sorry I did not caption them . The first one is only after 150 time steps, so its quite immature in the development of the flow.

Have you tried to set the exact profile everywhere as initial condition? The code should not change the initial condition and your pressure solver should converge immediately
FMDenaro is offline   Reply With Quote

Old   April 20, 2018, 12:35
Default Channel
  #38
Senior Member
 
Selig
Join Date: Jul 2016
Posts: 213
Rep Power: 10
selig5576 is on a distinguished road
Yes, I have done that and it converges to the fully developed flow within 2-5 iterations.
selig5576 is offline   Reply With Quote

Old   April 20, 2018, 12:41
Default
  #39
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,773
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Ok, seems to be ok.
selig5576 likes this.
FMDenaro is offline   Reply With Quote

Old   April 24, 2018, 13:28
Default 3D Situation
  #40
Senior Member
 
Selig
Join Date: Jul 2016
Posts: 213
Rep Power: 10
selig5576 is on a distinguished road
Returning back to my 3D solver. Here is my situation: If I have no outflow boundary conditions and run a lid driven cavity problem, my code returns the correct solution. As soon as I implement outflow boundary conditions (even a 1 x 1 x sized domain with 32^3 points) my pressure solver diverges. Interesting thing I've noticed is if I remove the advection term, my pressure solver does not diverge. Since I had validated my advection scheme on the LDC, I do not believe my discretization is wrong. I think the criminal is my pressure solver. There are only 5 pressure BCs with outflows conditions. The the outlet in x at the normal and the 4 corner pressure BCs at the outlet.

Example:
R_{nx-1,2,2} = \frac{\rho}{dt}\left(\frac{vf^{*}_{nx-1,2,2} - v^{n+1}_{nx-1,2,2}}{dx} + \frac{wf^{*}_{nx-1,2,2} - w^{n+1}_{nx-1,2,1}}{dz}\right)
P_{nx-1,2,2} = (1-\omega)P_{nx-1,2,2} + \frac{\omega}{1/dy^2 + 1/dz^2}\left(\frac{1}{dy^{2}}P_{nx-1,3,2} + \frac{1}{dz^{2}}P_{nx-1,2,3} - R_{nx-1,2,2}\right)

I prescribe this at P(nx-1,ny-1,2),P(nx-1,2,nz-1),P(nx-1,ny-1,nz-1) as well.

Mathematically, I believe the outlet BC is causing continuity at the faces to be violated, thus causing my PPE to diverge. Though the role of advection in causing this is currently confusing me. This divergence of pressure happens at around 480 SOR iterations. I am also using a plug inlet.
selig5576 is offline   Reply With Quote

Reply


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
Wind turbine simulation Saturn CFX 58 July 3, 2020 01:13
Multiphase flow - incorrect velocity on inlet Mike_Tom CFX 6 September 29, 2016 01:27
Wrong flow in ratating domain problem Sanyo CFX 17 August 15, 2015 06:20
Question about heat transfer coefficient setting for CFX Anna Tian CFX 1 June 16, 2013 06:28
Error finding variable "THERMX" sunilpatil CFX 8 April 26, 2013 07:00


All times are GMT -4. The time now is 05:33.