CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > CFX

Define length parameter by CFX-Pre Expression

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 1, 2016, 03:53
Default Define length parameter by CFX-Pre Expression
  #1
New Member
 
Join Date: Feb 2016
Posts: 22
Rep Power: 10
leasken is on a distinguished road
Hello, I am trying to define the hydraulic diameter for a channel flow by using an expression in CFX-Pre but cannot figure out how to properly implement it. Tried with

maxVal(y)@inlet - minVal(y)@inlet

but it resulted in the following error message:

ERROR
Attempt to evaluate the CEL callback function 'maxVal'.
Although it is valid to create an expression that
uses such a function, the preprocessor does not support
its evaluation.

I want to use a general expression and utilize the domain in CFX-Pre somehow. Any suggestions?
leasken is offline   Reply With Quote

Old   February 1, 2016, 04:19
Default
  #2
Senior Member
 
Lance
Join Date: Mar 2009
Posts: 669
Rep Power: 22
Lance is on a distinguished road
Quote:
Originally Posted by leasken View Post
the preprocessor does not support its evaluation.
Have you tried running the simulation anyway? Even though cfx-pre cannot evaluate the expression, the solver might be able to do it.
Lance is offline   Reply With Quote

Old   February 1, 2016, 04:42
Default
  #3
New Member
 
Join Date: Feb 2016
Posts: 22
Rep Power: 10
leasken is on a distinguished road
Quote:
Originally Posted by Lance View Post
Have you tried running the simulation anyway? Even though cfx-pre cannot evaluate the expression, the solver might be able to do it.
I cannot start the solver with this expression, CFX-Pre tells me that

The function 'maxVal' referenced by parameter 'Normal Speed' in object '/FLOW:Flow Analysis 1/DOMAIN: Default Domain/BOUNDARY:inlet/BOUNDARY CONDITIONS/MASS AND MOMENTUM' has a disallowed argument, 'y'. The solver does not support the use of this variable in this context.
leasken is offline   Reply With Quote

Old   February 1, 2016, 05:51
Default
  #4
Member
 
Join Date: Jan 2016
Posts: 34
Rep Power: 10
honcho62 is on a distinguished road
I think your problem is that you're requesting the maximum value of a singular scalar. So it's kinda pointless in the sense that y is both its min and max value. You're better off defining a line along the vertical edge and then saying maxValue(velocity u)@line for instance.
honcho62 is offline   Reply With Quote

Old   February 1, 2016, 06:58
Default
  #5
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,701
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
honcho: I do not think that is correct. The original expression is asking for the max and min values of the y nodal locations on the boundary patch labelled inlet. This sounds valid to me. I am confused about the problems Martin is reporting with his expression as I have used very similar expressions to this (max/min values of xyz nodal values on boundary patches) before and have not had any problems with it.
ghorrocks is offline   Reply With Quote

Old   February 1, 2016, 07:11
Default
  #6
New Member
 
Join Date: Feb 2016
Posts: 22
Rep Power: 10
leasken is on a distinguished road
Quote:
Originally Posted by ghorrocks View Post
honcho: I do not think that is correct. The original expression is asking for the max and min values of the y nodal locations on the boundary patch labelled inlet. This sounds valid to me. I am confused about the problems Martin is reporting with his expression as I have used very similar expressions to this (max/min values of xyz nodal values on boundary patches) before and have not had any problems with it.
Yes, I have also used a similar expression for calculating the length of an Iso Clip in CFD-Post. Thought that I could use the same here, but nope..
leasken is offline   Reply With Quote

Old   February 2, 2016, 04:46
Default
  #7
New Member
 
Michael Shives
Join Date: Sep 2013
Posts: 12
Rep Power: 12
mrshives is on a distinguished road
I've had a similar, frustrating problem. It's a hack solution... but you could try creating an additional variable called "myY" (set to equal "y" using an expression) then use "myY" in your minVal and maxVal functions. ... sometimes cfx just behaves badly....

Also don't worry about the pre-processor not supporting the function... that's just a warning, the real question is whether the solver supports that function (and I think the answer is yes)
mrshives is offline   Reply With Quote

