# BC -> k e simpleFoam

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

 March 23, 2012, 07:47 BC -> k e simpleFoam #1 Member   Klio Join Date: Mar 2012 Location: Austria Posts: 45 Rep Power: 6 Hello! I tried to simulate a simple airflow with the kEpsilon model, solver simpleFoam. a totalPressureInlet with 0.44 pa is given. Velocity has to be calculated. The residuals and the continuity looks good but the velocity much to small about 1e-06. the Solution should be about 0.35 m/s. BC: U: internalField uniform (0 0 0); outlet: type zeroGradient; inlet: type pressureInletVelocity; value uniform (0 0 0); wall: type fixedValue; value uniform (0 0 0); ------------------------------------------------------------ p: internalField uniform (0 0 0); outlet: type zeroGradient; inlet: type totalPressure; p0 uniform 0.44; value uniform 0.44; gamma 1; wall: type zeroGradient ------------------------------------------------------------ epsilon: internalField 0.02247; outlet: type zeroGradient; inlet: type turbulentIntensityKineticEnergyInlet; intensity 0.001; value uniform 0.02247; wall: type epsilonWallFunction; value uniform 0.02247; --------------------------------------------------------------------------------------- k internalField uniform (0 0 0); outlet: type zeroGradient; inlet: type turbulentMixingLengthDissipationRateInlet; mixingLength 0.01; value uniform 1.356e-03; wall: type kqRWallFunction; value uniform 1.356e-03; Has anyone a hint for me ?

 March 23, 2012, 09:32 #2 Senior Member     Kyle Mooney Join Date: Jul 2009 Location: Amherst, MA USA - San Diego, CA USA Posts: 320 Rep Power: 10 I'm guessing it is an issue with your p and U boundary conditions. Neither of them actually drive a flow. You'd need something like a fixed value U or a fixed pressure gradient to get some momentum into the domain.

 March 27, 2012, 03:53 #3 Member   Klio Join Date: Mar 2012 Location: Austria Posts: 45 Rep Power: 6 Hi! Thanks for your quick reply! With fixedGradent instead of fixedValue in my pressure inlet BC i got a flow in my flow simulation .

 March 28, 2012, 02:37 #4 Member   Klio Join Date: Mar 2012 Location: Austria Posts: 45 Rep Power: 6 Ok but now i got the problem that the pressure decreases at the inlet. i thought fixed Gradient is NOT variable. Do you have an idea what goes wrong there?

 March 28, 2012, 12:50 #5 New Member     Peter Join Date: Apr 2010 Location: Brno, Czech Republic Posts: 24 Rep Power: 8 Perhaps nothing is wrong. You fixed the gradient, not the value.

 March 29, 2012, 06:56 #6 Member   Klio Join Date: Mar 2012 Location: Austria Posts: 45 Rep Power: 6 hmmm... Thanks! But I have the Problem that I just know the fix pressure value at the inlet and if I only fix the Value there, there is nothing which drives my Flow. so should I fix the value and the gradient at the inlet and how does it works ?

 March 29, 2012, 08:47 #7 New Member     Peter Join Date: Apr 2010 Location: Brno, Czech Republic Posts: 24 Rep Power: 8 what is the dimension of the p variable you have prediscribed ? check if it is not p/rho. And you have maybe correct solution for the wrong task.

 March 29, 2012, 08:57 #8 Member   Klio Join Date: Mar 2012 Location: Austria Posts: 45 Rep Power: 6 yes it is p/rho! My pressure is about 0.5 pa, rho is 1.225 so my PressureValue is about 0.44 an the solution is about 2000 times smaller! I also tried to set initial conditions with potentialFoam but either my velocities are much to small or much to high!

 March 29, 2012, 09:16 #9 Member   Klio Join Date: Mar 2012 Location: Austria Posts: 45 Rep Power: 6 I think I can't really imagine how the BC at inlet and outlet of U and P should be set correctly. When I take a look at the examples I can only find BC where the velocity is known. Not so in my case!

March 29, 2012, 09:43
#10
New Member

Peter
Join Date: Apr 2010
Location: Brno, Czech Republic
Posts: 24
Rep Power: 8
try attached case with simpleFoam. It seems fine with your values on D=1cm pipe.

(it is based on case_pipe_viscous_heating for mySimpleFoam solver found on that forum)

edit: it is only laminar case.
Attached Files
 pipe_pressure.tar.gz (3.4 KB, 33 views)

