PERIODIC BOUNDARY CONDITIONS

Numerical methods and mathematical models of Elmer
Andrea_P
Posts: 176
Joined: 22 Mar 2021, 18:39
Antispam: Yes
Location: POLYTHECNIC UNIVERSITY OF TURIN

PERIODIC BOUNDARY CONDITIONS

Post by Andrea_P »

Hi,
I want to fix the periodic boundary conditions on the "top" and "bottom" boundaries to ensure that when the flow goes out from the "top", it enters from the "bottom". I wrote the following attached case, but I do not understand if I wrote the right boundary conditions. Thanks in advance,
-Andrea
Attachments
case.sif
(4.22 KiB) Downloaded 160 times
POLYTECHNIC UNIVERSITY OF TURIN-DIMEAS
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: PERIODIC BOUNDARY CONDITIONS

Post by kevinarden »

I would not set the pressure to zero at the top, unless that is really the boundary condition you want. I would let Elmer calculate Velocity 2 and pressure at the top. The equations would have to conserve mass and energy unless you have something doing work on the system to add or remove energy. Attached is a simple study on boundary conditions for flow. Even though this is flow the principal is the same for all thermodynamic problems. The system has to conserve mass and energy, unless there is work being done. It also has to adhere to the boundary conditions specified. However, if you don't specify a boundary condition value, the value is calculated.
Attachments
testcases.pdf
(96.49 KiB) Downloaded 167 times
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: PERIODIC BOUNDARY CONDITIONS

Post by raback »

Hi

The test case "NonnewtonianChannelFLow" has such conditions.

Didn't try your case but it probably failed. Partly because you try to force the pressure, but even more so because you set n-t velocity. The incoming and outgoing normals point to opposite directions so if you enforce n-t velocity the system is actually not periodic but anti-periodic ;-)

-Peter
Andrea_P
Posts: 176
Joined: 22 Mar 2021, 18:39
Antispam: Yes
Location: POLYTHECNIC UNIVERSITY OF TURIN

Re: PERIODIC BOUNDARY CONDITIONS

Post by Andrea_P »

raback wrote: 26 May 2021, 00:11 Hi

The test case "NonnewtonianChannelFLow" has such conditions.

Didn't try your case but it probably failed. Partly because you try to force the pressure, but even more so because you set n-t velocity. The incoming and outgoing normals point to opposite directions so if you enforce n-t velocity the system is actually not periodic but anti-periodic ;-)

-Peter
Hi Peter,
Thanks for your answer. I was editing this case.sifviewtopic.php?t=4366 to adapt it to my situation.
-Andrea
POLYTECHNIC UNIVERSITY OF TURIN-DIMEAS
Andrea_P
Posts: 176
Joined: 22 Mar 2021, 18:39
Antispam: Yes
Location: POLYTHECNIC UNIVERSITY OF TURIN

Re: PERIODIC BOUNDARY CONDITIONS

Post by Andrea_P »

kevinarden wrote: 25 May 2021, 23:46 I would not set the pressure to zero at the top, unless that is really the boundary condition you want. I would let Elmer calculate Velocity 2 and pressure at the top. The equations would have to conserve mass and energy unless you have something doing work on the system to add or remove energy. Attached is a simple study on boundary conditions for flow. Even though this is flow the principal is the same for all thermodynamic problems. The system has to conserve mass and energy, unless there is work being done. It also has to adhere to the boundary conditions specified. However, if you don't specify a boundary condition value, the value is calculated.
Hi Kevin,
I put

Code: Select all

Pressure=0
because I want an outlet condition, I saw your pdf. How can I fix usually periodic boundary conditions?
-Andrea
POLYTECHNIC UNIVERSITY OF TURIN-DIMEAS
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: PERIODIC BOUNDARY CONDITIONS

Post by kevinarden »

An outlet is the condition unless you specify an external pressure.
Setting pressure=0 at the boundary makes pressure 0 along the entire boundary right at the boundary. The pressure outside of the outlet is zero. but not right at the orifice. If you set pressure=0 at the boundary in the pdf test cases it will cause strange results. Setting external pressure = 0 has no effect because external pressure is zero by default.
Andrea_P
Posts: 176
Joined: 22 Mar 2021, 18:39
Antispam: Yes
Location: POLYTHECNIC UNIVERSITY OF TURIN

Re: PERIODIC BOUNDARY CONDITIONS

Post by Andrea_P »

kevinarden wrote: 26 May 2021, 12:08 An outlet is the condition unless you specify an external pressure.
Setting pressure=0 at the boundary makes pressure 0 along the entire boundary right at the boundary. The pressure outside of the outlet is zero. but not right at the orifice. If you set pressure=0 at the boundary in the pdf test cases it will cause strange results. Setting external pressure = 0 has no effect because external pressure is zero by default.
Yes, of course. I don't know if you remember that the same situation happened to me in this case viewtopic.php?f=3&t=7494&start=10, I solved it by setting

Code: Select all

Pressure 1 = 0
. Could you say to me please whether the periodic boundary conditions are set well?

Code: Select all

Boundary Condition 3
  name = " Inlet"
  target boundaries = 4 
  ! Normal-Tangential Velocity = True
  Velocity 2 = Variable Coordinate 1
      Real MATC "-0.5*(tx/h)^2+ (h1/h)*(tx/h) -1"
  Velocity 1 = 0
  Periodic BC = 4 !è il numero della boundary condition dove applica la periodicità ovvero la voglio anche al "top"
  Periodic BC Velocity 1 = Logical True
  Periodic BC Velocity 2 = Logical True
  ! Volume Flow = $  g*h^3/(3*nuPlus)-h*Up
End

Boundary Condition 4
  name = "Outlet"
  target boundaries = 2
  ! Pressure  = 0
  ! Normal-Tangential Velocity = True
  Velocity 1 = 0
  Velocity 2 = 0
  
End
Regards,
Andrea
POLYTECHNIC UNIVERSITY OF TURIN-DIMEAS
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: PERIODIC BOUNDARY CONDITIONS

Post by kevinarden »

I am not familiar with the Periodic BC in the stokes model. It is not in the documentation.

I could make a periodic flow in a transient stokes model using MATC.

Velocity 2 = Variable Time; Real MATC "1.5*sin(3*tx)"
Andrea_P
Posts: 176
Joined: 22 Mar 2021, 18:39
Antispam: Yes
Location: POLYTHECNIC UNIVERSITY OF TURIN

Re: PERIODIC BOUNDARY CONDITIONS

Post by Andrea_P »

kevinarden wrote: 26 May 2021, 12:30 I am not familiar with the Periodic BC in the stokes model. It is not in the documentation.

I could make a periodic flow in a transient stokes model using MATC.

Velocity 2 = Variable Time; Real MATC "1.5*sin(3*tx)"
The problem is that I have to assure that velocity profile, written in the case.sif, in the inlet.
-Andrea
POLYTECHNIC UNIVERSITY OF TURIN-DIMEAS
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: PERIODIC BOUNDARY CONDITIONS

Post by raback »

If you know the inlet profile and it is different than the output profile then the BC is not periodic...
Post Reply