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

ribbed channel / simpleFoam / boundary conditions

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

Like Tree5Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 22, 2012, 15:40
Default ribbed channel / simpleFoam / boundary conditions
  #1
New Member
 
Join Date: Sep 2012
Posts: 10
Rep Power: 13
beeo is on a distinguished road
Dear foamErs,

my task is as follows:



---------------------------------------------------------------------------------------------------------------------------------------------
GENERAL ASPECTS
---------------------------------------------------------------------------------------------------------------------------------------------
I want to simulate a rib-roughened channel and compare the results to experiments.

Along with the experiments only the Reynolds number is given (and thus U_bulk). In addition, the experiments consider a set of periodically located ribs in order to guarantee fully developed flow.

In order to save time and cost I want to simulate only a section of the mentioned frame (shown in the picture as 'region of interest').

---------------------------------------------------------------------------------------------------------------------------------------------
PROBLEM
---------------------------------------------------------------------------------------------------------------------------------------------
I have problems setting proper boundary conditions to match the Reynolds number of the experiments and guarantee fully developed flow in the region of interest.

In addition, I am not familiar with setting periodic boundary conditions.

---------------------------------------------------------------------------------------------------------------------------------------------
APPROACHES
---------------------------------------------------------------------------------------------------------------------------------------------
1. cyclic boundary conditions

I tried applying the boundary conditions at the inlet and outlet to cyclic (concerning all variables) while setting the velocity of the internal field to a finite value.

Code:
internalField   uniform (2.98 0 0);

