CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Periodic Boundary Condition (https://www.cfd-online.com/Forums/main/107569-periodic-boundary-condition.html)

C.C October 1, 2012 11:50

Periodic Boundary Condition
 
Hi all,
I have a problem... I want simulate a flow in a pipe considering 2D axissymetric geometry with periodic boundary condition, but the pressure across the pipe length have a strange behavior with negative values. If I consider the inlet velocity boundary condition and outlet pressure boundary condition, the pressure profile is correct, but I need an entrance region and with the periodic boundary condition I can reduce the length...
Please, someone can help me... What is wrong? Is the periodic boundary condition advisable for my problem?
Thanks

hnemati October 2, 2012 04:15

do you use pressure force in streamwise direction?

C.C October 2, 2012 05:47

I specified the mass flow rate and I want the value of pressure drop to compare with experimental data.

flotus1 October 2, 2012 05:48

Applying a periodic boundary condition in streamwise direction by simply copying the values from the outlet to the inlet results in the situation you observe.
Since there is a pressure drop along the channel, the pressure level gets lower every iteration. You could check this by running two simulations with different numbers of iterations.

hnemati October 2, 2012 05:59

Yes I know, but for priodic simulation the important part is dp which should be included in stramwise momentum equation to force the flow. for example for a channel this pressure force is :dpdx = 12./Re ,where Re is based on height of channel.

flotus1 October 2, 2012 06:08

So then what is the problem?
in an incompressible flow, you can compare the pressure drop (i.e. pressure derivative) to experimental data, independent of the pressure level.

Of course it would be more correct to rescale the pressure at the periodic interface, but the derivative remains unchanged by this procedure.

leflix October 3, 2012 05:17

Quote:

Originally Posted by C.C (Post 384394)
Is the periodic boundary condition advisable for my problem?
Thanks

Yes for sure, but I guess the problem is how you implement these periodic boundary conditions.
first you should apply Phy(NI)=Phy(1) and Phy(0)=Phy(NI-1)
(BC are on node 0 and NI)
Phy stands for u,v, P.
If your solver is explicit it is easy, if your solver is implicit then you have to
deal with this in your matrix.
After you have to include in the x momentum the pressure drop to maintain the flow. It is related to the mass flow rate and in the case of a pipe flow or a channel flow there is an analytical expression.

FMDenaro October 3, 2012 05:49

Quote:

Originally Posted by leflix (Post 384677)
Yes for sure, but I guess the problem is how you implement these periodic boundary conditions.
first you should apply Phy(NI)=Phy(1) and Phy(0)=Phy(NI-1)
(BC are on node 0 and NI)
Phy stands for u,v, P.
If your solver is explicit it is easy, if your solver is implicit then you have to
deal with this in your matrix.
After you have to include in the x momentum the pressure drop to maintain the flow. It is related to the mass flow rate and in the case of a pipe flow or a channel flow there is an analytical expression.

I agree, if you use the non-dimensional form of the equation, where the Re_tau is the relevant non-dimensional number, the non-dimensional pressure gradient the force the flow in the stream-wise direction is simply -1

C.C October 3, 2012 06:30

Quote:

Originally Posted by leflix (Post 384677)
Yes for sure, but I guess the problem is how you implement these periodic boundary conditions.
first you should apply Phy(NI)=Phy(1) and Phy(0)=Phy(NI-1)
(BC are on node 0 and NI)
Phy stands for u,v, P.
If your solver is explicit it is easy, if your solver is implicit then you have to
deal with this in your matrix.
After you have to include in the x momentum the pressure drop to maintain the flow. It is related to the mass flow rate and in the case of a pipe flow or a channel flow there is an analytical expression.

I'm using Ansys Fluent to simulate the pipe flow and in the pressure profile the pressure has negative values

leflix October 3, 2012 06:41

Quote:

Originally Posted by C.C (Post 384695)
I'm using Ansys Fluent to simulate the pipe flow and in the pressure profile the pressure has negative values


But if you use Fluent , periodic BC are already implemented and you have nothing to do, just click on "Periodic Boundary Condition" :D
If it doesn't work it is because you certainly did something wrong previously...

FMDenaro October 3, 2012 06:42

Quote:

Originally Posted by C.C (Post 384695)
I'm using Ansys Fluent to simulate the pipe flow and in the pressure profile the pressure has negative values

negative values of the pressure means nothing useful... you must assess that youy have a basic (constant) negative pressure gradient with a superimposed periodic pressure fluctuation

prasanthnitt October 7, 2012 13:51

2D Channel Flow eith Periodic boundaries in the streamwise directions
 
Hi All,

I have written a 2D Incompressible NS solver for solving a channel flow with periodic boundary conditions. I am using a fractional step method(Kim and Moin 1985 JCP). I have non dimensionalized the equations. The rey_no is set to 100.

Channel Dimensions:
2 units: in the stream-wise and in the normal direction
Time integration scheme:
AB-2

A constant pressure gradient of value -2.0/rey_no is specified.
Staggered grid.
Periodic bcn in the stream-wise direction:
u(ni,.)=u(1,.)
u(0,.)=u(ni-1,.)

V(ni+1,.)=v(1,.)
v(0,.)=v(ni,.)

p(ni+1,.)=p(1,.)
p(0,.)=p(ni,.)

u and v represent the horizontal velocity components.
p represents pressure.

Boundary conditions in the normal direction:
u(:,0)=-u(:,1) //No Slip
u(:,nj+1)=-u(:,nj) //No penetration

v(:,0)=0.0
v(:,nj)=0.0

dp/dn =0 at y=0 and y=2

Initial condition:
I have tried several:
u(:, j )=1.0
u(:,j)=parabola with centerline velocity=1

So, the analytical solution for this problem is a parabola with centerline velocity=1.
But in my case the centerline velocity is greater than 1. I don't know why this is happening.
Help of any kind would be appreciated. I would be more than happy to provide any extra information.

Cheers
Prasanth

leflix October 12, 2012 12:48

Quote:

Originally Posted by prasanthnitt (Post 385363)

So, the analytical solution for this problem is a parabola with centerline velocity=1.
But in my case the centerline velocity is greater than 1. I don't know why this is happening.

Prasanth

Hi Prasanth,

No in the case of a channel flow the dimensionless velocity on the centerline is 1.5
Is it what you obtained?

prasanthnitt October 13, 2012 01:29

[QUOTE

No in the case of a channel flow the dimensionless velocity on the centerline is 1.5
Is it what you obtained?[/QUOTE]

Its 1.5 if you normalize with the average velocity. I am normalizing with the centre-line velocity.
The issue has been fixed. I applied the pressure gradient in the velocity update step (from u* to u n+1) and it worked.

Thanks.

leflix October 14, 2012 11:41

Quote:

Originally Posted by prasanthnitt (Post 386374)
[QUOTE

I am normalizing with the centre-line velocity.
The issue has been fixed. I applied the pressure gradient in the velocity update step (from u* to u n+1) and it worked.

Thanks.

ok it's fine!!

Kamu November 17, 2012 09:28

Hello all
I am using a periodic boundary condition pipe flow with an insert. I read in FLUENT user guide that the pressure drop has two components, a linear varying component and a periodic component. How do you get the periodic component? Is there a way of post processing the pressure drop that includes the two components???

sbaffini November 18, 2012 10:21

There is no reason to post process the linearly varying part, as ALL the information you need about it is in the periodic condition panel, that is gradient and direction. The periodic component is the only one you get as solution and it is the only one available in the post processing.

If you want, you can define a custom field function with the following variable:

p + dp/dx*(x-x0) + dp/dy*(y-y0) + dp/dz*(z-z0)

and you get them both

Kamu November 19, 2012 01:52

Quote:

Originally Posted by sbaffini (Post 392795)
There is no reason to post process the linearly varying part, as ALL the information you need about it is in the periodic condition panel, that is gradient and direction. The periodic component is the only one you get as solution and it is the only one available in the post processing.

If you want, you can define a custom field function with the following variable:

p + dp/dx*(x-x0) + dp/dy*(y-y0) + dp/dz*(z-z0)

and you get them both

Thanks Sbaffini for your reply. When i put in the custom field function i will get the pressure at a given point. My dilemma is that when you define periodic conditions the inlet and outlet are combined and the pressure I get is at inlet. to get the pressure drop, dp = Pin-Pout! How do I get Pout?

sbaffini November 19, 2012 04:50

In the custom field function above, the pressure is the one effectively solved for by Fluent; in this case it gives you p_in = p_out (at least for the straight pipe case).

If you performed a periodic computation by fixing the mass flow, then dp/dx is available in the periodic b.c. panel (it also has a direction, which you needed to fix... hopefully, along the pipe axis). So, to know the presure jump in your case you just need to compute dp/dx * L where L is the length of the pipe

Kamu November 19, 2012 04:58

Periodic pressure drop
 
Quote:

Originally Posted by sbaffini (Post 392903)
In the custom field function above, the pressure is the one effectively solved for by Fluent; in this case it gives you p_in = p_out (at least for the straight pipe case).

If you performed a periodic computation by fixing the mass flow, then dp/dx is available in the periodic b.c. panel (it also has a direction, which you needed to fix... hopefully, along the pipe axis). So, to know the presure jump in your case you just need to compute dp/dx * L where L is the length of the pipe

Dear Paolo,
Thanks very much for the help. This is what i had settled for i would get dp/dx and then multiply by the length of the pipe. I realized that when i compute the friction factor it does not agree with that from experimental data. And when I use the linear gradient in the periodic panel it gives me an accurate answer! Could I be getting dp/dx at a wrong surface?

Kamu November 19, 2012 10:59

Periodic B.C
 
Quote:

Originally Posted by sbaffini (Post 392903)
In the custom field function above, the pressure is the one effectively solved for by Fluent; in this case it gives you p_in = p_out (at least for the straight pipe case).

If you performed a periodic computation by fixing the mass flow, then dp/dx is available in the periodic b.c. panel (it also has a direction, which you needed to fix... hopefully, along the pipe axis). So, to know the presure jump in your case you just need to compute dp/dx * L where L is the length of the pipe

Thanks Paolo, i get it now. Are you a workbench user? How do you in this case have this pressure gradient available in workbench for optimization studies?

sbaffini November 19, 2012 16:25

Dear Kamu,

for several reasons i am not a Workbench user and i know nothing about the setting of the parameters for their external use in workbench. However, while in theory there should not be any difficulty in setting the pressure as a parameter, it happens that this variable is also very weird (it is an output for fixed mass flow rate cases, its monitoring is far from being straightforward, etc.)... so, there might be chances that it actually can't be used as parameter.

Kamu November 20, 2012 00:48

Quote:

Originally Posted by sbaffini (Post 393062)
Dear Kamu,

for several reasons i am not a Workbench user and i know nothing about the setting of the parameters for their external use in workbench. However, while in theory there should not be any difficulty in setting the pressure as a parameter, it happens that this variable is also very weird (it is an output for fixed mass flow rate cases, its monitoring is far from being straightforward, etc.)... so, there might be chances that it actually can't be used as parameter.

Dear Paolo,
Thanks alot, looks like i will have to get it manually from FLUENT. I have tried all possible post-processing options to see if there is anything that is related to it in vain. Otherwise thanks once again

nedanikou November 6, 2016 07:36

Quote:

Originally Posted by prasanthnitt (Post 385363)
Hi All,

I have written a 2D Incompressible NS solver for solving a channel flow with periodic boundary conditions. I am using a fractional step method(Kim and Moin 1985 JCP). I have non dimensionalized the equations. The rey_no is set to 100.

Channel Dimensions:
2 units: in the stream-wise and in the normal direction
Time integration scheme:
AB-2

A constant pressure gradient of value -2.0/rey_no is specified.
Staggered grid.
Periodic bcn in the stream-wise direction:
u(ni,.)=u(1,.)
u(0,.)=u(ni-1,.)

V(ni+1,.)=v(1,.)
v(0,.)=v(ni,.)

p(ni+1,.)=p(1,.)
p(0,.)=p(ni,.)

u and v represent the horizontal velocity components.
p represents pressure.

Boundary conditions in the normal direction:
u(:,0)=-u(:,1) //No Slip
u(:,nj+1)=-u(:,nj) //No penetration

v(:,0)=0.0
v(:,nj)=0.0

dp/dn =0 at y=0 and y=2

Initial condition:
I have tried several:
u(:, j )=1.0
u(:,j)=parabola with centerline velocity=1

So, the analytical solution for this problem is a parabola with centerline velocity=1.
But in my case the centerline velocity is greater than 1. I don't know why this is happening.
Help of any kind would be appreciated. I would be more than happy to provide any extra information.

Cheers
Prasanth

Hi All,
I have written a 3D Incompressible NS solver for solving a rectangular duct flow with periodic boundary conditions along the direction of flow (x). In my case of staggered grid, pressure was set based on finite volume method, for ux velocity i used finite volume along y, z and finite difference along x. it works for coarse grids and I have fully developed flow in domain but as I generate smaller grid size, residual of u, v, w and continuity oscillates and did not converge. I changed the relaxation factors to small values of 0.001, bu it did not work. Please, someone can help me... What is wrong?

FMDenaro November 6, 2016 08:02

I suggest to open a new post and provide full details fo your problem...however, I really don't understand the reason for using FV and FD in the same code.


All times are GMT -4. The time now is 03:52.