CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   About cyclic boundary condition (https://www.cfd-online.com/Forums/openfoam/110120-about-cyclic-boundary-condition.html)

mmkr825 December 4, 2012 06:10

About cyclic boundary condition
 
Hi Foamers,
I am doing simulations on 2D channel flow. I need to apply periodic boundary condition in the X- direction. Is there any any tutorial or any case file which uses cyclic BC.

Thanks
Regards
Mallikarjuna.r

atmcfd December 4, 2012 20:32

Check the OF page on cyclic BCs, if you are using any version greater than OF 2.0

http://www.openfoam.org/version2.0.0/meshing.php

For tutorials check incompressible / channelFoam / channel395. The implementation of the cyclic BC given here is fairly simple, provided you have the mesh patches already created. Else you might have to do that with topoSet and createPatch.
Let know if you have any questions.

mmkr825 December 5, 2012 04:53

Hi Atm
Thanks for quick reply. I followed the tutorial incompressible / channelFoam / channel395. My case is 2D channel and I need cyclic BC in only one direction. When i compiled with blockMesh, checkMesh, there is no error.

My doubts are:

1. I have not given any value for the fields at the cyclic boundary patch. How to give inlet BC and outlet BC.

boundaryField
{
leftWall
{
type cyclic;
// type fixedValue.
// value uniform (0.003741 0 0);
}
fixedWalls
{
type fixedValue;
value uniform (0 0 0);
}
rightWall
{
type cyclic;
//type zeroGradient;
}
frontAndBack
{
type empty;
}
}

2. How to specify the total number of unit cells.

Could you please clarify my doubts.

Thanks
Regards
Mallikarjuna

atmcfd December 5, 2012 22:32

Hi Mallikarjuna,

The actual format should be like this :


boundaryField
{
leftWall
{
type cyclic;
nFaces value;
startFace value
matchTolerance value;
neighbourPatch rightwall;
}
fixedWalls
{
type fixedValue;
value uniform (0 0 0);
}
rightWall
{
type cyclic;
nFaces value;
startFace value
matchTolerance value;
neighbourPatch leftwall;
}
frontAndBack
{
type empty;
}
}

2. If you are asking about the "value" you need to have here for these fields, these come after you have created patches in your mesh (using topoSet or setSet ). Then, running createPatch command would automatically generate a boundary file containing the patches in a cyclic/whatever B.C. you want, with the right values for nFaces and startFace. All of this depends on how you define topoSet.

Do you have the patches created for your mesh already? if so you can skip and directly go to just creating the boundary file.

mmkr825 December 6, 2012 00:58

Hi Atm,
I have defined as you suggested. My boundary field for velocity is:

Quote:

boundaryField
{
leftWall
{
type cyclic;
nFaces 40;
startFace 157960;
matchTolerance 0.0001;
neighbourPatch rightWall;
}
fixedWalls
{
type fixedValue;
value uniform (0 0 0);
}
rightWall
{
type cyclic;
nFaces 40;
startFace 162000;
matchTolerance 0.0001;
neighbourPatch leftWall;
}
frontAndBack
{
type empty;
}
}
In the above boundary field, i have not mentioned any value for velocity. But without PBC the velocity at the inlet is:

Quote:

inlet
{
type fixedValue;
value uniform (0.003741 0 0);
}
When i run my case file with my solver, it is running.
Later i came to know it is taking the values which i given for the internal fields.

Code:

internalField  uniform (0.0037 0 0);
But i think internalField is only for initial guess.

Is there any extra code i need to add to my case file ?

Thanks
Regards
Mallikarjuna

atmcfd December 6, 2012 01:12

If you are using ChannelFoam, You have to go to constant>transportProperties
and find:
Ubar Ubar [ 0 1 -1 0 0 0 0 ] ( "value" 0 0 );
here the value is the the velocity , 0.00347 to be specified by you.

mmkr825 December 6, 2012 01:33

Hi Atm,
Thanks for quick reply. I did as you suggested.
For velocity:

Code:

U                U [ 0 1 -1 0 0 0 0 ] ( 0.003741 0 0 );
I am fresher to openFOAM. Could you please tell me at which location this value is applied. For example if i want to give value at outlet, then how could i give value.

Thanks
Regards
Mallikarjuna

mmkr825 December 6, 2012 11:21

Hi Atm,
In my case i have not mentioned any driving force for the flow. I checked channelFoam solver, there it have additional gradp term in the momentum equation.

But in my case i don't know the driving force gradp term. Instead i know velocity at inlet and pressure at outlet. Could you please suggest me what are the changes need to do to meet my requirements.

Thanks
Regards
Mallikarjuna

atmcfd December 7, 2012 02:10

A cyclic boundary condition is one in which the conditions at the outlet are replicated at the inlet. You can either specify the 1)mass flow rate (velocity) or 2) Pressure gradient (gradP). In this case the velocity u provided will calculate the mass flow rate and the code will compute the value of gradP. For details, look up the channelFoam.C code , and the numerics of the PISO method.

Quote:

Instead i know velocity at inlet and pressure at outlet. Could you please suggest me what are the changes need to do to meet my requirements.
If this is the case, why do you want to impose a cyclic B.C? You can as well give a velocity inlet-pressure outlet condition :)

mmkr825 December 7, 2012 02:25

Hi atm,
Thanks for the reply. I changed my code by following channelFoam. I succeed in getting the velocity profile.

But in my solver i have one more field (let say Temperature T). For the temperature i need to specify the fixed value at inlet. Could you please tell me what i need to change to my code to get results for temperature also.

Thanks
Mallikarjuna.r
Mallikarjuna


All times are GMT -4. The time now is 07:11.