|
[Sponsors] |
April 2, 2013, 13:05 |
Boundary Conditions for v2f turbulent model
|
#1 |
New Member
Blaž Mikuž
Join Date: Sep 2011
Location: Ljubljana
Posts: 29
Rep Power: 15 |
Hello,
I noticed that the new version of OF 2.2.0 contains implemented v2f turbulent model. Now, I'd like to use that model for flow in a channel or for flow through a tube. The problem is that there is no prepared case using v2f turbulent model in $FOAM_TUTORIALS directory, where one can see how to set the boundary conditions (BCs). I realized that you need 7 fields in 0 directory: U, p, nut, k, epsilon, f and v2. Firstly, what are correct dimensions for f and v2? Is dimension (1/s) for f and (m^2/s^2) for v2 correct? Secondly, what should be proper BC for f and v2 on the outlet? I followed the instructions for BC written in v2f.H file, but found them little incomplete... Thanks in advance for your help or any comment. Blaz |
|
April 2, 2013, 13:59 |
|
#2 | |
Senior Member
Chris Sideroff
Join Date: Mar 2009
Location: Ottawa, ON, CAN
Posts: 434
Rep Power: 22 |
bmikuz,
The - model was one of the turbulence models I investigated for my doctoral research. From the literature the following is what I learned to use for and boundary conditions. Inlet: Outlet: zero gradient for both Walls: If you want the justification and full discussion, I'll refer you to the original - paper by Paul Durbin and a PhD thesis by Andreas Sveningsson: Durbin, P.A., 1991 “Near-Wall Turbulence Closure Modeling Without ‘Damping Functions”’ Theoretical and Computational Fluid Dynamics Vol. 3, pp. 1-13 Sveningsson, A. 2003 “Analysis of the Performance of Different - Turbulence Models in a Stator Vane Passage Flow”, Ph.D Thesis, Chalmers University of Technology ISSN 1101-9972 http://publications.lib.chalmers.se/...e-passage-flow In particular, I found Sveningsson's thesis very helpful. And by the way, the - requires full resolution of the boundary layer, i.e. y+ <= 1. Hope that helps, Chris Quote:
|
||
April 2, 2013, 17:18 |
|
#3 |
New Member
Phillip
Join Date: Mar 2012
Location: Germany
Posts: 27
Rep Power: 14 |
@bmikuz: I have do some simulations with the new v2f turbulence model (the incompressible version) in OpenFOAM 2.2.0 and give you my boundary conditions. I think it can help you
U: Code:
dimensions [0 1 -1 0 0 0 0]; internalField uniform (1 0 0); boundaryField { inlet { type fixedValue; value nonuniform List<vector> 64 ( (0.111708 6.41525e-06 0) (0.322171 -1.26309e-05 0) (0.488089 5.5452e-06 0) (0.601945 -1.16204e-07 0) (0.681378 1.39714e-06 0) (0.74007 3.13196e-06 0) (0.785756 4.7772e-06 0) (0.822917 6.06065e-06 0) (0.854232 6.85654e-06 0) (0.881348 7.05289e-06 0) (0.905324 6.60611e-06 0) (0.926875 5.52305e-06 0) (0.946502 3.84961e-06 0) (0.964567 1.65758e-06 0) (0.98134 -9.65316e-07 0) (0.997026 -3.92283e-06 0) (1.01178 -7.11429e-06 0) (1.02574 -1.04334e-05 0) (1.03898 -1.37726e-05 0) (1.0516 -1.70166e-05 0) (1.0636 -2.00434e-05 0) (1.075 -2.27193e-05 0) (1.08579 -2.48985e-05 0) (1.0959 -2.64265e-05 0) (1.10529 -2.71472e-05 0) (1.11386 -2.69128e-05 0) (1.12153 -2.55954e-05 0) (1.12819 -2.3057e-05 0) (1.13373 -1.94304e-05 0) (1.13809 -1.47821e-05 0) (1.14115 -9.3311e-06 0) (1.14277 -3.1689e-06 0) (1.14277 3.30393e-06 0) (1.14115 9.46547e-06 0) (1.13809 1.49146e-05 0) (1.13373 1.9562e-05 0) (1.12819 2.31885e-05 0) (1.12153 2.57287e-05 0) (1.11386 2.70509e-05 0) (1.10529 2.72948e-05 0) (1.0959 2.65897e-05 0) (1.08579 2.50852e-05 0) (1.075 2.29391e-05 0) (1.0636 2.03078e-05 0) (1.0516 1.73391e-05 0) (1.03899 1.41684e-05 0) (1.02574 1.09186e-05 0) (1.01178 7.70432e-06 0) (0.997028 4.63039e-06 0) (0.981344 1.79609e-06 0) (0.964572 -7.09707e-07 0) (0.946509 -2.80824e-06 0) (0.926884 -4.43494e-06 0) (0.905335 -5.54543e-06 0) (0.88136 -6.12197e-06 0) (0.854244 -6.18138e-06 0) (0.822926 -5.77808e-06 0) (0.785759 -5.0163e-06 0) (0.740064 -4.00941e-06 0) (0.68136 -2.93789e-06 0) (0.601916 -1.92725e-06 0) (0.488061 -7.47706e-06 0) (0.322159 1.1563e-05 0) (0.111704 -6.52362e-06 0) ) ; } outlet { type zeroGradient; } walls { type fixedValue; value uniform (0 0 0); } frontAndBack { type empty; } } p: Code:
dimensions [0 2 -2 0 0 0 0]; internalField uniform 0; boundaryField { inlet { type zeroGradient; } outlet { type fixedValue; value uniform 0; } walls { type zeroGradient; } frontAndBack { type empty; } } epsilon: Code:
dimensions [0 2 -3 0 0 0 0]; internalField uniform 3.825E-5; boundaryField { inlet { type fixedValue; value uniform 3.825E-5; } outlet { type zeroGradient; } walls { type zeroGradient; } frontAndBack { type empty; } } k: Code:
dimensions [0 2 -2 0 0 0 0]; internalField uniform 3.75E-3; boundaryField { inlet { type fixedValue; value uniform 3.75E-3; } outlet { type zeroGradient; } walls { type fixedValue; value uniform 1.0E-15; } frontAndBack { type empty; } } nut: Code:
dimensions [0 2 -1 0 0 0 0]; internalField uniform 0; boundaryField { inlet { type calculated; value uniform 0; } outlet { type calculated; value uniform 0; } walls { // type calculated; // value uniform 0; type zeroGradient; // type nutLowReWallFunction; // value uniform 0; } frontAndBack { type empty; } } v2: v2(inlet) = 2/3*k(inlet) Code:
dimensions [0 2 -2 0 0 0 0]; internalField uniform 2.5e-3; boundaryField { inlet { type fixedValue; value uniform 2.5e-3; } outlet { type zeroGradient; } walls { type fixedValue; value uniform 1e-10; } frontAndBack { type empty; } } f: Code:
dimensions [0 0 -1 0 0 0 0]; internalField uniform 1e-10; boundaryField { inlet { type zeroGradient; } outlet { type zeroGradient; } walls { type fixedValue; value uniform 1e-10; } frontAndBack { type empty; } } I hope this helps you. Other assuptions for my case are:
|
|
April 3, 2013, 11:42 |
|
#4 |
New Member
Blaž Mikuž
Join Date: Sep 2011
Location: Ljubljana
Posts: 29
Rep Power: 15 |
Thanks a lot @cnsidero and @bscphil. You were of great help!
I used @bscphil's BCs and a "tutorial" simulation works now. Since my real case is quite big and contains a lot of vanes inside a tube, I cannot afford very dense mesh in the boundary layer. So my next step is using wall functions, which are also implemented in that v2f turbulent model... |
|
April 3, 2013, 11:50 |
|
#5 | |
Senior Member
Chris Sideroff
Join Date: Mar 2009
Location: Ottawa, ON, CAN
Posts: 434
Rep Power: 22 |
Good to hear.
Seems kind of dubious to me to use wall functions with the v2-f. The whole purpose of adding the v2 and f equations to the k-e model was to provide better scaling of the turbulent kinetic energy near the wall. The Durbin paper I reference discusses this at length. My point is, if you're going to use a wall-function with the v2-f, which will effectively override the benefit of the v2-f model, it's seems pointless to use it. Just my $0.02. Quote:
|
||
April 3, 2013, 12:29 |
|
#6 |
New Member
Blaž Mikuž
Join Date: Sep 2011
Location: Ljubljana
Posts: 29
Rep Power: 15 |
Ok, good to know that. I don't know much about the v2f turbulent model yet, but I checked the Description in the v2f.H file (attached to the post) and there are somehow recommended wall boundary conditions as follows:
k=kLowReWallFunction epsilon=epsilonLowReWallFunction v2=v2WallFunction f=fWallFunction There must be a good reason for implementing these wall functions in v2f model or isn't it? |
|
April 3, 2013, 12:53 |
|
#7 | |
Senior Member
Chris Sideroff
Join Date: Mar 2009
Location: Ottawa, ON, CAN
Posts: 434
Rep Power: 22 |
Quote:
But in general, the formulation of the v2-f was develop to handle resolved flows better than other 2 equation formulations of the k-e. I did notice in the v2f.H header they reference some newer papers, which I haven't read, but it's possible that they discuss near wall handling of v2 and f for y+ > 1. So while it can handle y+ > 1, my understanding of its benefit is that you should try to keep y+ <= 1. Of course, some validation against some know applications that demonstrate the v2-f benefits might be a good exercise. FYI, the near wall v2 and f behaviors are defined in v2WallFunctionFvPatchScalarField.C and fWallFunctionFvPatchScalarField.C where it checks for the yPlusLam value (edge of viscous sub-layer) and switches accordingly. Last edited by cnsidero; April 4, 2013 at 09:59. |
||
April 3, 2013, 19:52 |
|
#8 | |
New Member
Phillip
Join Date: Mar 2012
Location: Germany
Posts: 27
Rep Power: 14 |
Quote:
For me it make no sense to use wall functions in the v2f-model (don't know what the OpenFOAM developer want to do with these ?? ). I have read all newer and older papers about the v2f model and i dosn't find any near wall handling of v2 and f for y approx 30 like in an "high"-Re model. I read the v2f.H-file too and spend some time to simulate my diffuser testcase with the use of all wall functions ... the results with the use of wall functions are very bad:
|
||
April 4, 2013, 06:34 |
|
#9 |
New Member
Blaž Mikuž
Join Date: Sep 2011
Location: Ljubljana
Posts: 29
Rep Power: 15 |
Thanks for instructions to both of you. Since I already did a simulation with k-omega SST turbulence model (with wall functions), I'll have to follow your first suggestion @bscphil and add more layers at the walls. I hope that the mesh will not become significantly bigger than it is now (~40 millions cells).
About the @bscphil's testing of wallfunctions on diffusor: were the meshes of the same size in both cases (with and without wallfunctions)? |
|
April 4, 2013, 20:30 |
|
#10 | |
New Member
Phillip
Join Date: Mar 2012
Location: Germany
Posts: 27
Rep Power: 14 |
Quote:
To your question, no the meshes don't have the same size, because of wall functions i use a coarse mesh at the walls. I think about my case and i find my mistake, i used for the simulation with wall functions the mapped field of my first post for the velocity, this field was calculated with the "low-Re" LaunderSharmaKE model and represent a fully developed channel flow with near wall resolution --> i cancel this and use for velocity at the inlet: Code:
inlet { type fixedValue; value uniform (1 0 0); }
(--> the red lines are without wall functions and the green lines are with wall functions !!) Last edited by bscphil; April 5, 2013 at 05:27. |
||
April 4, 2013, 20:33 |
|
#11 |
New Member
Phillip
Join Date: Mar 2012
Location: Germany
Posts: 27
Rep Power: 14 |
ok the limit for upload stopped me, here is the rest....
Last edited by bscphil; April 5, 2013 at 05:27. |
|
April 8, 2013, 05:48 |
|
#12 |
New Member
Blaž Mikuž
Join Date: Sep 2011
Location: Ljubljana
Posts: 29
Rep Power: 15 |
First, my apology for late reply.
Thanks for sharing your results, which are more promising for me. My "tutorial" case was flow in a circular tube just to initiate/try v2f model. Now I want to use v2f for my "real" case, which is flow through fuel bundle of nuclear reactor. To be more specific, in my case fuel bundle is an array of 5×5 fuel rods which are held together with spacer grid (in the middle of sketch geo.jpg). At the outlet of spacer grid there are mixing vanes (spacer1.jpg), which serve for increasing the turbulence of the flow... So, the coolant (water) is flowing in a square channel along the rods. Reynolds number is around 50000, I want to run transient simulation with pisoFoam. Benchmark will be done with experimental measurements of velocity fields behind mixing vanes, so I'm not interested in skin frictions... Since I'm interested in velocity fields, the simulation with wall functions may be good enough? I'll probably prepare both simulations (with & without wall functions) but it will take some more time. |
|
March 24, 2014, 12:53 |
|
#13 |
New Member
Join Date: Mar 2012
Posts: 20
Rep Power: 14 |
Since I've been working with the v2f model for a while, I wanted to share with you some thoughts about the wall conditions.
For the v2f model implemented in openfoam, the boundary conditions at the wall for low-re cases are: k=1e-10 v2=1e-10 f=1e-10 (because of the code-friendly modification by Lien) nut=nutLowReWallFunction(i.e. =0) epsilon is not zero nor zeroGradient. epsilon = 2*nu*k1/y1^2, where k1 and y1 are the cell-center values at the wall. The wall function implemented in openfoam is supposed to take care of it (epsilonLowReWallFunction). But I had some problems using it, it makes the simulation diverge. I had a look at the code: Code:
if (yPlus > yPlusLam_) { epsilon[cellI] = w*Cmu75*pow(k[cellI], 1.5)/(kappa_*y[faceI]); } else { epsilon[cellI] = w*2.0*k[cellI]*nuw[faceI]/sqr(y[faceI]); } G[cellI] = w *(nutw[faceI] + nuw[faceI]) *magGradUw[faceI] *Cmu25*sqrt(k[cellI]) /(kappa_*y[faceI]); Code:
if (yPlus > yPlusLam_) { epsilon[cellI] = w*Cmu75*pow(k[cellI], 1.5)/(kappa_*y[faceI]); G[cellI] = w *(nutw[faceI] + nuw[faceI]) *magGradUw[faceI] *Cmu25*sqrt(k[cellI]) /(kappa_*y[faceI]); } else { epsilon[cellI] = w*2.0*k[cellI]*nuw[faceI]/sqr(y[faceI]); } If you want it, I'm attaching it to this post. it is called myEpsilonLowReWallFunction. just compile it and then add this to controldict: Code:
libs ( "myEpsilonLowReWallFunction.so" ); Code:
type groovyBC; valueExpression "2*nu*internalField(k)/sqr(mag(delta()))"; value uniform 1e-10; |
|
November 20, 2015, 06:22 |
|
#14 |
Member
SM
Join Date: Dec 2010
Posts: 97
Rep Power: 15 |
Hi, I tried to use the v2f model in OF and for that I ran boundaryFoam and compared to Channel395 DNS.
For High Reynolds Number (HRN) model (y+ > 30) I got quite good results with OpenFOAM recommended settings i.e. as attached Wall settings Code:
k = kLowReWallFunction epsilon = epsilonLowReWallFunction v2 = v2WallFunction f = fWallFunction nut = nutUSpaldingWallFunction; After googling and trying all possible combinations I got the best (yet not good) from following combination Wall settings Code:
k = kLowReWallFunction epsilon = fixedValue 1e-10 v2 = v2WallFunction f = fWallFunction nut = zeroGradient setting nut = zeroGradient and epsilon = fixedValue (1e-10) at walls. If you use any other as nutLowReWallFunction or epsilonLowReWallFunction results are way off. For k,v2,f you can also use fixedValue (1e-10) and results are same. Anyone else has same observations? Or wants to test can ask for case files. |
|
November 21, 2015, 07:24 |
|
#15 |
New Member
Join Date: Mar 2012
Posts: 20
Rep Power: 14 |
In my experience, results like that in your second figure are usually caused by an early divergence of the turbulence variables (you might see huge values for k or v2 near the walls).
It may still give you a result, but it will not be a physical one. I wouldn't play too much with the boundary conditions, there are physical reasons to use nutLowReWallFunction and epsilonLowReWallFunction. The initialization is usually the key: try and use a low-re k-epsilon model first, like LaunderSharmaKE (remember to use epsilon=0 at the wall with that model) or AbeKondohNaganoKE (http://www.cfd-online.com/Forums/ope...lon-model.html). |
|
November 23, 2015, 09:34 |
v2 wall boundary condition
|
#16 |
New Member
Join Date: Jun 2014
Posts: 9
Rep Power: 12 |
Hi
I have a question about the v2 boundary condition in v2WallFunction. Code:
// Set v2 wall values forAll(v2, faceI) { label faceCellI = patch().faceCells()[faceI]; scalar uTau = Cmu25*sqrt(k[faceCellI]); scalar yPlus = uTau*y[faceI]/nuw[faceI]; if (yPlus > yPlusLam_) { scalar Cv2 = 0.193; scalar Bv2 = -0.94; v2[faceI] = Cv2/kappa_*log(yPlus) + Bv2; } else { scalar Cv2 = 0.193; v2[faceI] = Cv2*pow4(yPlus); } v2[faceI] *= sqr(uTau); } Also, due to my poor c++ skills, I wonder why v2 gets multiplied by sqr(uTau) and assigned the value after the if loop? What is the purpose of that? Thanks. |
|
November 23, 2015, 10:36 |
|
#17 |
New Member
Join Date: Mar 2012
Posts: 20
Rep Power: 14 |
you will find everything in this paper:
Kalitzin et al. 2004. Near-wall behavior of RANS turbulence models and implications for wall functions. In the if loop v2 is actually v2Plus, that's why you multiply it by sqr(uTau). |
|
November 24, 2015, 14:39 |
|
#18 |
New Member
Karl Lindqvist
Join Date: Jul 2012
Posts: 21
Rep Power: 14 |
Dear all,
I'd just like to add my small piece of insight in this issue, after also struggling to understand the OF wall functions. It turns out that there was a bug in the epsilonLowReWallFunction up to and including version 2.4.x, causing erratic behavior of this wall function. Just as canopus, I got some very wierd profiles for velocity and turbulent kinetic energy for a channel flow test case despite good initialization. Using the wall function implementation in v.3.0.0 gives much better results. The alternative approach (setting v2,f,k to machine zero, epsilon to zeroGradient as explained here) also give reasonable results (green curve). So to conclude, it seems like the new wall functions reduce to the low-Re approach (more or less) for small y+ values. |
|
November 25, 2015, 04:01 |
|
#19 | |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30 |
For sake of completeness, I'm guessing you are referring to bug ID 0001852, resolved by 9bf69ecd0bb19deb1bdfa5d2bb7034b6559242ea:
http://www.openfoam.org/mantisbt/view.php?id=1852 Quote:
__________________
*On twitter @akidTwit *Spend as much time formulating your questions as you expect people to spend on their answer. |
||
January 16, 2016, 17:36 |
|
#20 | |
Member
SM
Join Date: Dec 2010
Posts: 97
Rep Power: 15 |
"epsilon to zeroGradient" for Low Re Turbulence models?
Are you sure ? In the tutorial folder Quote:
Code:
lowerWall { type fixedValue; value uniform 1e-08; } |
||
Tags |
boundary conditions, v2f, wall functions |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Wind turbine simulation | Saturn | CFX | 60 | July 17, 2024 06:45 |
mass flow in is not equal to mass flow out | saii | CFX | 12 | March 19, 2018 06:21 |
An error has occurred in cfx5solve: | volo87 | CFX | 5 | June 14, 2013 18:44 |
Water subcooled boiling | Attesz | CFX | 7 | January 5, 2013 04:32 |
Copying boundary conditions from model to model | Lior | FLUENT | 3 | September 23, 2004 17:10 |