|
[Sponsors] |
May 18, 2009, 06:00 |
How to set up BCs for k epsilon model
|
#1 |
Member
Julian Krick
Join Date: May 2009
Location: Guelph
Posts: 88
Rep Power: 17 |
Hi,
I started to use OpenFOAM 2 weeks ago and as an exercise I would like to simulate the "elbow"-tutorial of Fluent's tutorial guide. http://193.204.76.120/fluent6.2/help/html/tg/node12.htm I set up the BCs for U and p, however I do not know how to define the BCs for k and epsilon. First of all, I calculated k according to k = 1/2 * (u'_x² + u'_y² + u'_z²) Since the elbow geometry has 2 inlets, I calculated two k, one for each inlet: k_1 = 0.02 m² s¯² k_2 = 0.5 m² s¯² Now, I'd like to set the k file in the /0 directory. However, I don't know which patch field types I shoud use for the different patches. Should I use 'fixedValue' at the inlets and set the internal field to uniform 0 ? At the walls and the outlet I'd then apply a 'zeroGradient'. I calculated epsilon to be eps_1 = 0.01641 m² s¯³ eps_2 = 2.05122 m² s¯³ for the two inlets. Here I though of using 'fixedValue' at the inlets, 'zeroGradient' at the walls and the outlet and setting the internal field uniformly to a value between eps_1 and eps_2, for instance to 1. Was my choice okay, or do you have any suggestions? Bye, Julian
__________________
grid generation: ICEM CFD 13.0 solver: CFX 13.0 |
|
May 18, 2009, 10:20 |
|
#2 |
Senior Member
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 21 |
Hi and welcome to the daily fight against the elements (of OpenFOAM),
the BC should be inlet:the internal field value you can set the same as the inlet value, sometimes it helps starting the calculation. but mostly it seems to be so unimportant. Anyway it will be overwritten after the first timestep. The values for epsilon and k also seem to be uninteresting. just give a k intensity and it will calculate its values itself. |
|
May 18, 2009, 12:32 |
|
#3 |
Member
Julian Krick
Join Date: May 2009
Location: Guelph
Posts: 88
Rep Power: 17 |
Hi,
thank you very much for the answer! Just another short (greenhorn) question: In which file do I have to define the 'k intensity' (by 'k intensity' you mean 'turbulence intensity', don't you)? In case I define just the 'k intensity', will I have to initialise the internal field for k/epsilon with 0 and set the patch types to 'zeroGradient'. cheers, Julian
__________________
grid generation: ICEM CFD 13.0 solver: CFX 13.0 |
|
May 19, 2009, 06:00 |
|
#4 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40 |
Quote:
inlet:It is 'mostly' irrevelant which values you take for the initial k/epsilon/omega fields, but initializing with zero for things like epsilon is likely to be a bad idea (== no dissipation and/or divide-by-zero problems). Using an inletOutlet for the outlets also seems to be a good idea. It works the same as a normal outflow, but if the flow happens to reverse, you have a defined boundary condition. Remeber that the pressure is NOT relative in compresssible cases (ie, zero would be really bad idea). After making a transcription error once (Pa vs. bar), I always use the OpenFOAM dictionary expansion function. For example in 0/p: internalField uniform 1.0e5; boundaryField { ... outlet { type fixedValue; value $internalField; } } /mark |
||
February 2, 2010, 06:27 |
|
#5 | |
New Member
Juan Manuel Mompó Laborda
Join Date: Nov 2009
Location: Valencia (Spain)
Posts: 10
Rep Power: 17 |
Quote:
I have a question: What does "$internalField" means (as a defined value for the outlet)? Does it mean that the value for the surface is the one of the cells that shares with the fluid? Or it takes another value? Thanks a lot Juanma |
||
February 2, 2010, 06:41 |
|
#6 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40 |
Quote:
In this example, Code:
internalField uniform 1.0e5; boundaryField { ... outlet { type fixedValue; value $internalField; } } If you are playing about with using the dictionary variables, the utility "expandDictionary" can come in quite handy to verify that your dictionaries are actually getting expanded as desired. |
||
February 3, 2010, 04:47 |
|
#7 | |
New Member
Juan Manuel Mompó Laborda
Join Date: Nov 2009
Location: Valencia (Spain)
Posts: 10
Rep Power: 17 |
Quote:
I understand what you mean but, thinking in the initialization of the case for 0/k and 0/epsilon, if the inlet is defined as fixedValue for these variables, it will maintain the same value for all the iterations and depending on the definition for the others variables (i.e. p as fixedValue and U as zeroGradient) It would be better not to set the the turbulent variables as "fixedValue" but as "calculated". Is that true? Is there any problem to initialize k and epsilon as calculated at the inlet? Thanks again. Juanma |
||
February 3, 2010, 04:57 |
|
#8 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40 |
Quote:
|
||
August 27, 2010, 06:50 |
|
#9 |
Senior Member
Nilesh Rane
Join Date: Apr 2010
Posts: 122
Rep Power: 16 |
hello All,
What would be better choice for specifying turbulence parameters??? "fixedValue" or "calculated through turbulent intensity and mixing length like turbulentIntensityKineticEnergyInletlike" ??? I suppose this should not matter as far as i am giving same BC for k and eps and omega etc.
__________________
Imagination is more important than knowledge..
|
|
September 8, 2010, 19:15 |
|
#10 | |
Senior Member
|
Quote:
please tell me how and where can i define turbulent intensity ( i want 5%) for inlet velocity. Regards. |
||
September 9, 2010, 04:08 |
|
#11 |
Senior Member
Nilesh Rane
Join Date: Apr 2010
Posts: 122
Rep Power: 16 |
Put this in "/0/k" file for inlet. 0.05 corresponds to 5%. The value is actual value of k that you can calculate from 5% Turb intensity. I am not sure whether it is significant or nor, but i think its better to use appropriate value nevertheless.
Code:
inlet { type turbulentIntensityKineticEnergyInlet; intensity 0.05; value uniform 60; }
__________________
Imagination is more important than knowledge..
|
|
September 9, 2010, 04:53 |
|
#12 | |
Senior Member
|
Quote:
You mean it is not necessary to define anything in 0/u file. if no, what is the meaning of this phrase? : Code:
boundaryField { inlet { type turbulentInlet; referenceField uniform (1 0 0); fluctuationScale (0.05 .01 0); value uniform (1 0 0); } |
||
September 9, 2010, 07:31 |
|
#13 |
Senior Member
Nilesh Rane
Join Date: Apr 2010
Posts: 122
Rep Power: 16 |
I have never used turbulentInlet as such, but i am guessing that you specify the turbulence in terms of fluctuating velocity (as in u+u'). I have no idea how exactly this BC works. You can specify turbulence this way as well, no doubt, but i think this is much specific way than giving turbulent intensity, which is approximate guess generally speaking. And if i am not wrong, turbulentInlet is not meant for RANS. It makes sense to use it for LES/DNS. In RANS we always solve equations for mean values and not for fluctuating part of any variable.
Even though you specify turbulence in "/0/u" file, still you need to initialize k and epsilon/omega in respective files. So to me specifying turbulence in k file makes more sense. I can't think of a way for calculating velocity fluctuations for specifying turbulence. How would you know what values to give?? At least i have never seen specifying turbulence with velocity fluctuations.
__________________
Imagination is more important than knowledge..
|
|
September 9, 2010, 07:40 |
|
#14 |
Senior Member
Nilesh Rane
Join Date: Apr 2010
Posts: 122
Rep Power: 16 |
This is the description of turbulentInlet BC given in source code.
Description Generate a fluctuating inlet condition by adding a random component to a reference (mean) field. Input: referenceField Mean field. fluctuationScale RMS fluctuation, provided as the fraction of the mean field. alpha temporal correlation factor; the fraction of the new random component added to the previous time-step (defaults to 0.1).
__________________
Imagination is more important than knowledge..
|
|
September 9, 2010, 08:51 |
|
#15 | |
Senior Member
|
Quote:
as you mentioned turbulentInlet is for LES/DNS. i searched in tut files and not found this inlet type for RAS. i will add intensity to k and compare results with benchmark. Best. |
||
May 26, 2011, 15:07 |
|
#16 | |
Member
The True
Join Date: Dec 2010
Posts: 80
Rep Power: 16 |
Quote:
The BC settings are not correct. k-epsilon needs wall treatment. I don't if the other settings are oke ! |
||
May 26, 2011, 16:43 |
|
#17 | |
Senior Member
|
Quote:
If your mesh be refined near wall and yPlus value be less than ~5 you don't need to use wallFunction and zeroGradient is the correct choice. Best, |
||
May 27, 2011, 05:49 |
|
#18 | |
New Member
Juan Manuel Mompó Laborda
Join Date: Nov 2009
Location: Valencia (Spain)
Posts: 10
Rep Power: 17 |
Quote:
That's right. Under a certain threshold for y+ the mesh can reproduce reasonably the growth of the boundary layer. BUT, I try to define k and epsilon as a zeroGradient and OF renames my k and epsilon files (as *.org) and writes a new ones with the wallFunctions inside the patch of the wall. Any suggestion? Thanks in advance, Juanma |
||
May 27, 2011, 06:00 |
|
#19 |
Member
The True
Join Date: Dec 2010
Posts: 80
Rep Power: 16 |
I am running k-epsilon model with the simpleFoam solver, but the results are not converging. The initial residual for pressure remains the same after some value, in this case 0.002.
BC: U file inlet freestream value() outlet zeroGradient wall fixedValue p file inlet freestreamPressure outlet zeroGradient wall zeroGradient k file inlet fixedValue (20) outlet zeroGradient wall kqRWallFunction (20) epsilon file inlet fixedValue (50) outlet zeroGradient wall epsilonWallfunction (50) nut file inlet freestream (0) outlet zeroGradient wall nutWallFunction (0) Can someone point out the wrong BC, please. |
|
May 30, 2011, 07:16 |
|
#20 |
Member
The True
Join Date: Dec 2010
Posts: 80
Rep Power: 16 |
is there nobody on the forum with k-epsilon-openfoam experience ?
|
|
Tags |
boundary conditions, eps, epsilon, initiallisation, turbulence |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to set an equilibrium-Air model | jorge sancho | CFX | 4 | August 24, 2015 07:32 |
radial fan model bc's | seza | FLUENT | 2 | December 27, 2013 04:52 |
Porous model | jack | FLUENT | 2 | August 11, 2008 05:16 |
Help: Set Up model in CFD with time | Ranie Go | Main CFD Forum | 5 | October 7, 2003 06:12 |
Advanced Turbulence Modeling in Fluent, Realizable k-epsilon Model | Jonas Larsson | FLUENT | 5 | March 13, 2000 04:27 |