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

Periodic Boundary Condition

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

Like Tree5Likes
  • 1 Post By fatirishman53
  • 1 Post By agustinvo
  • 1 Post By fatirishman53
  • 1 Post By agustinvo
  • 1 Post By FlyBob91

Reply
 
LinkBack Thread Tools Display Modes
Old   March 25, 2017, 05:24
Question Periodic Boundary Condition
  #1
Member
 
FlyBob91's Avatar
 
Join Date: Mar 2016
Location: Bergamo
Posts: 84
Rep Power: 3
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, 15:35
Default
  #2
Member
 
Matt
Join Date: Oct 2012
Posts: 38
Rep Power: 6
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;
}
FlyBob91 likes this.
fatirishman53 is offline   Reply With Quote

Old   March 27, 2017, 04:28
Default
  #3
Member
 
FlyBob91's Avatar
 
Join Date: Mar 2016
Location: Bergamo
Posts: 84
Rep Power: 3
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: Brussels
Posts: 174
Rep Power: 7
agustinvo is on a distinguished road
Hello

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

Old   March 27, 2017, 21:21
Default
  #5
Member
 
Matt
Join Date: Oct 2012
Posts: 38
Rep Power: 6
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.
FlyBob91 likes this.
fatirishman53 is offline   Reply With Quote

Old   March 30, 2017, 13:53
Default
  #6
Member
 
FlyBob91's Avatar
 
Join Date: Mar 2016
Location: Bergamo
Posts: 84
Rep Power: 3
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: Brussels
Posts: 174
Rep Power: 7
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
fatirishman53 likes this.
agustinvo is offline   Reply With Quote

Old   May 2, 2017, 09:03
Default
  #8
Member
 
FlyBob91's Avatar
 
Join Date: Mar 2016
Location: Bergamo
Posts: 84
Rep Power: 3
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: 38
Rep Power: 6
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
Member
 
FlyBob91's Avatar
 
Join Date: Mar 2016
Location: Bergamo
Posts: 84
Rep Power: 3
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: 38
Rep Power: 6
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: Brussels
Posts: 174
Rep Power: 7
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
Member
 
FlyBob91's Avatar
 
Join Date: Mar 2016
Location: Bergamo
Posts: 84
Rep Power: 3
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, 1 views)
File Type: gz Channel.tar.gz (2.0 KB, 1 views)
agustinvo likes this.
FlyBob91 is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in setting Boundary Condition Madhatter92 CFX 12 January 12, 2016 05:39
sliding mesh problem in CFX Saima CFX 45 September 22, 2015 10:53
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 00:58.