CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   Modify SST kw model in CFX (https://www.cfd-online.com/Forums/cfx/187585-modify-sst-kw-model-cfx.html)

Tingyun YIN May 10, 2017 08:25

Modify SST kw model in CFX
 
1 Attachment(s)
Hi everyone,

In CFX, The turbulent eddy viscosity μt in SST kw is given as:
Attachment 55930

Now, I'm going to modify density and implement it with CEL language:

LIBRARY:
CEL:
&replace EXPRESSIONS:
modifySST = fn*Water.ke/ (Water.tef *coefficiency)
coefficiency = max(1,sstrnr*F2/(0.31*Water.tef))
F2 = tanh(arg^2)
arg = max(2*sqrt(Water.ke)/(0.09*Water.tef*Wall Distance ),500*kinetic viscosity/(Wall Distance^2*Water.tef) )
kinetic viscosity = Water.Dynamic Viscosity/Water.Density
fn = Vapour.Density+(mixdensity-Vapour.Density)^10 / (Water.Density-Vapour.Density)^9
mixdensity = Water.Volume Fraction*Water.Density+Vapour.Volume Fraction*Vapour.Density
END
END
END


When Slover run, a problem occured:


+--------------------------------------------------------------------+
| PROBLEM ENCOUNTERED WHEN EXECUTING CFX EXPRESSION LANGUAGE |
| |
| The CFX expression language was evaluating: |
| Eddy Viscosity |
| |
| The problem was: |
| DIVIDE-BY-ZERO |
| |
| FURTHER INFORMATION |
| |
| The problem was encountered in executing the expression for: |
| arg |
| The complete expression is: |
| max(2*sqrt(Fluid 1.ke)/(0.09*Fluid 1.tef*Wall Distance ),500*ki \|
| netic viscosity/( |
| The error occurs on sub-expression: |
| 2*sqrt(Fluid 1.ke)/(0.09*Fluid 1.tef*Wall Distance ) |
| |
| BACKGROUND INFORMATION |
| |
| The error was detected at one location. The same problem may be |
| present at other locations - that has not been investigated. |
| The following values are for the first location which has the |
| problem. |
| |
| These values were set before reaching the current expression: |
| |
| Name = Expression = Value |
| |
| kinetic viscosity = Fluid 1.Dynamic Viscosity/F= 9.230000E-07 |
| sstrnr = 11.4584 |
| Wall Distance = 0.00000 |
| Fluid 2.Volume Fr... = 1.000000E-15 |
| Fluid 2.Density = 2.308000E-02 |
| Fluid 1.tef = 258.753 |
| Fluid 1.ke = 5.973506E-05 |
| Fluid 1.Volume Fr... = 1.00000 |
| Fluid 1.Dynamic V... = 9.211540E-04 |
| Fluid 1.Density = 998.000 |
| |
| END OF DIAGNOSTIC OUTPUT FOR CFX EXPRESSION LANGUAGE |
+--------------------------------------------------------------------+

+--------------------------------------------------------------------+
| PROBLEM ENCOUNTERED WHEN EXECUTING CFX EXPRESSION LANGUAGE |
| |
| The CFX expression language was evaluating: |
| Eddy Viscosity |
| |
| The problem was: |
| DIVIDE-BY-ZERO |
| |
| FURTHER INFORMATION |
| |
| The problem was encountered in executing the expression for: |
| arg |
| The complete expression is: |
| max(2*sqrt(Fluid 1.ke)/(0.09*Fluid 1.tef*Wall Distance ),500*ki \|
| netic viscosity/( |
| The error occurs on sub-expression: |
| 2*sqrt(Fluid 1.ke)/(0.09*Fluid 1.tef*Wall Distance ) |
| |
| BACKGROUND INFORMATION |
| |
| The error was detected at one location. The same problem may be |
| present at other locations - that has not been investigated. |
| The following values are for the first location which has the |
| problem. |
| |
| These values were set before reaching the current expression: |
| |
| Name = Expression = Value |
| |
| kinetic viscosity = Fluid 1.Dynamic Viscosity/F= 9.230000E-07 |
| sstrnr = 4.21159 |
| Wall Distance = 0.00000 |
| Fluid 2.Volume Fr... = 1.000000E-15 |
| Fluid 2.Density = 2.308000E-02 |
| Fluid 1.tef = 309.657 |
| Fluid 1.ke = 7.026244E-05 |
| Fluid 1.Volume Fr... = 1.00000 |
| Fluid 1.Dynamic V... = 9.211540E-04 |
| Fluid 1.Density = 998.000 |
| |
| END OF DIAGNOSTIC OUTPUT FOR CFX EXPRESSION LANGUAGE |
+--------------------------------------------------------------------+


Any courtesies extended to me will be greatly appreciated.

Thanks.:)

Opaque May 10, 2017 08:56

The value for Wall Distance is 0; therefore, denominator is 0, and the division cannot be completed.

Tingyun YIN May 10, 2017 20:31

Quote:

Originally Posted by Opaque (Post 648338)
The value for Wall Distance is 0; therefore, denominator is 0, and the division cannot be completed.

Hi Opaque,

Thank you for your reply.

In CFX, Definition of Wall Distance might not be same with meaning of y in F2 expression. Here:

F2 = tanh(arg^2)
arg = max(2*sqrt(Water.ke)/(0.09*Water.tef*Wall Distance ),500*kinetic viscosity/(Wall Distance^2*Water.tef) )

So, cloud you offer the correct the CEL expression or references for guidance?

Thanks.

ghorrocks May 11, 2017 00:58

Your function does not appear to be defined at the wall as you divide by Wall distance regardless of which argument the max() function ends up using. This means your equation falls apart at the wall. You will need to recast your function so it evaluates properly at the wall.

It is not a problem with CEL, the problem is with the fundamental function you are trying to use.

Tingyun YIN May 11, 2017 08:37

Quote:

Originally Posted by ghorrocks (Post 648410)
Your function does not appear to be defined at the wall as you divide by Wall distance regardless of which argument the max() function ends up using. This means your equation falls apart at the wall. You will need to recast your function so it evaluates properly at the wall.

It is not a problem with CEL, the problem is with the fundamental function you are trying to use.

Hi ghorrocks,

Thank you for your reply. I get your point but how to evaluate properly at the wall in CFX?

In other words, how to express y (the distance from the field point to the nearest wall) in CFX? Is it correct?

Thanks.

ghorrocks May 11, 2017 19:03

Quote:

I get your point but how to evaluate properly at the wall in CFX?
Your function is not valid at the wall. Dream up a modification of the function so it is valid at the wall. For instance some models use wall functions to handle situations like this.

Quote:

how to express y
The Wall Distance variable is correct.

Tingyun YIN May 12, 2017 06:44

Quote:

Originally Posted by ghorrocks (Post 648532)
Your function is not valid at the wall. Dream up a modification of the function so it is valid at the wall. For instance some models use wall functions to handle situations like this.



The Wall Distance variable is correct.



Yeah, I see.

Thanks a lot.


Sent from my iPhone using CFD Online Forum mobile app


All times are GMT -4. The time now is 13:02.