CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

Periodic Boundary Condition

Register Blogs Community New Posts Updated Threads Search

Like Tree22Likes
  • 10 Post By fatirishman53
  • 2 Post By agustinvo
  • 4 Post By fatirishman53
  • 3 Post By agustinvo
  • 3 Post By FlyBob91

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 25, 2017, 04:24
Question Periodic Boundary Condition
  #1
Senior Member
 
FlyBob91's Avatar
 
Join Date: Mar 2016
Location: Bergamo
Posts: 157
Rep Power: 10
FlyBob91 is on a distinguished road
Hello to all,
In many papers, to simulate a fully developed flow in a geometry (pipe or channel), i've seen is practice, to avoid modelling a long pipe, to implement periodic boundary condition at the inlet and outlet.

Can someone explain me how to implement this method?


Thanks for help
FlyBob91 is offline   Reply With Quote

Old   March 25, 2017, 14:35
Default
  #2
Member
 
Matt
Join Date: Oct 2012
Posts: 39
Rep Power: 13
fatirishman53 is on a distinguished road
Quote:
Originally Posted by FlyBob91 View Post
Hello to all,
In many papers, to simulate a fully developed flow in a geometry (pipe or channel), i've seen is practice, to avoid modelling a long pipe, to implement periodic boundary condition at the inlet and outlet.

Can someone explain me how to implement this method?


Thanks for help
Your boundaries would be defined using (i.e. in blockMeshDict):

Code:
inlet
{
    type              cyclic;
    neighbourPatch    outlet;
    faces             ((0 1 2 3));  // insert your particular vertex numbers
}

outlet
{
    type              cyclic;
    neighbourPatch    inlet;
    faces             ((4 5 6 7));  // insert your particlular vertex numbers
}
Then in your U, p, etc. files you would define, under boundaryField:

Code:
inlet
{
    type                      cyclic;
}

outlet
{
    type                      cyclic;
}
fatirishman53 is offline   Reply With Quote

Old   March 27, 2017, 04:28
Default
  #3
Senior Member
 
FlyBob91's Avatar
 
Join Date: Mar 2016
Location: Bergamo
Posts: 157
Rep Power: 10
FlyBob91 is on a distinguished road
Hello IrishMan, thanks for your fast reply and sorry for my late one.
I have a doubt, how can i define an initial velocty at the inlet with a cyclic BC?


Many thanks
FlyBob91 is offline   Reply With Quote

Old   March 27, 2017, 04:45
Default
  #4
Senior Member
 
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 313
Rep Power: 15
agustinvo is on a distinguished road
Hello

what I would do to initialize your velocity, is to change the internalField value.
FlyBob91 and sabrinacarson like this.
agustinvo is offline   Reply With Quote

Old   March 27, 2017, 21:21
Default
  #5
Member
 
Matt
Join Date: Oct 2012
Posts: 39
Rep Power: 13
fatirishman53 is on a distinguished road
Quote:
Originally Posted by FlyBob91 View Post
Hello IrishMan, thanks for your fast reply and sorry for my late one.
I have a doubt, how can i define an initial velocty at the inlet with a cyclic BC?


Many thanks
As agustinov pointed out, you could set your internal mesh to a uniform velocity. You could also use something like swak4foam to create a particular velocity profile. However, you also need something to keep your flow moving. The meanVelocityForce fvOption (OpenFOAM-3.0.x) introduces a force term to the NS equations in order to maintain a user-defined bulk velocity.
utkunun, FlyBob91, SHANRU and 1 others like this.
fatirishman53 is offline   Reply With Quote

Old   March 30, 2017, 13:53
Default
  #6
Senior Member
 
FlyBob91's Avatar
 
Join Date: Mar 2016
Location: Bergamo
Posts: 157
Rep Power: 10
FlyBob91 is on a distinguished road
Thanks guys for your replies.
I made all you said me but unfortunately after launching pimpleFoam this error occurs

Code:
--> FOAM FATAL IO ERROR: 
Unable to set reference cell for field p
    Please supply either pRefCell or pRefPoint


file: /home/roby/Scrivania/Auxiliary/system/fvSolution.PIMPLE from line 57 to line 58.

    From function void Foam::setRefCell
(
    const volScalarField&,
    const volScalarField&,
    const dictionary&,
    label& scalar&,
    bool
)
    in file cfdTools/general/findRefCell/findRefCell.C at line 125.

here my U,p and blockMesh file

U