Old   February 2, 2016, 06:57
Default
  #8
New Member
 
Join Date: Feb 2016
Posts: 22
Rep Power: 10
leasken is on a distinguished road
Quote:
Originally Posted by mrshives View Post
I've had a similar, frustrating problem. It's a hack solution... but you could try creating an additional variable called "myY" (set to equal "y" using an expression) then use "myY" in your minVal and maxVal functions. ... sometimes cfx just behaves badly....

Also don't worry about the pre-processor not supporting the function... that's just a warning, the real question is whether the solver supports that function (and I think the answer is yes)
No progress.. The warning issued stops CFX-Pre from creating a .def-file and no simulation can then be run.

I tried a bit with your hack solution, but not sure on how to define the "myY"-expression, any suggestions? Now I tried creating the expression "myY" and defining it as y, and also something like y@inlet, but nothing..
leasken is offline   Reply With Quote

Old   February 8, 2016, 01:55
Default
  #9
New Member
 
Join Date: Feb 2016
Posts: 22
Rep Power: 10
leasken is on a distinguished road
So I tried to solve this problem using parameters. I created an expression "Dh" and assigned a value to it. I ran a simulation and in CFD-post I selected "Use as Workbench Input Parameter". In the Parameter Set I changed the definition of Dh from the value "0.005 [m]" to an expression using two other input parameters, so basically

P1 H 5
P2 W 5
P3 Dh 2*(P1*P2)/(P16+P18)

But then there's no unit assigned to P3 and Workbench complains about it. P1 and P2 are parameters from my CAD-file, where I have constructed H and W as expressions in the CAD software, imported the geometry to Workbench and enabled the parameters under CAD-parameters in the Mesh module. When P1 and P2 are enabled and appear in my Parameter Set, there is no unit assigned to them so P3 is dimensionless. When I just try to add [mm] after P1 and P2 in P3:

P3 Dh 2*(P1[mm]*P2[mm])/(P16[mm]+P18[mm])

Workbench says "Name 'P1_Q' is not defined." in both the Value and Unit box for P3. Rather frustrating. What am I missing or doing wrong?
leasken is offline   Reply With Quote

Old   February 8, 2016, 05:20
Default
  #10
New Member
 
Join Date: Feb 2016
Posts: 22
Rep Power: 10
leasken is on a distinguished road
Quote:
Originally Posted by leasken View Post
So I tried to solve this problem using parameters. I created an expression "Dh" and assigned a value to it. I ran a simulation and in CFD-post I selected "Use as Workbench Input Parameter". In the Parameter Set I changed the definition of Dh from the value "0.005 [m]" to an expression using two other input parameters, so basically

P1 H 5
P2 W 5
P3 Dh 2*(P1*P2)/(P16+P18)

But then there's no unit assigned to P3 and Workbench complains about it. P1 and P2 are parameters from my CAD-file, where I have constructed H and W as expressions in the CAD software, imported the geometry to Workbench and enabled the parameters under CAD-parameters in the Mesh module. When P1 and P2 are enabled and appear in my Parameter Set, there is no unit assigned to them so P3 is dimensionless. When I just try to add [mm] after P1 and P2 in P3:

P3 Dh 2*(P1[mm]*P2[mm])/(P16[mm]+P18[mm])

Workbench says "Name 'P1_Q' is not defined." in both the Value and Unit box for P3. Rather frustrating. What am I missing or doing wrong?
Fixed it... Multiplied by 1 [mm].

P3 Dh (2*(P16*P18)/(P16+P18))*1[mm].
leasken is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Molar fraction in CFX Pre expression Niekjuh CFX 4 July 14, 2016 19:11
Accessing cell values (CFX Pre and CFX Post) brahmarishiraj CFX 14 June 24, 2014 19:12
REAL GAS UDF brian FLUENT 6 September 11, 2006 08:23
Free surface boudary conditions with SOLA-VOF Fan Main CFD Forum 10 September 9, 2006 12:24
UDF FOR UNSTEADY TIME STEP mayur FLUENT 3 August 9, 2006 10:19


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