CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   BC -> k e simpleFoam (https://www.cfd-online.com/Forums/openfoam-solving/98996-bc-k-e-simplefoam.html)

soonic April 13, 2012 04:43

yes, I used the same approach to initialize.
If I wanted to drive the flow with 0.5Pa, I computed the velocity. The velocity would be ~0.9m/s. Check the Re, to identify the flow character. Then set the pressure BC value to p/rho = 0.5 / 1.23 to get velocity ~ 0.9m/s in pipe. I can be wrong. I am not an expert.

If you want to compare the solvers for the same k and € for OF and fluent, you should probably have a look at what values are coming to equations. That approach is the only one comparable. Who knows what correction is done before the solver gets value written as BC. As I saw, you thought about it already, and I have the same idea.

When you want to compare, you should give the boundaries correct values atleast in scale (as far you need to have physics correct on the BC). The value at BC will not change over the solution. It drives the solution to that value, so It have to be set correctly. Like the solution will go the way to have 0.5Pa on inlet faceCell and zero velocity on the wall. When you will have 1 for € and k, it will do everything to keep that values. When they are wrong, your solution diverges becouse of non-solvable case. For k and € there are several boundary types computing the value from length scale and intensity of turbulence. I do not know how to use them.

The initial value does not matter too much, it should be computed over domain, but strange value can push the solution to diverge too. Why not. Help the solution as much as you know :)

klio April 13, 2012 06:26

yes you are right !!

I GOT IT!!!!!!

@ lobstar: What are your k and eps in fluent and what is your hydraulic diameter D?

in my fluent simulation k and eps were both 1! Because of the formula e = c_nu ^(3/4)* (k^(3/2)/L) -> L = 0.07*D the values are only in right for a D of about 2.3 m. but if you have a D of 6mm like I do Open Foam means that this can not be possible and crashes or calculates wrong velocities. So it assumes that the user knows what he does ;)

Fluent is that much intelligent that it can correct wrong initial contritions set by the user! You will get gradients were you can see the correction from input value to realistic value but then it works!

You can also set wrong k and e in OpenFoam and you will also get correcting gradients but the ratio of them has to fit to your geometry

HTH

klio April 16, 2012 04:45

@soonic: Do you have experience with heat transfer sim?

soonic April 16, 2012 14:13

A little. What about new thread ?

Describe what is your aim but first check some heat transfer tutorials and a solver suitable for your problem

klio April 17, 2012 02:25

Hi!

This is the link to the new thread!

http://www.cfd-online.com/Forums/ope...implefoam.html

But now just want to do a compressible flow but i really don't understand what p_rho does. But you will see in the new thread!

thanks a lot for your help!

lobstar April 17, 2012 06:33

Congrats Kilo! Glad you managed to work it out! I just wanted to ask what bc you used for k and e? I'm using the values calculated by fluent with fixedValue inlet, zeroGradient outlet and respective wall function for walls but still getting very large velocities! Is that what you used?

klio April 18, 2012 08:04

Quote:

Originally Posted by lobstar (Post 355108)
Congrats Kilo! Glad you managed to work it out! I just wanted to ask what bc you used for k and e? I'm using the values calculated by fluent with fixedValue inlet, zeroGradient outlet and respective wall function for walls but still getting very large velocities! Is that what you used?

How did you get the values?

Because its not very clear how fluent calculates k and epsilon!

It is better you calculate them on your own!
http://en.wikipedia.org/wiki/Turbule...ary_conditions

my BC:

inlet --> fixed Value
outlet --> zeroGradient
wall --> WallFunction

klio April 19, 2012 02:59

Did you use totalPressure at Inlet?

lobstar April 19, 2012 03:59

Thanks for the tip on calculating k and eps!!! I had no idea before. I was using fixedValue for the inlet at the pressure. did you use/ would you recommend totalPressure?

klio April 19, 2012 09:58

Yes you have to take totalPressure because if you just fix the Value in field p you fix the static pressure. you can calculate the total pressure in the visualization tool with p0 = p*rho + rho/2 * abs(u_magnitude)ē!

And because of that same k and eps have to be set as in fluent! so forget what i said before. it realy doesent matter what k an e you take when the ratio is ok for your geometry! It will just change the number of iterations you need for convergence and your sim time.

so just set inlet :
p0 *your totalPressure value*/rho;
gamma 1;

and you should also take the same converge settings as in fluent maybe your simulation stops to early (e & k : minimum 1e-4 )

lobstar April 19, 2012 10:16

Thanks Kilo! I really appreciate the help. I'll try your recommendations and let you know how it goes! Hope you're having some luck with your heat transfer case!

klio April 19, 2012 15:59

hmm works not that bad! It took me a little time to find out how to handle with atmospheric pressure but soonic gave me the input I needed to solve a simple case (flow in a pipe again!!!):)

Tensian July 2, 2013 14:13

bc for pressure driven flow
 
Hi everyone,

I was Reading your post and I think maybe you can help me, because I am trying to simulate a pressure driven flow across a complicated cannel: I donīt have any information about values over inlet and outlet, I only know that pressure inlet value is 0 Pa (due to atmospheric pressure) and pressure outlet is -20 Pa. I am running simpleFoam in laminar regime, and in a few iterations velocity and pressure explodes, with no physical meaning. It looks similar like the problema you are discussing right? (I donīt speak English very well so I donīt understand some parts of the conversation).
I tried changing fixedValue for pressureInletOutletVelocity, using pyFoamPotentialFlow for initialize (with errors)...and nothing makes it runs.
Any idea will be really apreciated, I am getting crazy! Fluent just do it inmediatly!
What do you think? (it looks easy but I canīt do it alone!)
Best regards.

izna July 2, 2013 15:10

hi
you need to insert a value of velocity in your model..

also you can read about how to manipulate the tutorials first.
i advice you to first start with the cavity tutorials and then the elbow tutorials. This would help you in understanding better how to edit Your project accordingly..

best of luck
izna

Tensian July 3, 2013 10:45

Hi Izna,

Thanks for the reply. I canīt give any value for velocity, because itīs not known!
Is really impossible to make the setup in terms of pressure difference between inlet and outlet? In FLUENT thereīs no problem with these...
I canīt believe it. Maybe I have to implement something to make this possible...
Anymore ideas?

Cheers.


All times are GMT -4. The time now is 04:27.