Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Problem with k-epsilon wall function

Please login with a confirmed email address before reporting spam

Hi, I'm having a problem with a k-epsilon model and no matter how much I stare at the input file, I can't work out what I'm doing wrong.... When I run the documentation model, life is good. But when I "tweak" it slightly then useless.

The only significant difference I can see is that I am doing 2D Axisymmetric k-eps, not 2D. I have the heated wall on part of the outside of the cylinder.

My problem is that the "wall" function isn't working - I have complete temperature discontinuity from the temperature of the fluid and the temperature of the solid. The wall does not heat the fluid at all.

Any hints as to how to find my error? I am happy to post my .mph if that is appropriate?

Regards, John

7 Replies Last Post Jun 25, 2009, 2:14 p.m. EDT
Jim Freels mechanical side of nuclear engineering, multiphysics analysis, COMSOL specialist

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 24, 2009, 12:55 p.m. EDT
What are the values for y+ and T+ in your model ? These are normally the variables dwplus_chns and Tplus_htgh in the COMSOL application mode only valid on the surface where the wall function is applied.
What are the values for y+ and T+ in your model ? These are normally the variables dwplus_chns and Tplus_htgh in the COMSOL application mode only valid on the surface where the wall function is applied.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 24, 2009, 1:24 p.m. EDT

What are the values for y+ and T+ in your model ? These are normally the variables dwplus_chns and Tplus_htgh in the COMSOL application mode only valid on the surface where the wall function is applied.


Aha!! I look through the COMSOL model solution and it has Tplus_chcc defined as a boundary variable for some of the boundaries as

11.82560274465786+log(dwplus_chns)/kappa_chns-0.5*(1+log(1000*kappa_chns))/kappa_chns

cplus_chns, kappa_chns and cmu_chns are defined as scalar variables. I can't find dwplus_chns (must be there somewhere I guess - is there an easy way to find definitions - if I try to plot it then it knows it is defined as a wall-offset-in-viscous-units?)....

When I look through my model, Tplus_chcc got automatically defined by someone, but the vaue is *ZERO*.

Even though I can't find dwplus_chns, I've now manually typed in that formula for Tplus_chcc.

I'll give it a go :-)
[QUOTE] What are the values for y+ and T+ in your model ? These are normally the variables dwplus_chns and Tplus_htgh in the COMSOL application mode only valid on the surface where the wall function is applied. [/QUOTE] Aha!! I look through the COMSOL model solution and it has Tplus_chcc defined as a boundary variable for some of the boundaries as 11.82560274465786+log(dwplus_chns)/kappa_chns-0.5*(1+log(1000*kappa_chns))/kappa_chns cplus_chns, kappa_chns and cmu_chns are defined as scalar variables. I can't find dwplus_chns (must be there somewhere I guess - is there an easy way to find definitions - if I try to plot it then it knows it is defined as a wall-offset-in-viscous-units?).... When I look through my model, Tplus_chcc got automatically defined by someone, but the vaue is *ZERO*. Even though I can't find dwplus_chns, I've now manually typed in that formula for Tplus_chcc. I'll give it a go :-)

Jim Freels mechanical side of nuclear engineering, multiphysics analysis, COMSOL specialist

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 24, 2009, 3:43 p.m. EDT
The y+ value is included in the default list of variables available for plotting in the k-e model. The T+ is not in the plotting list, but is included in the htgh model (see physics->equations->boundary variables) for the fluid-structure interaction models in the heat transfer application mode. It should not be zero by default, so perhaps you are using the wrong models. It is definitely a non-zero entry in the boundary variables. Make sure you mesh is designed to give you 30<y+<100.

What is your Reynolds number ?
The y+ value is included in the default list of variables available for plotting in the k-e model. The T+ is not in the plotting list, but is included in the htgh model (see physics->equations->boundary variables) for the fluid-structure interaction models in the heat transfer application mode. It should not be zero by default, so perhaps you are using the wrong models. It is definitely a non-zero entry in the boundary variables. Make sure you mesh is designed to give you 30

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 24, 2009, 6:12 p.m. EDT
Hi my cellReynolds is 1.e5 - 1.e6

For better (or worse), I am not using htgh. I am using the ChemEng model for 2D Axisymmetric -> FluidFlow->NonIsothermal -> k-epsilon -> SteadyState

It automatically creates a model with k-epsilon and two chcc's. The wall functions are predefined.

It appears that when you do this for non axisymmtric and select "wall" on the chcc - then you get the correct formula for Tplus. But <unless I screwed up> when you choose axisymmetric and then wall - then you get Tplus=0.

But it is completely conceivable that the mistake is mine :-)

Thanks for the reminder on the range for y+ ... I had exceeded that in places.

Hi my cellReynolds is 1.e5 - 1.e6 For better (or worse), I am not using htgh. I am using the ChemEng model for 2D Axisymmetric -> FluidFlow->NonIsothermal -> k-epsilon -> SteadyState It automatically creates a model with k-epsilon and two chcc's. The wall functions are predefined. It appears that when you do this for non axisymmtric and select "wall" on the chcc - then you get the correct formula for Tplus. But when you choose axisymmetric and then wall - then you get Tplus=0. But it is completely conceivable that the mistake is mine :-) Thanks for the reminder on the range for y+ ... I had exceeded that in places.

