CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   Question about CEL-problem (https://www.cfd-online.com/Forums/cfx/147686-question-about-cel-problem.html)

Flashidashi January 27, 2015 08:25

Question about CEL-problem
 
Hello guys,

i'm trying to simulate the current around a cylinder with a one phase fluid model. After that i want to simulate entrainment with a mesh deformation model.

First i want to integrate a velocity-profil for the z-coordinate. Therefore i looked for some equations, which i wrote down in a ccl-file:

# Expressions for Velocity Profile
LIBRARY :
CEL :
EXPRESSIONS :
dsand = 0.0005 [m]
constkarman = 0.41
usurface = 1.0 [m s^-1]
waterdepth = maxVal(z)@Einlass
zzero = dsand/12
ustarlet = constkarman*usurface/(log10(waterdepth/zzero))
uz = (ustarlet/constkarman)*log10(z/zzero)
END
END
END

The elementary problem for me is to get the maximum value for the z-coordinate, which represents the waterdepth or the height of geometry. I tried to use the function maxVal as you can see above and got following error:

The function 'maxVal' referenced in parameter 'U' in object '/FLOW:Flow Analysis 1/DOMAIN:Steady Flow Water/BOUNDARY:Einlass/BOUNDARY CONDITIONS/MASS AND MOMENTUM' has a disallowed argument, 'z'. The solver does not support the use of this variable in this context.

Is there a correct method to get a value, a min or max value for a coordinate (x,y,z) from a boundary, surface, curve or face???

Thanks, hope you can help me for my work.

best regards flashi

Flashidashi January 27, 2015 08:41

zglobal
 
I found out that waterdepth = zGlobal could work for my issue.

Flashidashi January 27, 2015 09:20

Length of a Polyline
 
The next problem for me has appeared :)

I want to calculate the velocity which depends on the z-coordinate -> u(z)

so for my equation uz = (ustarlet/constkarman)*log10(z/zzero)
i have to find a expression in cfx to get my z-value, for example 0 to 10 m.

Can anyone help here? I would suggest an

areaAve(Mesh Z Coordinate)@inlet

code, but it doesnt work.

thanks flashi

Opaque January 27, 2015 11:26

I am not sure how you find out what the variable names are, but you can either read the documentation for the proper variable names, or right click when you are typing an expression and pop-up will display what is available to use for CEL expressions, i.e. function names, variable names, constant names, etc.

As you noticed before, x/y/z cannot be used within the argument of the CEL expression calculator functions when using ANSYS CFX Solver. They seem to work when using CFD-Post though.

You can use either x/y/zGlobal, or create an additional variable and copy the spatial coordinate you need into it, i.e. MyZ = z, then use areaAve(MyZ)@inlet.

For profiles, you should be able to say uz = 2 * z to create a linear profile without any issues.

Flashidashi January 28, 2015 01:45

Thanks alot, that makes sense.
I'll tried it that way and get an error:

MyZ = z
constkarman = 0.41
dsand = 0.0005 [m]
ustarlet = constkarman*usurface/(log10(waterdepth/zzero))
usurface = 1.0 [m s^-1]
waterdepth = zGlobal
zzero = dsand/12
znormal = areaAve(MyZ)@inlet
uz = (ustarlet/constkarman)*log10(znormal/zzero)

so i defined MyZ = z without a calculator function. If i understand you correctly, i have to determine MyZ with the areaAve function in an equation or separately as i did it with my variable znormal.

Following error appears now:

The function 'areaAve' referenced in parameter 'U' in object '/FLOW:Flow Analysis 1/DOMAIN:Steady Flow Water/BOUNDARY:INLET/BOUNDARY CONDITIONS/MASS AND MOMENTUM' has an invalid argument, 'MyZ'. Only arguments that consist of a single recognised variable name are supported by the solver.

so the areaAve function can only handle the variables which i can integrate per right click? Thought it could be the name MyZ, which has 2 variables y and z, but it doesnt help to change the name.

uz = (ustarlet/constkarman)*log10(MyZ/zzero) and the definition of z and zglobal gave me a plot with the speed u(z) in the expression window. this seems to work then. I hope ansys will take the velocity profile data for my simulation then and not only for my plot.
I wonder because it gave me that plot, but when i want to see the boundary velocity contour in the presentation window, it doesnt work for it. when i use a linear function, i.e. uz = 2*z it is displayed as a contour.

I would appreciate your help or others help again :)

Thanks Flashi

Opaque January 28, 2015 09:21

You added another expression, not an "ADDITIONAL VARIABLE" in CFX speak. Look in the toolbar for the "x" button in italics. For details, read the documentation on how additional variables work.

Flashidashi January 29, 2015 02:57

thanks for that.

solved the problem and got the specific velocity profil worked for pre and solver.

Flashi


All times are GMT -4. The time now is 11:27.