# Periodic Boundary Condition

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

 March 25, 2017, 05:24 Periodic Boundary Condition #1 Member     Join Date: Mar 2016 Location: Bergamo Posts: 84 Rep Power: 3 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

March 25, 2017, 15:35
#2
Member

Matt
Join Date: Oct 2012
Posts: 38
Rep Power: 6
Quote:
 Originally Posted by FlyBob91 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;
}```

 March 27, 2017, 04:28 #3 Member     Join Date: Mar 2016 Location: Bergamo Posts: 84 Rep Power: 3 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

 March 27, 2017, 04:45 #4 Senior Member   Agustín Villa Join Date: Apr 2013 Location: Brussels Posts: 174 Rep Power: 7 Hello what I would do to initialize your velocity, is to change the internalField value. FlyBob91 likes this.

March 27, 2017, 21:21
#5
Member

Matt
Join Date: Oct 2012
Posts: 38
Rep Power: 6
Quote:
 Originally Posted by FlyBob91 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.

 March 30, 2017, 13:53 #6 Member     Join Date: Mar 2016 Location: Bergamo Posts: 84 Rep Power: 3 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

 March 31, 2017, 06:25 #7 Senior Member   Agustín Villa Join Date: Apr 2013 Location: Brussels Posts: 174 Rep Power: 7 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.

 May 2, 2017, 09:03 #8 Member     Join Date: Mar 2016 Location: Bergamo Posts: 84 Rep Power: 3 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.

May 2, 2017, 09:47
#9
Member

Matt
Join Date: Oct 2012
Posts: 38
Rep Power: 6
Quote:
 Originally Posted by fatirishman53 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.

 May 2, 2017, 09:57 #10 Member     Join Date: Mar 2016 Location: Bergamo Posts: 84 Rep Power: 3 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

May 2, 2017, 15:33
#11
Member

Matt
Join Date: Oct 2012
Posts: 38
Rep Power: 6
Quote:
 Originally Posted by FlyBob91 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.

 May 3, 2017, 03:21 #12 Senior Member   Agustín Villa Join Date: Apr 2013 Location: Brussels Posts: 174 Rep Power: 7 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.

May 17, 2017, 05:01
#13
Member

Join Date: Mar 2016
Location: Bergamo
Posts: 84
Rep Power: 3
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
 fvOptions_OpenFOAM230.tar.gz (501 Bytes, 1 views) Channel.tar.gz (2.0 KB, 1 views)

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Madhatter92 CFX 12 January 12, 2016 05:39 Saima CFX 45 September 22, 2015 10:53 EMolina SU2 0 July 24, 2014 16:16 kohel_11 FLUENT 3 July 30, 2013 07:37 sunilpatil CFX 8 April 26, 2013 07:00

All times are GMT -4. The time now is 00:58.