CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Nonlinear turbulence model NonlinearShih (https://www.cfd-online.com/Forums/openfoam/77346-nonlinear-turbulence-model-nonlinearshih.html)

Thomas Baumann June 21, 2010 06:32

Nonlinear turbulence model NonlinearShih
 
Hi all,

I've simulated a fully developed channel flow with the nonlinear shih model. The residuals are quite good (R<10e-7). But looking at the pressure it isn't constant over the channel-hight and looking at the veloicty in y-direction, they are nonzero. I have simulated this channel flow with a low-Reynolds-turbulence model and showed the different results in the following plot.
http://www-isl.mach.uni-karlsruhe.de...s_und_shih.png
I have seen results that look nearly the same with the LRR model... Maybe it's because of the pressure near the walls. For BC I'm using zeroGradient for walls and the outlet, for inlet a fixed Value.
I'm using OpenFOAM 1.6 with directMapped bc's for U,k,epsilon at the inlet. The solver is simpleFoam. If someone has any hind please let me know.

Best regards,

Thomas

Thomas Baumann July 15, 2010 03:13

Hi all,

I have simulated a fully developed channel flow using the solver boundaryFoam. Here I have no problems and I get good results using for turbulence modelling NonlinearKEShih or the LienCubicKELowRe.

But starting a simulation with simpleFoam or pisoFoam I get bad results as described above.

Has anybody solved any flow with walls without this problem using simpleFoam or any solver regarding convection?

Thanks a lot,
Thomas

Thomas Baumann July 23, 2010 10:52

Hi all,

I'm nut sure, but could it be the problem of the simple or the piso-algorithm?

I have seen in buoyantboussinesqSimpleFoam that if an additional term is added in the U-equation (here the buoancy-term), that
this term has to be added as flux in phi, too.

In the Navier-Stokes-equations I get here the additional buoancy-term:
g*rho_delta in the U-equation.

And the flux phi is corrected with this term, which is needed for the p-equation:
surfaceScalarField ghf("ghf", g & mesh.Cf());
surfaceScalarField buoyancyPhi = rUAf *ghf*fvc::snGrad(rhok)*mesh.magSf();

phi = phi - buoyancyPhi;

...

Normal turbulence models like the k-epsilon are modelling the turbulence isotropic and because of that, the Reynolds-stresses have not to be regarded in the poisson-equation of the pressure, the same as the viscous stresses. You get the poisson-equation by
div(Navier-Stokes-equations). But in nonlinear turbulence-models and algebraic stress models they are nonzero.
So I have to split my turbulence in a isotropic and the nonisotropic part. And I have to calculate a phi_nonisotropic and have to add it to the phi. I'm not sure if that's right.
Can anybody help me?

Thank you very much,

Thomas



Regards Thomas

Thomas Baumann August 5, 2010 05:17

Hi all,

I have modified the mySimpleFoam-solver to calculate the residuals of continuity-equation about div(U) and the orginal one div(phi), too.

The residuals of div(phi) are about 10^-09,
but the residuals of div(U) are about 0.7

If I'm simulating using an isotropic turbulence-model for example the LaunderSharma I get
div(phi) are about 10^-09,
the residuals of div(U) are about 10^-04. So they are much better here.

The problem of the simple and the piso-algorithmus is, that they are calculating the the pressure-equation using phi.

fvScalarMatrix pEqn
(
fvm::laplacian(1.0/AU, p) == fvc::div(phi)
);

and correct the fluxes afterwards
if (nonOrth == nNonOrthCorr)
{
phi -= pEqn.flux();
}


I have seen in the posting
http://www.cfd-online.com/Forums/ope...ody-force.html
that you can built an additional force to the NS and pressure-equation.
So could it be possible to solve the divdevReff of the turbulence-model isotropic and add the additional explicit nonlinear-part like a force?

Regards Thomas

Moelfus August 30, 2010 09:48

Hi Thomas,

maybe there is something wrong with your BC's. I used the anisotropic model and it works perfectly for my needs. I used the following BC's:

U:

INLET
{
type fixedValue;
value uniform (.619552 0 0);
}

WALL
{
type fixedValue;
value uniform (0 0 0);
}

OUTLET
{
type zeroGradient;
}


p:

INLET
{
type zeroGradient;
}
WALL
{
type zeroGradient;
}
OUTLET
{
type fixedValue;
value uniform 0;
}

epsilon:

INLET
{
type fixedValue;
value uniform .0003532;
}

WALL
{
type zeroGradient;
}
OUTLET
{
type zeroGradient;
}

k:

INLET
{
type fixedValue;
value uniform .000605;
}

WALL
{
type zeroGradient;
}
OUTLET
{
type zeroGradient;
}

nut:

INLET
{
type calculated;
value uniform 0;
}

WALL
{
type nutWallFunction;
value uniform 0;
}
OUTLET
{
type calculated;
value uniform 0;
}

nuTilda:
INLET
{
type fixedValue;
value uniform 0;
}
WALL
{
type zeroGradient;
}
OUTLET
{
type zeroGradient;
}

Is your mesh 2d or 3d? Are the dimensions/scaling of the domain right? Are the results mesh independent? What is the Reynoldsnumber? ... This would be some questions I'd usually ask.

Best regards,

Olli

Outbound November 29, 2016 11:00

Greetings,

I'm trying to use the Non-linear Shih k-e model in porousSimpleFoam.

I'm missing something in the divScheme part of the fvSchemes file but I don't know what I have to add (all I know is that it has something to do with the non-linear term).

The error message is as follows:

Quote:

--> FOAM FATAL IO ERROR:
keyword div(nonlinearStress) is undefined in dictionary "case_folder/system/fvSchemes.divSchemes"

file: /case_folder/system/fvSchemes.divSchemes from line 30 to line 35.

From function dictionary::lookupEntry(const word&, bool, bool) const
in file db/dictionary/dictionary.C at line 402.
I was unable to find any tutorial which makes use of this model.

Any help would be appreciated.

Outbound November 29, 2016 12:09

OK, so i just added the following line to the fvSchemes.divSchemes:

Quote:

div(nonlinearStress) Gauss upwind;

However, I'm still getting the following error message on the first time step:

Quote:

--> FOAM FATAL IO ERROR:
attempt to read beyond EOF

file: /case_folder/system/fvSchemes.divSchemes.div(nonlinearStress) at line 36.

From function ITstream::read(token&)
in file db/IOstreams/Tstreams/ITstream.C at line 83.

FOAM exiting
Given that I'm trying to use a non-linear turbulence model do I also have to adjust the schemes for the other parameters?

Outbound November 29, 2016 14:25

OK, so I tried the following and so far it seems to be working (although beats me if it actually is the proper scheme):

Quote:

div(nonlinearStress) Gauss cubic;
Other Schemes must be contingent on parameters not specified by the case I'm running (which FYI is the explicit duct case for porousSimpleFoam).

jmartrubio December 16, 2016 17:11

Dear Thomas,

I don't know if you got to solve your problem or if you keep working in OF, but I am finding the same issue in recent versions (of-dev), I guess it was never solved. As you commented for fully developed channel flow vertical velocity is not zero. Pressure distribution should not be zero since dp/dy should account for the contribution of Re stress terms:
- dp/dy = d(uv)/dx + d(vv)/dy, and those terms are not zero when non linear models are considered. However, due to continuity vertical velocity should be perfectly zero everywhere. When boundaryFoam is used the devReff term in velocity equation is not entirely considered, but it is projected in the direction of the flow), therefore no problem appears. However when simpleFoam is used the problem you mentioned of non-zero vertical velocity does appear for non-linear models.