boundaryField 
{     
inlet     
{         
type cyclic;     
}      
outlet     
{         
type cyclic;     
}
Here, the resulting bulk velocity strongly deviates from the previously specified value.

Furthermore, I repeated the first approach but specified a uniform velocity at the inlet accompanied with an internal field of ( 0 0 0 ).

Code:
internalField   uniform (0 0 0);

boundaryField 
{     
inlet     
{         
type cyclic;     
value uniform (2.98 0 0);
}      
outlet     
{         
type cyclic;     
}
Here, the velocity field is not solved at all.

3. Extend the computational region at the left-hand-side. This would allow a uniform velocity which meets the experimental Reynolds number to be defined at the new inlet. Afterwards, the computation should run in a cyclic matter between 'internal patch' and 'outlet'. Hence, the extension would only serve as a developing region.

Here, blockMeshDict did not allow the definition of a patch located in the internal field.

---------------------------------------------------------------------------------------------------------------------------------------------
QUESTIONS
---------------------------------------------------------------------------------------------------------------------------------------------

1. Can anyone explain if the 'cyclic' - approach is adequate and how to define it properly?

2. Can anyone describe further approaches to specify periodic boundary conditions? (I have read some threads dealing with 'flowRateInletVelocity', 'directMapped' and so on but cannot find an extensive documentation)

3. If specifying a fixed value for the velocity at the inlet in combination with cyclic-related boundary conditions (see approach 2.), is this value treated as initial conditions or boundary conditions? While the former would be a reasonable approach, the latter would not guarantee fully developed flow but prevent the development of a boundary layer at the inlet.

4. With respect to approach 3, is it possible to define a patch located in the internal field? Plus, is it possible to run the solver in a cyclic manner after a finite spatial region?

Sorry for double-posting and thanks for your answers.
Happy Thanksgiving,
Beeo




utkunun likes this.
beeo is offline   Reply With Quote

Old   November 22, 2012, 17:20
Default
  #2
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 22
Lieven will become famous soon enough
Dear Beeo,

I'd recommend you to have a look at channelFoam and its tutorial. Channelfoam is specifically developed to simulate the flow in a duct using cyclic inlet-outlet boundary conditions with a constant mass flow rate (which can be derived quite easily from Re).
I'm pretty sure you can simply replace the mesh of the tuturial by yours and keep the BC (that is, if you're happy with the wall treatment and the turbulence modelling).

To give you some feedback on the three approaches:
1. If you solve this with simple/piso/pimpleFoam the flow will slow down untill it stops cause you're lacking a driving force i.e. a pressure gradient. This you can't impose as BC if you're using cyclic boundary conditions. In channelFoam this pressure gradient is directly included in the momentum equation
2. This is simply not how "value ..." works. It serves as initial value for the boundary but depending of the BC this value might even never be used (in case of cyclic I doubt that this value is even read).
3. Same problem as (1), you need a driving force (e.g. use channelFoam). If you want to work with some sort of 'infinite inlet', you should have a look at the directMapped boundary conditions (mapped in v2.1.1). The pisoFoam/les/pitzDailyDirectMapped tutorial is an example on how this BC can be used.


Regards,

L
sunliming likes this.
Lieven is offline   Reply With Quote

Old   November 22, 2012, 17:37
Default
  #3
New Member
 
Join Date: Sep 2012
Posts: 10
Rep Power: 13
beeo is on a distinguished road
Hey L,

thanks for your comment.

I had a look at the channelFoam solver. Since I want to evaluate several RANS models, channelFoam is not appropriate being a LES solver. However, as you mentioned, the boundary condition-related options are exactly what I am looking for.

1. Is there a way to fix the mass flow rate (or U_bulk) in combination with simpleFoam, though?

2. When specifying the inlet and outlet boundary condition to cyclic (simpleFoam), the driving force has to be a pressure gradient? Do you know how to properly determine and define it respectively?

3. Or would you recommend to modify channelFoam in order to compute the RANS models mentioned above?

Kind regards,
Beeo
beeo is offline   Reply With Quote

Old   November 22, 2012, 18:17
Default
  #4
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 22
Lieven will become famous soon enough
Hey Beeo,

Now that I think about it, you might get it working using simpleFoam if you use the directMapped (or mapped) boundary condition and set the 'setAverage' to 'true' in 0/U. In this case you don't need to impose an external pressure gradient to keep the flow running. However, it is not as trivial as it might seem (see below).

If you're not affraid of creating a modified solver, I recommend you to go for option number 3. It actually surprises me a bit that the turbulence modelling is not generic like pisoFoam cause channelFoam is in the end just an extension of pisoFoam. Anyway, if you open the source code of both solvers you will see that this is easy to modify.

However, a problem with the mapped BC for your case is that you need to be very careful where to set the mapping plane. The BC basically looks for the cells closest to where you want to have the plane so the location becomes directly dependent on your mesh. A coarser mesh with therefore map from an other plane that a fine mesh and both will therefore result in a different spacing between the ribs.

Modifying channelFoam to include RANS-models is pretty straightforward and using cyclic bc is a lot easier than mapped BC and, more importantly, the geometry won't change if you change the mesh.

Just as a side note. One difference between both approaches will be in the pressure field. simpleFoam will give you a solution which includes the pressure gradient while channelFoam will give you the pressure field without the externally imposed pressure gradient.

Regards,

L
Lieven is offline   Reply With Quote

Old   November 22, 2012, 22:33
Default
  #5
New Member
 
Join Date: Sep 2012
Posts: 10
Rep Power: 13
beeo is on a distinguished road
Dear L,

thanks a lot. You made my day. Your proposals directed me to the results I was looking for.

After comparing simpleFoam with channelFoam I was able to modify simpleFoam in such a way to allow for specifying a given value of U_bar in combination with cyclic boundary conditions. If someone is interested in the modified solver, please let me know.

Beeo
beeo is offline   Reply With Quote

Old   November 25, 2012, 11:55
Default How to set fixed pressure gradient instead of fixed flow rate in channelFoam?
  #6
Member
 
Nick
Join Date: Nov 2011
Location: Tongji University,Shanghai,China
Posts: 33
Blog Entries: 6
Rep Power: 14
sunliming is on a distinguished road
I need to fix pressure gradient rather than flow rate which is adopted in channelFoam, does anyone know how to achieve this?Thank you for giving help.
sunliming is offline   Reply With Quote

Old   November 25, 2012, 12:47
Default
  #7
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 22
Lieven will become famous soon enough
It's pretty straightforward to change channelFoam for this. Have a look at the source code. Change the gradP-variable to the value you would like (line 134) i.e. link it to a new input variable instead of it being calculated based on the Ubar-input.

Regards,

L
Lieven is offline   Reply With Quote

Old   November 28, 2012, 07:10
Default
  #8
Member
 
Nick
Join Date: Nov 2011
Location: Tongji University,Shanghai,China
Posts: 33
Blog Entries: 6
Rep Power: 14
sunliming is on a distinguished road
Thank you Lieven, I tried it and succeeded!
sunliming is offline   Reply With Quote

Old   November 30, 2012, 21:32
Default
  #9
Member
 
sqing
Join Date: Sep 2012
Location: Dalian
Posts: 77
Rep Power: 13
Sunxing is on a distinguished road
Quote:
Originally Posted by beeo View Post
Dear L,

thanks a lot. You made my day. Your proposals directed me to the results I was looking for.

After comparing simpleFoam with channelFoam I was able to modify simpleFoam in such a way to allow for specifying a given value of U_bar in combination with cyclic boundary conditions. If someone is interested in the modified solver, please let me know.

Beeo
Hi Beeo,

I have met with the similar problem with you. I want to modify the channelFoam to include Rans-model, but I didn't compile it successfully. So may I have a look at your modified solver?

Regards,
Sunxing
Sunxing is offline   Reply With Quote

Old   December 1, 2012, 15:29
Default
  #10
New Member
 
Join Date: Sep 2012
Posts: 10
Rep Power: 13
beeo is on a distinguished road
Quote:
Originally Posted by Sunxing View Post
Hi Beeo,

I have met with the similar problem with you. I want to modify the channelFoam to include Rans-model, but I didn't compile it successfully. So may I have a look at your modified solver?

Regards,
Sunxing
Hey Sunxing,

of course. Please find attached the corresponding file. Let me know if you are facing further problems.

Beeo
Attached Files
File Type: c simpleFoam_cyclic.C (4.5 KB, 271 views)
ema_amalia, Da Lord's and omidra like this.
beeo is offline   Reply With Quote

Old   December 2, 2012, 06:50
Default
  #11
Member
 
sqing
Join Date: Sep 2012
Location: Dalian
Posts: 77
Rep Power: 13
Sunxing is on a distinguished road
Hi Beeo,

Thanks for your shared file.

Best,

Sunxing
Sunxing is offline   Reply With Quote

Old   December 8, 2012, 15:11
Default
  #12
New Member
 
Join Date: Nov 2012
Posts: 2
Rep Power: 0
demur is on a distinguished road
Quote:
Originally Posted by beeo View Post
Dear foamErs,

my task is as follows:



---------------------------------------------------------------------------------------------------------------------------------------------
GENERAL ASPECTS
---------------------------------------------------------------------------------------------------------------------------------------------
I want to simulate a rib-roughened channel and compare the results to experiments.

Along with the experiments only the Reynolds number is given (and thus U_bulk). In addition, the experiments consider a set of periodically located ribs in order to guarantee fully developed flow.

In order to save time and cost I want to simulate only a section of the mentioned frame (shown in the picture as 'region of interest').

---------------------------------------------------------------------------------------------------------------------------------------------
PROBLEM
---------------------------------------------------------------------------------------------------------------------------------------------
I have problems setting proper boundary conditions to match the Reynolds number of the experiments and guarantee fully developed flow in the region of interest.

In addition, I am not familiar with setting periodic boundary conditions.

---------------------------------------------------------------------------------------------------------------------------------------------
APPROACHES
---------------------------------------------------------------------------------------------------------------------------------------------
1. cyclic boundary conditions

I tried applying the boundary conditions at the inlet and outlet to cyclic (concerning all variables) while setting the velocity of the internal field to a finite value.

Code:
internalField   uniform (2.98 0 0);

boundaryField 
{     
inlet     
{         
type cyclic;     
}      
outlet     
{         
type cyclic;     
}
Here, the resulting bulk velocity strongly deviates from the previously specified value.

Furthermore, I repeated the first approach but specified a uniform velocity at the inlet accompanied with an internal field of ( 0 0 0 ).

Code:
internalField   uniform (0 0 0);

boundaryField 
{     
inlet     
{         
type cyclic;     
value uniform (2.98 0 0);
}      
outlet     
{         
type cyclic;     
}
Here, the velocity field is not solved at all.

3. Extend the computational region at the left-hand-side. This would allow a uniform velocity which meets the experimental Reynolds number to be defined at the new inlet. Afterwards, the computation should run in a cyclic matter between 'internal patch' and 'outlet'. Hence, the extension would only serve as a developing region.

Here, blockMeshDict did not allow the definition of a patch located in the internal field.

---------------------------------------------------------------------------------------------------------------------------------------------
QUESTIONS
---------------------------------------------------------------------------------------------------------------------------------------------

1. Can anyone explain if the 'cyclic' - approach is adequate and how to define it properly?

2. Can anyone describe further approaches to specify periodic boundary conditions? (I have read some threads dealing with 'flowRateInletVelocity', 'directMapped' and so on but cannot find an extensive documentation)

3. If specifying a fixed value for the velocity at the inlet in combination with cyclic-related boundary conditions (see approach 2.), is this value treated as initial conditions or boundary conditions? While the former would be a reasonable approach, the latter would not guarantee fully developed flow but prevent the development of a boundary layer at the inlet.

4. With respect to approach 3, is it possible to define a patch located in the internal field? Plus, is it possible to run the solver in a cyclic manner after a finite spatial region?

Sorry for double-posting and thanks for your answers.
Happy Thanksgiving,
Beeo





hi,

i m new on openFoam and i have a graduation project same as your problem. just i have 14 rib and i need to examine a few points on it. please help me.

best regards,
demur
demur is offline   Reply With Quote

Old   December 8, 2012, 18:47
Default
  #13
New Member
 
Join Date: Sep 2012
Posts: 10
Rep Power: 13
beeo is on a distinguished road
Hi demur,

what is your question actually?

Beeo
beeo is offline   Reply With Quote

Old   December 9, 2012, 03:49
Default
  #14
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 22
Lieven will become famous soon enough
Dear Demur,

Where are the 14 ribs located exactly? Since you have a finite number of ribs, periodic boundaries (mapped or cyclic) might not be appropriate. If not, I would simply recommend you to use channelFoam.

Kind regards,

L
Lieven is offline   Reply With Quote

Old   December 12, 2012, 01:24
Default
  #15
New Member
 
Join Date: Nov 2012
Posts: 2
Rep Power: 0
demur is on a distinguished road
hi

firstly thank you for advice and my ribs will be on one side of the channel and it will be open channel. there is no problem with constructing geometry but i dont know how can i change BC in channelFoam tutorial as i want. in tutorial there is cyclic conditions and i only want to define atmosphere empty and top-bottom.

thank you
demur
demur is offline   Reply With Quote

Old   December 12, 2012, 07:02
Default
  #16
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 22
Lieven will become famous soon enough
Hi Demur,

If I understand your problem correctly (correct me if I'm wrong), your problem is not periodic i.e. it has a finite number of ribs. In this case you can better use the pisoFoam solver. Impose a mass flow rate at the inlet and a pressure at the outlet...

Cheers,

L
Lieven is offline   Reply With Quote

Old   April 26, 2013, 14:08
Default
  #17
Member
 
pooyan
Join Date: Nov 2011
Posts: 62
Rep Power: 14
sam1364 is on a distinguished road
Dear Forum User,

I have recently tried to simulate 2D Periodic Hill Using OpenFoam. my case is very similar to Beeo case. So, based on what I have read from this forum I need to modify ChannelFoam for RANS calculation and fix Ubar in transportDict in order to have fixed mass flow rate. However my question is this:

Since I am going to calculate Re based on bulk velocity at inlet, I need to define Ubar as the average of velocities over the periodic inlet/outlet patches (because the area in the streamwise direction is changing, volume average of velocities in the entire domain calculated by (flowDirection & U)().weightedAverage(mesh.V()); is not appropriate for my case)

Is there any suggestion how I can fix my issue?

Thanks alot,
Attached Images
File Type: jpeg Hill Image.jpeg (9.4 KB, 96 views)
sam1364 is offline   Reply With Quote

Old   April 27, 2013, 18:54
Default
  #18
Member
 
pooyan
Join Date: Nov 2011
Posts: 62
Rep Power: 14
sam1364 is on a distinguished road
Dear sir,

my geometry is like yours. How did you make your inflow and outflow cyclic? I tried to do that by importing my grid from pointwise but it failed to create cyclic patches in OpenFoam. Can anyone send me an example of createPatchDict?


Quote:
Originally Posted by beeo View Post
Dear foamErs,

my task is as follows:



---------------------------------------------------------------------------------------------------------------------------------------------
GENERAL ASPECTS
---------------------------------------------------------------------------------------------------------------------------------------------
I want to simulate a rib-roughened channel and compare the results to experiments.

Along with the experiments only the Reynolds number is given (and thus U_bulk). In addition, the experiments consider a set of periodically located ribs in order to guarantee fully developed flow.

In order to save time and cost I want to simulate only a section of the mentioned frame (shown in the picture as 'region of interest').

---------------------------------------------------------------------------------------------------------------------------------------------
PROBLEM
---------------------------------------------------------------------------------------------------------------------------------------------
I have problems setting proper boundary conditions to match the Reynolds number of the experiments and guarantee fully developed flow in the region of interest.

In addition, I am not familiar with setting periodic boundary conditions.

---------------------------------------------------------------------------------------------------------------------------------------------
APPROACHES
---------------------------------------------------------------------------------------------------------------------------------------------
1. cyclic boundary conditions

I tried applying the boundary conditions at the inlet and outlet to cyclic (concerning all variables) while setting the velocity of the internal field to a finite value.

Code:
internalField   uniform (2.98 0 0);

boundaryField 
{     
inlet     
{         
type cyclic;     
}      
outlet     
{         
type cyclic;     
}
Here, the resulting bulk velocity strongly deviates from the previously specified value.

Furthermore, I repeated the first approach but specified a uniform velocity at the inlet accompanied with an internal field of ( 0 0 0 ).

Code:
internalField   uniform (0 0 0);

boundaryField 
{     
inlet     
{         
type cyclic;     
value uniform (2.98 0 0);
}      
outlet     
{         
type cyclic;     
}
Here, the velocity field is not solved at all.

3. Extend the computational region at the left-hand-side. This would allow a uniform velocity which meets the experimental Reynolds number to be defined at the new inlet. Afterwards, the computation should run in a cyclic matter between 'internal patch' and 'outlet'. Hence, the extension would only serve as a developing region.

Here, blockMeshDict did not allow the definition of a patch located in the internal field.

---------------------------------------------------------------------------------------------------------------------------------------------
QUESTIONS
---------------------------------------------------------------------------------------------------------------------------------------------

1. Can anyone explain if the 'cyclic' - approach is adequate and how to define it properly?

2. Can anyone describe further approaches to specify periodic boundary conditions? (I have read some threads dealing with 'flowRateInletVelocity', 'directMapped' and so on but cannot find an extensive documentation)

3. If specifying a fixed value for the velocity at the inlet in combination with cyclic-related boundary conditions (see approach 2.), is this value treated as initial conditions or boundary conditions? While the former would be a reasonable approach, the latter would not guarantee fully developed flow but prevent the development of a boundary layer at the inlet.

4. With respect to approach 3, is it possible to define a patch located in the internal field? Plus, is it possible to run the solver in a cyclic manner after a finite spatial region?

Sorry for double-posting and thanks for your answers.
Happy Thanksgiving,
Beeo




sam1364 is offline   Reply With Quote

Old   July 17, 2013, 04:11
Default no more channelFoam!
  #19
New Member
 
Steven
Join Date: Jul 2013
Posts: 5
Rep Power: 12
Darth2013 is on a distinguished road
Hi Lieven,
Channelfoam is not included in OF 2.2.1. Do you know what solver we can use instead which has the same features (you mentioned), I mean having the grad P with itself and no need for externally implementation?
Thanks.

Quote:
Originally Posted by Lieven View Post
Hey Beeo,

Now that I think about it, you might get it working using simpleFoam if you use the directMapped (or mapped) boundary condition and set the 'setAverage' to 'true' in 0/U. In this case you don't need to impose an external pressure gradient to keep the flow running. However, it is not as trivial as it might seem (see below).

If you're not affraid of creating a modified solver, I recommend you to go for option number 3. It actually surprises me a bit that the turbulence modelling is not generic like pisoFoam cause channelFoam is in the end just an extension of pisoFoam. Anyway, if you open the source code of both solvers you will see that this is easy to modify.

However, a problem with the mapped BC for your case is that you need to be very careful where to set the mapping plane. The BC basically looks for the cells closest to where you want to have the plane so the location becomes directly dependent on your mesh. A coarser mesh with therefore map from an other plane that a fine mesh and both will therefore result in a different spacing between the ribs.

Modifying channelFoam to include RANS-models is pretty straightforward and using cyclic bc is a lot easier than mapped BC and, more importantly, the geometry won't change if you change the mesh.

Just as a side note. One difference between both approaches will be in the pressure field. simpleFoam will give you a solution which includes the pressure gradient while channelFoam will give you the pressure field without the externally imposed pressure gradient.

Regards,

L
Darth2013 is offline   Reply With Quote

Old   July 17, 2013, 07:25
Default
  #20
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 22
Lieven will become famous soon enough
Hi Steven,


You should be able to set the gradP using the fvOptions-functionallity in OF 2.2. I'm still working with OF 2.1.x so I can't really help you with the details about this.

Alternatively (but less favourable option) you can simply look up the channelFoam.C file of OF 2.1.x via Google and check how it is implemented in there.

Cheers,

Lieven
Lieven is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Domain Imbalance HMR CFX 5 October 10, 2016 05:57
Open Channel Boundary Conditions Issues Env FLUENT 8 June 28, 2016 16:05
[GAMBIT] Boundary layer mesh & map mesh in rectangular ribbed channel shayan_mv ANSYS Meshing & Geometry 20 November 4, 2012 07:42
boundary conditions for 3D channel flow with heat transfer Aloex FLUENT 1 February 22, 2011 12:28
boundary conditions for open rectangular channel pavan FLUENT 1 March 6, 2007 15:46


All times are GMT -4. The time now is 16:15.