|
[Sponsors] |
October 20, 2012, 11:46 |
Poiseuille flow in a channel
|
#1 | |||
Member
Camille
Join Date: Oct 2012
Posts: 54
Rep Power: 14 |
Hello I m new on open foam and I m trying to run a poiseuille flow.
I have defined my mesh in blockMeshDict with cyclic conditions. But actually I don't know if I have to run it with icoFoam or channel Foam. with icoFoam, the velocity diffuses until it reaches 0 with channelFoam it diffuses a little but not until 0. so I suppose I have to use channelFoam. But, channelFoam uses LEScalculation so I put a laminar LESModel in LESproperties file. is that right? I also introduces a constant velocity in the internaField. for the moment I have zeroGradient condition for the pressure but I'd like to indroduce a linear gradient such as to have 2 (or 1) at the inflow and 1 (or 0.1 respectively) at the outflow. how do I have to change my 0/p file? thank you very much for your help. Quote:
Quote:
Quote:
|
||||
October 20, 2012, 15:38 |
|
#2 | |
Member
Meindert de Groot
Join Date: Jun 2012
Location: Netherlands
Posts: 34
Rep Power: 14 |
Quote:
However, I really want to encourage you to try and understand the code using Doxygen. The questions that you are asking can be answered by either searching the forum or by using the search box on http://www.openfoam.org/docs/cpp/. I will give you a quick answer. The difference between nuEff and nu is that nuEff is the sum of nu and nuSgs, where nuSgs is the subgrid-scale viscosity. If you are considering laminar flow, there is no difference. The definition of nuEff might be different for different subgrid-scale models. You should try to check that yourself. T stands for transpose here, not temperature. Last edited by meindert; October 20, 2012 at 17:29. |
||
October 23, 2012, 10:32 |
|
#3 |
Member
Camille
Join Date: Oct 2012
Posts: 54
Rep Power: 14 |
Thank you fo your answer meindert.
i m now running the tutorial channel395 as you told me but it takes a long time. Is it necessary to run until endTime 1000 with such a small deltaT : 0.2 ? |
|
October 23, 2012, 11:55 |
|
#4 | |
Member
Camille
Join Date: Oct 2012
Posts: 54
Rep Power: 14 |
Finally I stopped it at 440 beacause it is too slow.
About ma problem of simulation poiseuille flow. I found a subject : http://www.cfd-online.com/Forums/ope...utlet-b-c.html which explains how to introduces a pressure gardient but it does not seems to work really well. $is t because I m not using 1.7.1 version of OpenFoam but version 2.1.1? or because I m using this with channelFoam and I can't? Actually I modified my previous 0/p file like that : (the 0/U file does not change) Quote:
Thank you for your help Camille |
||
October 23, 2012, 12:03 |
|
#5 |
Member
Meindert de Groot
Join Date: Jun 2012
Location: Netherlands
Posts: 34
Rep Power: 14 |
Hi Camille,
Have a look at the Courant number and you will realise that the value for deltaT is not that small for this particalur case. Is it necessary to run until time 1000? Maybe, maybe not. It should take about an hour and a half to complete the simulation. I think it would be good for your understanding to let the simulation finish. |
|
October 23, 2012, 12:24 |
|
#6 |
Member
Meindert de Groot
Join Date: Jun 2012
Location: Netherlands
Posts: 34
Rep Power: 14 |
To be honest, I am not sure if that will work with the channelFoam solver.
The channelFoam solver splits the pressure in periodic component and a pressure drop (called gradP). This allows you to use periodic boundary conditions. The input for the channelFoam solver is the flow rate and the channelFoam solver adjusts gradP to maintain this flow rate. After a certain time you will see that gradP stabilizes. So, given a flow rate, the channelFoam solver will give you a pressure drop. I realise this is the opposite of what you actually want. Perhaps you should try the above with the icoFoam solver. I am afraid I cannot help you beyond that point. |
|
October 23, 2012, 13:07 |
|
#7 |
Member
Camille
Join Date: Oct 2012
Posts: 54
Rep Power: 14 |
Ok maindert I will try with icoFoam and let you know after that . but before I have to wait for the end od channel395 :-) at the moment I m at 640 .
Thank you for the precisions |
|
October 23, 2012, 16:34 |
|
#8 | |
Member
Camille
Join Date: Oct 2012
Posts: 54
Rep Power: 14 |
Good evening ,
finally my computer just just down while running channelFoam tutorial.. it was too hot. I will have to use the computer of the university if I don't want to break my own computer^^ About the pressure gradient with icoFoam it seem to work now but... I don't know which value I have to choose. I ve chosen a uniform velocity for the internalField of 0.5 m/s in the x-direction and 0 in the 2 other ones. dx=d/n=1/40 so as we need a Courant number smaller or equal to one, dt must be smaller or equal to 0.05 . Actually I put 0.005 as in icoFoam tutorial. it is ok except when I change value for the pressure. and at the end of the simulation I get this image : http://imageshack.us/photo/my-images/694/pt05.jpg/ for the code described below: Quote:
Thank you Cam |
||
October 24, 2012, 08:34 |
|
#9 |
Member
Meindert de Groot
Join Date: Jun 2012
Location: Netherlands
Posts: 34
Rep Power: 14 |
Hi Camille,
The flow is pressure driven, so the pressure will affect the velocity field. You will see this in the Courant number of course. Regarding the pressure field, I think you need to think about what you want exactly. Do you want to fix a certain pressure drop or do you want set a specific flow rate? You have probably noticed there is something going on in the pressure field near the periodic boundaries. I am not familiar with the fan type, but I would say this should alarm you. Think about it. If you impose a pressure drop over your domain, it will create a discontinuity in the pressure field if you use periodic boundary conditions. This explains the sharp pressure increase near the inflow and the outflow. Unless the fan type does something magical, you need to do something about this. You could do two things now. Option one is accept that you do not know your pressure drop in advance and set a certain flow rate, in which case you would go with the channelFoam solver. I am not sure if you have tried running the chan395 tutorial case without touching any of the settings. If you have not done that yet, I would advise you to do so. Use it to understand what the channelFoam solver does exactly. Option two is modifying the icoFoam solver by splitting the pressure in a periodic component and a pressure drop in a similar way as the channelFoam solver does. I am sure people have done this before, so try searching the Internet a bit if you decide to do this. I would say option one is by far the easiest way to go, especially if you do not have much experience with OpenFoam. Last edited by meindert; October 24, 2012 at 09:18. |
|
October 25, 2012, 12:26 |
|
#10 |
Member
Camille
Join Date: Oct 2012
Posts: 54
Rep Power: 14 |
Hi Meindert,
Thank you for your answer. Of course I noticed something was wrong with my boundaries but I didn't run channel395 because my computer does not seems to support it.. Actually I would like to impose a pressure drop and not a specific flow rate. Going into icoFoam code seems quite difficult :-/ |
|
October 25, 2012, 12:44 |
|
#11 |
Member
Camille
Join Date: Oct 2012
Posts: 54
Rep Power: 14 |
With channelFoam I obtain a pressure field like that : http://imageshack.us/a/img109/3633/pt05w.jpg
does not seems good either. |
|
October 25, 2012, 13:29 |
|
#12 |
Member
Meindert de Groot
Join Date: Jun 2012
Location: Netherlands
Posts: 34
Rep Power: 14 |
Hi Camille,
In which cell did you set the reference pressure? Try to set it in a cell which is not too close to the boundaries. I have been told that setting the reference pressure in a cell too close to the boundaries might cause unwanted numerical behavior. I understand you are not happy with this pressure field, but I would like to remind you that the pressure field represents the periodic component of the pressure for a channelFoam case. The pressure drop gradP is stored separately in the time directories in a subdirectory called uniform. |
|
October 25, 2012, 13:36 |
|
#13 | |
Member
Camille
Join Date: Oct 2012
Posts: 54
Rep Power: 14 |
euh... is it in fvSolution file that I have to change pRefCell and pRefValue? they are set both to 0 as in the tutorial. which values shouldd I try?
you say Quote:
|
||
October 25, 2012, 13:49 |
|
#14 |
Member
Meindert de Groot
Join Date: Jun 2012
Location: Netherlands
Posts: 34
Rep Power: 14 |
You can leave pRefValue at 0. Actually, it does not really matter which value you set there. In a closed system only pressure differences are important.
The value of pRefCell depends on the size of the grid. Cell 0 is a corner cell. I am sure you can find a cell that lies inside the domain. Of course you have time directories. How else would you access the data? Every time step data is stored in a time directory, e.g. a directory called 1000. |
|
October 25, 2012, 14:05 |
|
#15 |
Member
Camille
Join Date: Oct 2012
Posts: 54
Rep Power: 14 |
oh yes sorry I didn't understand but now I ve found. gradP is a .raw file and when i open it, it shows me a black window..
Other question, how can I know that a particular cell won't be onthe boundary? |
|
October 25, 2012, 14:34 |
|
#16 |
Member
Meindert de Groot
Join Date: Jun 2012
Location: Netherlands
Posts: 34
Rep Power: 14 |
Have you read the User's Guide? If you know how the mesh is created with the blockMesh utility, a simple calculation will give the cell number of any cell. Another way to find the cell number is by using Paraview, but for a simple geometry you should not have to use that. Read the User's Guide. You could also benefit from reading the Programmer's Guide in addition to that.
|
|
October 31, 2012, 07:38 |
|
#17 |
Member
Camille
Join Date: Oct 2012
Posts: 54
Rep Power: 14 |
Sorry I was away for a few days.
Y es i have read the user guide but I don't see where they explain how the cells are numbered. what is the computation to do? And how to see these numbers in Paraview? with wireframe I can see the cells but not their number... I have defined hex (0 1 2 3 4 5 6 7) (40 20 1) simpleGrading (1 1 1) So : 40 cells in x-direction 20 cells in y-direction 1 cell in z-direction. Ok but where do we begin to count? |
|
November 1, 2012, 06:00 |
|
#18 | ||
Member
Camille
Join Date: Oct 2012
Posts: 54
Rep Power: 14 |
Hi,
finally I obtain something that seems better using icoFoam and not cyclic condition. here are the plot at the end of the simulation : p : http://img440.imageshack.us/img440/1235/pt05.jpg U : http://img89.imageshack.us/img89/1756/ut05m.jpg and the significant part of the code : 0/p file Quote:
Quote:
But I don't know if I can be satisfied of the plot of the initial condition at t0: for U it's value 0 everywhere, not interesting for p : http://img507.imageshack.us/img507/4530/pt0hv.jpg I would like the p field inside to decrease linearly from 5 to 4 and not to fall down to 0 between the BC. is it possible? I suppose I have to change in 0/p field the internalField. Can I put a gradient condition? Thanks you in advance for your help |
|||
November 1, 2012, 07:30 |
|
#19 |
Member
Meindert de Groot
Join Date: Jun 2012
Location: Netherlands
Posts: 34
Rep Power: 14 |
Have a look at swak4Foam (http://openfoamwiki.net/index.php/Contrib/swak4Foam). With the funkySetFields utility you should be able to do what you want.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Channel flow using InterFOAM | DanM | OpenFOAM Running, Solving & CFD | 49 | July 31, 2020 12:43 |
Yacht in Open Channel Flow | andreimour | FLUENT | 1 | October 15, 2010 00:54 |
Stabilizing turbulence equation in channel flow | Biga | Main CFD Forum | 5 | March 22, 2005 21:06 |
Channel flow - Galerkin method | Ingo Meisel | Main CFD Forum | 1 | November 15, 2002 06:15 |
Inviscid Drag at subsonic, subcritical Mach # | Axel Rohde | Main CFD Forum | 1 | November 19, 2001 13:19 |