Last edited by soonic; March 29, 2012 at 09:50. Reason: typo

 March 29, 2012, 09:49 #11 Member   Klio Join Date: Mar 2012 Location: Austria Posts: 45 Rep Power: 6 Ok I'll try it thank you very much. Hope that even works in k e model

 March 29, 2012, 11:33 #12 New Member     Peter Join Date: Apr 2010 Location: Brno, Czech Republic Posts: 24 Rep Power: 8 yes, it do. Tried with 10Pa on inlet to have Re in turbulent zone.

 March 30, 2012, 02:24 #13 Member   Klio Join Date: Mar 2012 Location: Austria Posts: 45 Rep Power: 6 Thank you very much for this nice example. I took same BC for k-e-Model and it didn't worked!

 March 30, 2012, 07:41 #14 Member   Klio Join Date: Mar 2012 Location: Austria Posts: 45 Rep Power: 6 Hi at all! now the Laminar model works! But if I take the same BC as in the laminar model for the kE-Modell it doesn't work! My BC are: k & epsilon interiorField: 1 pressure_inlet: 1 pressure_outlet: 1 wall: WllFunktion 1 p interiorField: 0 pressure_inlet: 0.44 pressure_outlet: 0 wall: zeroGradient U interiorField: (0 0 0) pressure_inlet: zeroGradient pressure_outlet: zeroGradient wall: (0 0 0) Can anyone help me?

 April 2, 2012, 07:24 #15 New Member     Peter Join Date: Apr 2010 Location: Brno, Czech Republic Posts: 24 Rep Power: 8 what is not working? descrbie more. Is your Re in turbulent zone ? Try initialize the case with higher eps values and add approximate/correct values for k and eps at your BCs. the test case with values of one "does not work" too. Correct values will make it.

 April 3, 2012, 01:52 #16 Member   Klio Join Date: Mar 2012 Location: Austria Posts: 45 Rep Power: 6 Thinks for your help! In my case i have to compare fluent with openFoam! So i got a simulation from my college with given BC. And to compare it correctly I have do set the same initial condition as he did. Which is k & epsilon is 1 the pressure is 0.5 (in my case 0.44 because of dimensions) and velocity is not known. so its not possible to change the values. If I set the BC like shown before the simulation crashes with errors! I think because of the bounding variables (up to inf) -> velocities higher than 1e+20. I also tried to set BC of k eps at the walls to zeroGradient it also didn't work. Its also diverging

April 3, 2012, 03:22
#17
New Member

Peter
Join Date: Apr 2010
Location: Brno, Czech Republic
Posts: 24
Rep Power: 8
I tryed to set correct values for pressure to have turbulent flow and set calculated values for k and eps and there is the case again.
I still do not know, how big is your pipe. I just bet, that correct values for k and epsilon are thousand times smaller than one.
Attached Files
 pipe_pressure_turb.tar.gz (3.9 KB, 18 views)

 April 3, 2012, 04:47 #18 New Member   Oluwalogbon Akinnola Join Date: Mar 2012 Posts: 23 Rep Power: 6 Hi kilo, I'm having the exact same problem as you. I'm also trying to do a comparison between fluent and openfoam using a turbulent flow. I've also tried using simplefoam and the k-e model. I haven't been able to get the simulation to work using a set pressure drop and having velocity calculated, but used my results from the fluent to set the boundary conditions and I'm also getting velocities of 1e20. I haven't been able to get soonic's suggestions to work for me. Have you had any luck?

 April 3, 2012, 09:56 #19 Member   Klio Join Date: Mar 2012 Location: Austria Posts: 45 Rep Power: 6 hi! @soonic: hmm ... my Model is a cube with a 0.006 m thick pipe (0.06 m long ) at the inlet and same at the outlet. I also have calculated the k and epsilon for the model but it must work somehow with the same input parameter a fluent gets. ive tried now : k & epsilon interiorField: 0 pressure_inlet: 1 pressure_outlet: 1 wall: zeroGradient p interiorField: 0 pressure_inlet: 0.44 pressure_outlet: 0 wall: zeroGradient U interiorField: (0 0 0) pressure_inlet: zeroGradient pressure_outlet: zeroGradient wall: (0 0 0) -----> IT WAS MUCH BETTER! but now the velocity is to small!! 0.002 instead of 0.35 @lobstar: no i had no luck!!! but i found out that k & epsilon & nut File should have same type of wall BC! and don't let OpenFoam generate your nut file or others automatically! if you found out anything please tell me - i'll do the same! you should also set the internal Field of k an epsilon 0, because i fond out that fluent also does so! and if you don't know what fluent does you can tell fluent to write out bc and then you get an acci file (terrible to read but lots information in it!) lobstar likes this.

 April 3, 2012, 10:15 #20 Senior Member     Kyle Mooney Join Date: Jul 2009 Location: Amherst, MA USA - San Diego, CA USA Posts: 320 Rep Power: 10 You might want to take a second swing at your k & E boundary/internal conditions. I'm not too familiar with setting up these kinds of models but those values look like they might be pretty off after looking at this setup: [tutorials/incompressible/simpleFoam/pitzDaily]. Perhaps try reading up on the models' best practices or looking at some of the other tutorials with k&E turbulence modeling already set up.

 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 herenger OpenFOAM Running, Solving & CFD 7 July 11, 2013 06:27 spsb OpenFOAM 3 February 24, 2012 10:07 tH3f0rC3 OpenFOAM 4 May 12, 2011 07:07 will.logie OpenFOAM 0 December 16, 2010 08:08 Pierpaolo OpenFOAM 1 May 8, 2010 03:08

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