CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   CFX CEL Expression for Cavitation Modeling (https://www.cfd-online.com/Forums/cfx/113210-cfx-cel-expression-cavitation-modeling.html)

kimotbwb February 14, 2013 16:37

CFX CEL Expression for Cavitation Modeling
 
2 Attachment(s)
I want to modify the cavitation model used in CFX by adding some specific user defined mass transfer soure terms for vaporization and condensation. This can be done by adding some expressions using CEL or by user CEL function which uses a Fortran subroutine. In my case i am using some simple CEL expressions.
What I want do to, is to adopte the so caled KUBOTA-model (sometimes also caled ZWART-model).
The formulation is based on a modification of the Rayleigh-Plesset equation for individual bubbles.

My problem is, to correctly adopte the KUBOTA-model in terms of CEL expressions, as some equations reproduce a negative sqrt! so the solver crashes.

You can see the entire fomulation and the used CEL expressions in the attached file. The basic equation which is used as the user defined cavitation model, is called KUBOTA.
As you can see, the two equations "PTermVap" and "PTermCond" can obtain negative values depending on if vaporization (p < pvap) or if condensation (p > pavp) occurs.

Did i adopte the fomulations correctly ? How can i avoid that the sqrt gets negative values ?

The original formulation is also attached as a *.JPG. So you can see the entire equations and compare it with the KUBOTA equation that I am trying to implement.
I also used the variable "pasbnc" instead of "Pressure" as the modeling guide suggests that the pressure in (pvap-p) should be the nonclipped absolute pressure (variable "pabsnc").


Hopefully somebody can help. Thanks a lot!

Kind regards

ghorrocks February 15, 2013 05:51

You are evaluating both PTermVap and PTermCond, and at all times at least one of them will be undefined with a sqrt of a negative number. So put them in your if statement for the KOBUTA function and then only the valid one gets evaluated.

Tingyun YIN March 28, 2018 03:26

CEL expression for Signum function in CFX
 
Hi, everyone.

I want to define Signum function in CFX, which is used to export -1, 0 or 1. For example, sgn(C) is equal to 1 when C>0; sgn(C) is equal to 0 when C=0; sgn(C) is equal to -1 when C<0.

Thanks in advance, Any comments and suggestions are appreciated.


All times are GMT -4. The time now is 01:42.