I have been playing myself to try to find out the problem: I played first with solving tolerances, mesh distribution (uniform or non-uniform), all kinds of schemes, periodic conditions (empty for 2D or cyclic 3D)...
I also tried to separate the nonlinear from the linear part (recalculating all terms in the solver and adding manually the terms to the velocity equation) to make sure the non-linear part was added correctly. However the problem is still there.

SIMPLE algorithm should work since the nonlinear stress contribution is added to the source of the velocity equation, and is therefore considered in the HbyA, which is used by the pressure equation to satisfy continuity. Therefore I don't know what else could be failing.

I also tried to add Majumdar correction to the traditional RhieChow method used in simpleFoam, but it didn't change the problem.

Please let me know if anybody figured out what could be going wrong. I checked the behavior of nonlinear models in other commercial codes and they don't suffer from this problem.

Best regards,

Javier

huangxianbei May 5, 2018 21:39

Quote:

Originally Posted by jmartrubio (Post 630085)
Dear Thomas,

I don't know if you got to solve your problem or if you keep working in OF, but I am finding the same issue in recent versions (of-dev), I guess it was never solved. As you commented for fully developed channel flow vertical velocity is not zero. Pressure distribution should not be zero since dp/dy should account for the contribution of Re stress terms:
- dp/dy = d(uv)/dx + d(vv)/dy, and those terms are not zero when non linear models are considered. However, due to continuity vertical velocity should be perfectly zero everywhere. When boundaryFoam is used the devReff term in velocity equation is not entirely considered, but it is projected in the direction of the flow), therefore no problem appears. However when simpleFoam is used the problem you mentioned of non-zero vertical velocity does appear for non-linear models.

