|
[Sponsors] |
July 5, 2017, 20:17 |
CFX 10.0 If command
|
#1 |
New Member
Fernando
Join Date: Apr 2013
Posts: 15
Rep Power: 13 |
I am trying to make a conditional expression with "if" command in CFX-10.0
I read these articles: Conditional Expression in CFX Pre "if" command in CFX-13 is not really an "if" command!!!! But I do not know how to do it in CFX pre 10.0 I saw in youtube that "if" expression works on CFX 14, but I do not have it (my PC is old) https://www.youtube.com/watch?v=GJXQNhmqyhE (11:25) The string that I want to use is for define the volume fraction in a water tank: WaterVolFrac =if(y<WaterHt,1,0)*if(y>-0.1[ft],1,0) This is the error message: __________________________________________ ERROR Error in setting: "WaterVolFrac" via the expression: if(y<WaterHt,1,0)*if(y>-0.1[ft],1,0) Error found at the start of the line, at item: if unrecognised name __________________________________________ I read the _CFXTutorial.book.pdf, Tutorial_FreeSurfaceBump.pdf but they don't use the if command, they use this string: DownVFAir = step((y-DownH)/1[m]) |
|
July 6, 2017, 06:32 |
|
#2 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143 |
The if statement was introduced in a "recent" version of CFX. Not sure which one, maybe CFX 12, but it looks like CFX 10 did not have it. Sounds like a good time to upgrade to the current version of CFX to me.
|
|
July 7, 2017, 16:42 |
CFX-Pre 10.0 "if and step" command
|
#3 |
New Member
Fernando
Join Date: Apr 2013
Posts: 15
Rep Power: 13 |
I just adapted the original string to my case "WaterVolFrac =if(y<WaterHt,1,0)*if(y>-0.1[ft],1,0)". The function plot works and makes sense.
But I still do not knowing how "the step commad" works. On the other hand, the results in the post environment says that the tank is full of water until the top!... I was waiting something like this: |
|
July 9, 2017, 08:03 |
|
#4 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143 |
The step command is very simple, and is explained in the documentation (CFX Reference manual). If the argument is positive, it returns +1, if negative it returns 0, if exactly zero it returns 0.5.
|
|
August 9, 2017, 16:15 |
CFX-Pre 10.0 "if and step" command
|
#5 | |
New Member
Fernando
Join Date: Apr 2013
Posts: 15
Rep Power: 13 |
Quote:
Your comment was very useful, now I can adapt this string for make a synthetic "if" command if "step" returns +1 0 or 0.5 The problem with my simulation was not the step command. The mistake was in the vertical definition (Expressions: UpH, UpVFair) as you can see in my second comment in this post; the vertical variable was "Y" but the correct one is "Z". Here you can see the results with the corrections applied. Water Volume Fraction profile: Water Volume fraction surface Water Volume Fraction profile and surface: Last edited by camposrf; August 9, 2017 at 16:33. Reason: wrong "preview" clicking |
||
August 9, 2017, 18:23 |
|
#6 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143 |
Please do not post multiple versions of the same post on different threads.
Your surface looks very lumpy and rough. I assume it is not meant to be like this. * You probably have too coarse a mesh. Have you done a mesh sensitivity study? * For the initial condition you should blur the free surface over a small distance so irregularities in the mesh do not distort the surface. Have a look in the CFX documentation under best practices guide for multiphase for tips on this. |
|
August 9, 2017, 21:32 |
mesh sensitivity study FAQ
|
#7 | ||||
New Member
Fernando
Join Date: Apr 2013
Posts: 15
Rep Power: 13 |
Quote:
Quote:
Quote:
Yes, right again, it is a coarsed one. I have to do approximation cases first before run a detailed model “if I want the results this year” (joke). Further more, it has a worst residuals convergence (0.01). The good news is that the time step is ok because it is a steady simulation. I have to do this previous work because I do not have a powerful PC. I accept donations (is not a joke). No, I have not done. I think that my PC can not handle that. I do not know how I can do that. I did not find the FAQ with the instructions. Quote:
|
|||||
August 9, 2017, 21:46 |
the mesh of the tank
|
#8 |
New Member
Fernando
Join Date: Apr 2013
Posts: 15
Rep Power: 13 |
This is the mesh that I used, is not a detailed one but works for preliminary runs.
|
|
August 12, 2017, 23:26 |
Grid and error analysis FAQ
|
#9 | |
New Member
Fernando
Join Date: Apr 2013
Posts: 15
Rep Power: 13 |
Finally I found the FAQ, but searching from an external search engine.
Quote:
|
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
launch cfx from command line question | windhair | CFX | 3 | May 19, 2011 07:16 |
Export CGNS with CFX 10.0 | Luca | CFX | 1 | December 29, 2010 06:09 |
Low Reynolds Number k-epsilon formulation CFX 10.0 | Chris | CFX | 4 | December 7, 2009 23:51 |
How to red a Gambit mesh with Ansys CFX 10.0 | jpsegura | CFX | 5 | June 12, 2007 02:20 |
CFX 4.4 installation problem | Pandu Sattvika | CFX | 1 | December 1, 2001 04:07 |