Code:
dimensions      [ 0 1 -1 0 0 0 0 ];

internalField   uniform (0 0.42 0);

boundaryField
{
 
    inlet
    {
        type            cyclic;
    }
 
    walls
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }

    outlet
    {
        type            cyclic;

    }

}

P

Code:
dimensions      [ 0 2 -2 0 0 0 0 ];

internalField   uniform 0;

boundaryField
{

    inlet
    {
        type            cyclic;
    }
 
    walls
    {
        type            zeroGradient;
    }

    outlet
    {
        type            cyclic;
    }

}

blocjMeshDict

Code:
boundary
(

    walls
    {
        type wall;
        faces
        (
            (3 2 1 0)
	    (0 1 5 4)
            (4 5 6 7)
            (2 3 7 6)
        );
    }

    inlet
    {
        type cyclic;
	neighbourPatch outlet;
        faces
        (
            (0 4 7 3)
        );
    }

    outlet
    {
        type cyclic;
	neighbourPatch inlet;
        faces
        (
            (1 2 6 5)
        );
    }   
);

Many thanks
FlyBob91 is offline   Reply With Quote

Old   March 31, 2017, 06:25
Default
  #7
Senior Member
 
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 313
Rep Power: 15
agustinvo is on a distinguished road
Please take a look here. since you are not imposing a pressure value in your BC-s, the solver is asking for it. you have to give it in your fvSolution, as you see from your error, inside the PIMPLE dictionary. In this way, you will have a reference pressure to compute the pressure field.

https://github.com/OpenFOAM/OpenFOAM...tem/fvSolution
agustinvo is offline   Reply With Quote

Old   May 2, 2017, 09:03
Default
  #8
Senior Member
 
FlyBob91's Avatar
 
Join Date: Mar 2016
Location: Bergamo
Posts: 157
Rep Power: 10
FlyBob91 is on a distinguished road
Sorry for the thread bumping but the solutions proposed above seem not to work good for my case, because the flow seems to slow down very quickly respect the value i want to impose at the inlet. This must be because there is no a driving force.
Maybe the problem could be fixed by setting a value of flowrate. The informations i have are the density and the inlet velocity (uniform).
I read some threads about the same problem but no one has given me a completely solution.
FlyBob91 is offline   Reply With Quote

Old   May 2, 2017, 09:47
Default
  #9
Member
 
Matt
Join Date: Oct 2012
Posts: 39
Rep Power: 13
fatirishman53 is on a distinguished road
Quote:
Originally Posted by fatirishman53 View Post
As agustinov pointed out, you could set your internal mesh to a uniform velocity. You could also use something like swak4foam to create a particular velocity profile. However, you also need something to keep your flow moving. The meanVelocityForce fvOption (OpenFOAM-3.0.x) introduces a force term to the NS equations in order to maintain a user-defined bulk velocity.
fatirishman53 is offline   Reply With Quote

Old   May 2, 2017, 09:57
Default
  #10
Senior Member
 
FlyBob91's Avatar
 
Join Date: Mar 2016
Location: Bergamo
Posts: 157
Rep Power: 10
FlyBob91 is on a distinguished road
Hi fatirishman,
unfortunately i'm on OF 2.3.0 and it seems meanVelocityForce fvOptionis is only for OF 3.0.
Can i use it evenly? And if yes, how?

Many thanks for your help
FlyBob91 is offline   Reply With Quote

Old   May 2, 2017, 15:33
Default
  #11
Member
 
Matt
Join Date: Oct 2012
Posts: 39
Rep Power: 13
fatirishman53 is on a distinguished road
Quote:
Originally Posted by FlyBob91 View Post
Hi fatirishman,
unfortunately i'm on OF 2.3.0 and it seems meanVelocityForce fvOptionis is only for OF 3.0.
Can i use it evenly? And if yes, how?

Many thanks for your help
I can't remember what it is called, but I know OF 2.4.0 had something similar. Just do a google search for OpenFOAM fvOptions.
fatirishman53 is offline   Reply With Quote

Old   May 3, 2017, 03:21
Default
  #12
Senior Member
 
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 313
Rep Power: 15
agustinvo is on a distinguished road
Hi,

take a look to this fvOption

https://github.com/OpenFOAM/OpenFOAM...plicitSource.H

or to the boundaryFoam solver

https://github.com/OpenFOAM/OpenFOAM...e/boundaryFoam

With one of them you should reach the setup you are looking for.
agustinvo is offline   Reply With Quote