I have been playing myself to try to find out the problem: I played first with solving tolerances, mesh distribution (uniform or non-uniform), all kinds of schemes, periodic conditions (empty for 2D or cyclic 3D)...
I also tried to separate the nonlinear from the linear part (recalculating all terms in the solver and adding manually the terms to the velocity equation) to make sure the non-linear part was added correctly. However the problem is still there.

SIMPLE algorithm should work since the nonlinear stress contribution is added to the source of the velocity equation, and is therefore considered in the HbyA, which is used by the pressure equation to satisfy continuity. Therefore I don't know what else could be failing.

I also tried to add Majumdar correction to the traditional RhieChow method used in simpleFoam, but it didn't change the problem.

Please let me know if anybody figured out what could be going wrong. I checked the behavior of nonlinear models in other commercial codes and they don't suffer from this problem.

Best regards,

Javier

Hi, Javier:

It has been a long time since your post here. I found problem with Nonlinear RANS models in OF-2.3.0. The results are wired when applied to the Taylor-Couette flow. I have tried different boundary conditions but nothing better appeared. Therefore, I think it may be related to the source code. I checked the code, however, no fault was found in the code until now. Have you solved this problem?

Xianbei

jmartrubio May 9, 2018 15:46

Quote:

Originally Posted by huangxianbei (Post 691374)
Hi, Javier:

It has been a long time since your post here. I found problem with Nonlinear RANS models in OF-2.3.0. The results are wired when applied to the Taylor-Couette flow. I have tried different boundary conditions but nothing better appeared. Therefore, I think it may be related to the source code. I checked the code, however, no fault was found in the code until now. Have you solved this problem?

Xianbei

Hello Xianbei,

I actually stopped working in OF, but my guess is that the problem is related to the boundary condition applied to the pressure field. As discussed before, pressure does not approach the wall with dpdy=0, and therefore zeroGradient is not a valid condition anymore, but the gradient of pressure should account for the nonzero components of the Re stress. Maybe you can try coding a BC that uses devRhoReff information to set a value of the pressure gradient at the wall. Let me know if you get to solve it!

Javier

huangxianbei May 9, 2018 20:08

Quote:

Originally Posted by jmartrubio (Post 691825)
Hello Xianbei,

I actually stopped working in OF, but my guess is that the problem is related to the boundary condition applied to the pressure field. As discussed before, pressure does not approach the wall with dpdy=0, and therefore zeroGradient is not a valid condition anymore, but the gradient of pressure should account for the nonzero components of the Re stress. Maybe you can try coding a BC that uses devRhoReff information to set a value of the pressure gradient at the wall. Let me know if you get to solve it!

Javier

Hi, Javier:
Glad to receive your reply. Different from your opinion, I suspect the problem to be related to the baseline k-epsilon model. As in openfoam, both NonlinearShih and LienCubic are based on the standard k-epsilon model. A known weakness is that the k-epsilon performs poor in the near-wall region. In my case, the Reynolds number is low (about 8000) and the grid is set to be about y+ = 0.5. Therefore, they can not reflect correctly the behavior. I further used the SST model with the curvature correction and found the results to be satisfactory. In the following work , I will change the base line model to be k-omega model for the nonlinear models and to see whether it can help to overcome the drawback.

