ribbed channel / simpleFoam / boundary conditions
Dear foamErs,
my task is as follows: http://dl.dropbox.com/u/21134978/drawing3.png http://dl.dropbox.com/u/21134978/drawing.pdf  GENERAL ASPECTS  I want to simulate a ribroughened 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:
Furthermore, I repeated the first approach but specified a uniform velocity at the inlet accompanied with an internal field of ( 0 0 0 ). Code:
3. Extend the computational region at the lefthandside. 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. http://dl.dropbox.com/u/21134978/drawing6.png 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 cyclicrelated 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 doubleposting and thanks for your answers. Happy Thanksgiving, Beeo http://dl.dropbox.com/u/21134978/drawing.eps 
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 inletoutlet 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 
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 conditionrelated 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 
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 RANSmodels 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 
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 
How to set fixed pressure gradient instead of fixed flow rate in channelFoam？
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.

It's pretty straightforward to change channelFoam for this. Have a look at the source code. Change the gradPvariable 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 Ubarinput.
Regards, L 
Thank you Lieven, I tried it and succeeded!

Quote:
I have met with the similar problem with you. I want to modify the channelFoam to include Ransmodel, but I didn't compile it successfully. So may I have a look at your modified solver? Regards, Sunxing 
1 Attachment(s)
Quote:
of course. Please find attached the corresponding file. Let me know if you are facing further problems. Beeo 
Hi Beeo,
Thanks for your shared file. Best, Sunxing 
Quote:
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 
Hi demur,
what is your question actually? Beeo 
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 
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 topbottom. thank you demur 
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 
1 Attachment(s)
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, 
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:

no more channelFoam!
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:

Hi Steven,
You should be able to set the gradP using the fvOptionsfunctionallity 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 
All times are GMT 4. The time now is 11:23. 