Old   May 17, 2017, 05:01
Default
  #13
Senior Member
 
FlyBob91's Avatar
 
Join Date: Mar 2016
Location: Bergamo
Posts: 157
Rep Power: 10
FlyBob91 is on a distinguished road
Thank you both guys for your help.
I post the solution for future users

In OpenFOAM 2.3.x the following linked fvOptions file must be put into the system directory. You can also refer to the tutorial in $FOAM_TUTORIALS/incompressible/pimpleFoam/channel395/

I also test it in OpenFoam v-1612+ but the syntax is a bit different and there is no an example to look for, so i link the complete case below


Hope it helps
Attached Files
File Type: gz fvOptions_OpenFOAM230.tar.gz (501 Bytes, 185 views)
File Type: gz Channel.tar.gz (2.0 KB, 208 views)
agustinvo, randolph and Amit@22 like this.
FlyBob91 is offline   Reply With Quote

Old   July 13, 2018, 11:45
Default Periodic Boundary Condition for Temperature
  #14
New Member
 
nahideh
Join Date: Jun 2018
Posts: 2
Rep Power: 0
nj@2018 is on a distinguished road
Hello to all,

I read your description about fvOption, it was helpful for velocity and pressure, but how about Temperature, how can I have Periodic Boundary Condition for Temperature field?

Thank you all
nj@2018 is offline   Reply With Quote

Old   July 19, 2018, 05:40
Default
  #15
Senior Member
 
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 313
Rep Power: 15
agustinvo is on a distinguished road
Hi


keep a cyclic temperature is simple. You need to know your heat balance, it is, the amount of heat that you introduce (or remove) inside the domain.


Then, set this amount in a similar entry in your fvOptions, where you extract (or add) the same amount of heat. Remember to be coherent with units!
agustinvo is offline   Reply With Quote

Old   July 23, 2018, 10:18
Default
  #16
New Member
 
nahideh
Join Date: Jun 2018
Posts: 2
Rep Power: 0
nj@2018 is on a distinguished road
Thank you agustinvo; what you explained seems to be suitable for constant wall heat flux, isn't it?

The problem I have faced is constant wall temperature, a brief description of the problem is like this:

The system considered for the problem, consisted bank of tubes containing a flowing fluid at one temperature that is immersed in a second fluid in cross flow at a different temperature.

and one more thing, is this all based on article of Patankar et al. (1977), “Fully developed flow and heat transfer in ducts having streamwise-periodic variation of cross-sectional area”?

Best Regards
nj@2018 is offline   Reply With Quote

Old   September 28, 2018, 22:12
Default
  #17
Senior Member
 
krishna kant
Join Date: Feb 2016
Location: Hyderabad, India
Posts: 133
Rep Power: 10
kk415 is on a distinguished road
Hello All,

I want to solve a vortex stretching problem in which we have a drop at C(0.5,0.75) in a square of unit size. Now the streamline is given as

\psi = (1/\pi)*\cos(\pi*t/T)*\sin^2(\pi*x)*\sin^2(\pi*y)

The problem is that the Boundary Conditions for all variables is periodic for all four patches that surrounds the domain. If we have a inlet and outlet I can define the neighboring patch for inlet as outlet and vice versa. As shown in the examples above. But what if all the patch is periodic, what should be the neighboring patches for top, bottom, left and right.
kk415 is offline   Reply With Quote

Old   November 28, 2018, 07:02
Default
  #18
New Member
 
Fraser Monaghan Brash
Join Date: Nov 2018
Posts: 1
Rep Power: 0
Brash96 is on a distinguished road
Hello,

I am new to using OpenFoam and have a problem involving a 3D channel with fluid between 2 flat plates (that are being heated).
I am looking to implement cyclic boundary conditions on the fluid and include a heat sink to subtract the calculated heat flux at each time step to ensure no exponential heating.
I am unsure as to how to do this and any suggestions or advice would be greatly appreciated.

Many thanks,
Fraser
Brash96 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
sliding mesh problem in CFX Saima CFX 46 September 11, 2021 07:38
Problem in setting Boundary Condition Madhatter92 CFX 12 January 12, 2016 04:39
Unsteady Periodic Boundary Condition EMolina SU2 0 July 24, 2014 16:16
About periodic boundary condition. kohel_11 FLUENT 3 July 30, 2013 07:37
Error finding variable "THERMX" sunilpatil CFX 8 April 26, 2013 07:00


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