Xianbei

jmartrubio May 9, 2018 23:57

Quote:

Originally Posted by huangxianbei (Post 691839)
Hi, Javier:
Glad to receive your reply. Different from your opinion, I suspect the problem to be related to the baseline k-epsilon model. As in openfoam, both NonlinearShih and LienCubic are based on the standard k-epsilon model. A known weakness is that the k-epsilon performs poor in the near-wall region. In my case, the Reynolds number is low (about 8000) and the grid is set to be about y+ = 0.5. Therefore, they can not reflect correctly the behavior. I further used the SST model with the curvature correction and found the results to be satisfactory. In the following work , I will change the base line model to be k-omega model for the nonlinear models and to see whether it can help to overcome the drawback.

Xianbei


It is true that kEpsilon is know for their poor performance near wall (even if you can find some good performing low Re versions). However the problem I was talking about wasn't so related to the model itself, but to the non linear effects, added in any of the NLEVM. By simply removing the nonlinearStress from the models I could get smooth results. The problem appeared if you look to the very first cells from the wall, where you would find a small but non -zero vertical velocity, which is wrong by definition, as well as some oscillations both in v and p. I think that is related to the commented problem in p boundary condition. Regarding your case I don't know what are the exact problems you are finding, maybe if you post an image I can give you my thoughts.

Regards,

Javier

huangxianbei May 10, 2018 07:47

Quote:

Originally Posted by jmartrubio (Post 691848)
It is true that kEpsilon is know for their poor performance near wall (even if you can find some good performing low Re versions). However the problem I was talking about wasn't so related to the model itself, but to the non linear effects, added in any of the NLEVM. By simply removing the nonlinearStress from the models I could get smooth results. The problem appeared if you look to the very first cells from the wall, where you would find a small but non -zero vertical velocity, which is wrong by definition, as well as some oscillations both in v and p. I think that is related to the commented problem in p boundary condition. Regarding your case I don't know what are the exact problems you are finding, maybe if you post an image I can give you my thoughts.

Regards,

Javier

Well, I did not search for the near wall values. Here is the sketch of my case.
https://www.cfd-online.com/Forums/me...921-sketch.jpg

I worked on nonlinear SGS models (for LES) in the last 2 years. In that model, I set the nonlinearStress as a variable that specific boundary conditions should be given. Therefore, I can set the nonlinearStress to be fixedValue. I'm not sure if the nonlinear RANS can also be done through this way so that the near wall behavior will be correct.

Xianbei

jmartrubio May 10, 2018 09:03

I think the problem is not that much related to the bc applied to nonlinearStress. I think the actual value at the wall should not be 0, since d(vv)/dy is not 0 (or should not be), and pressure gradient at the wall should cancel that. You can manually modify the explicit value at the very wall to cancel it, but I guess that will affect the physics of the problem. In any case apart from the very small non-zero wall normal velocity the RANS NLEVM were giving satisfactory solutions for me, but I never tried the non linear subgrid scale models.

huangxianbei May 10, 2018 21:43

Quote:

Originally Posted by jmartrubio (Post 691926)
I think the problem is not that much related to the bc applied to nonlinearStress. I think the actual value at the wall should not be 0, since d(vv)/dy is not 0 (or should not be), and pressure gradient at the wall should cancel that. You can manually modify the explicit value at the very wall to cancel it, but I guess that will affect the physics of the problem. In any case apart from the very small non-zero wall normal velocity the RANS NLEVM were giving satisfactory solutions for me, but I never tried the non linear subgrid scale models.

Well, it seems that the problem is still there for OpenFOAM. Another problem was found for the expression of the rotation-rate tensor. As in many nonlinear models, the rotation-rate tensor is defined as :
Omega_ij = skew(gradU)+ksi_mji_omega_m
where ksi_mji is the Levi-Civita symbol, omega_m is the rotation of the frame. While in the code of the nonlinear models, they are simply defined by:
Omega_ij = skew(gradU)

edit 2017/05/13: in addition, the skew(gradU)=0.5(du_j/dx_i-du_i/dx_j)=-Omega_ij. Therefore, in the code, a negtive symbol is needed.


All times are GMT -4. The time now is 22:06.