Jim Freels mechanical side of nuclear engineering, multiphysics analysis, COMSOL specialist

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 24, 2009, 9:07 p.m. EDT
I also have the Chem.Engr. modlule, but I usually do not use it. I set up variable-density, non-isothermal turbulent models quite frequently using the set that comes with the heat transfer application mode (chns, htgh, htgh2 versus chns, chcc, chcc2 on the chem. engr. module).

I quickly set up a simple 2D model with chns, chcc, chcc2 and I can confirm what you have found. Indeed, it appears that the 2D cartesian model also sets up the heat flux as zero initially at the turbulent wall boundary. This appears incorrect, but there is a trick ! I fell into the same trap myself in trying to set this up.

Intuitively, from the GUI, you want to set your boundary conditions from the pull down window on the right. However, that menu shows a zero heat flux.

Instead, set the boundary condition using the Group pull down menu on the left for each individual boundary. In that menu, you see the boundary type "wall" which sets up the correct boundary condition. Once the correct boundary condition of wall is set, then Tplus will also change to a non-zero functional relationship and you will also get heat transfer to work (I bet). I don't like this "trick" because the wall option should also appear on the RHS as well.

I also have the Chem.Engr. modlule, but I usually do not use it. I set up variable-density, non-isothermal turbulent models quite frequently using the set that comes with the heat transfer application mode (chns, htgh, htgh2 versus chns, chcc, chcc2 on the chem. engr. module). I quickly set up a simple 2D model with chns, chcc, chcc2 and I can confirm what you have found. Indeed, it appears that the 2D cartesian model also sets up the heat flux as zero initially at the turbulent wall boundary. This appears incorrect, but there is a trick ! I fell into the same trap myself in trying to set this up. Intuitively, from the GUI, you want to set your boundary conditions from the pull down window on the right. However, that menu shows a zero heat flux. Instead, set the boundary condition using the Group pull down menu on the left for each individual boundary. In that menu, you see the boundary type "wall" which sets up the correct boundary condition. Once the correct boundary condition of wall is set, then Tplus will also change to a non-zero functional relationship and you will also get heat transfer to work (I bet). I don't like this "trick" because the wall option should also appear on the RHS as well.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 25, 2009, 9:22 a.m. EDT
Thanks, I hugely appreciate the advice. I will move over to chns, htgh, htgh2 as you propose.

Your comment on y+ has got me worried. The FEM solver has converged. If I mesh refine then the FEM still converges and the answer is basically the same. My background is linear PDE's so at that point I would sit back and be confident in the answer. But my y+ is about 1000. Does that mean the answer is junk? Scary.

Do you have a recomended sources of known solutions for "simple" air flow in pipes at Re ~ 10^6. When I do a literature search I am overwhelmed by the hits, all of which are for more complicated cases.
Thanks, I hugely appreciate the advice. I will move over to chns, htgh, htgh2 as you propose. Your comment on y+ has got me worried. The FEM solver has converged. If I mesh refine then the FEM still converges and the answer is basically the same. My background is linear PDE's so at that point I would sit back and be confident in the answer. But my y+ is about 1000. Does that mean the answer is junk? Scary. Do you have a recomended sources of known solutions for "simple" air flow in pipes at Re ~ 10^6. When I do a literature search I am overwhelmed by the hits, all of which are for more complicated cases.

Jim Freels mechanical side of nuclear engineering, multiphysics analysis, COMSOL specialist

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 25, 2009, 2:14 p.m. EDT
You can use the version in the chem engr module and heat transfer module. They both should work the same if you set up the problem correctly.

The default value for wall offset is "h/2". The COMSOL folks tell me that "h" is the length of the largest size of a finite element adjacent to the wall surface. In practice, I have found this really needs to be about the size of the normal distance of the first mesh line away from the wall. Actually, if you look at the way one is supposed to set up these problems, this first wall offset is not even supposed to be in the problem (the physical space that is). If you go look at the "flow in bended pipe" problem in the COMSOL examples, it shows this. But most folks have such thin boundary layers, that they ignore this small detail (including me).

Also Rey=10^6 is quite large. Turbulence theoretically starts at ~ 1200. So, if you really have Rey=10^6, you should have an extremely thin boundary layer and very small value for wall offset and very fine mesh near the wall. Yes the answer is questionable if you don't have 30<y+<100. This is clearly stated in the COMSOL manual. You need to have a benchmark problem in hand similar to yours to judge the accuracy. Yes, the literature is full of these problems.

I am attaching one of my favorite figures on this topic. It is on page 224 of "Computational Fluid Mechanics and Heat Transfer", McGraw-Hill, 1984, Anderson, Tannehill, Pletcher.
You can use the version in the chem engr module and heat transfer module. They both should work the same if you set up the problem correctly. The default value for wall offset is "h/2". The COMSOL folks tell me that "h" is the length of the largest size of a finite element adjacent to the wall surface. In practice, I have found this really needs to be about the size of the normal distance of the first mesh line away from the wall. Actually, if you look at the way one is supposed to set up these problems, this first wall offset is not even supposed to be in the problem (the physical space that is). If you go look at the "flow in bended pipe" problem in the COMSOL examples, it shows this. But most folks have such thin boundary layers, that they ignore this small detail (including me). Also Rey=10^6 is quite large. Turbulence theoretically starts at ~ 1200. So, if you really have Rey=10^6, you should have an extremely thin boundary layer and very small value for wall offset and very fine mesh near the wall. Yes the answer is questionable if you don't have 30

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.