|
[Sponsors] |
July 15, 2016, 14:22 |
CFD-Post Expression help
|
#1 |
New Member
Justin
Join Date: Jan 2015
Posts: 28
Rep Power: 11 |
Hey all,
I need help writing an expression in CFD-Post. I have a cylinder through which a fluid flows and encounters arrays of static bars that are intended to mix the fluid. What I want to do is create an expression that outputs the standard deviation of the velocity magnitude for a clip plane of its cross-section. I'm fairly new to the CFX Expression Language and haven't had much luck searching online for help. I know the equations for velocity magnitude and standard deviation: where nodes. So how can I translate that second equation into a CEL output expression? My variables in CFD-Post are Velocity, Velocity u, Velocity v, and Velocity w. The location I want the standard deviation of velocity magnitude computed is Plane 2. If someone could help me out, that would be awesome! |
|
July 16, 2016, 06:25 |
|
#2 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143 |
There already is a variable, I think it is called "Velocity" which is the magnitude of the velocity. This means you don't need your first equation.
Your function could be something like: Vavg = volumeAve(Velocity)@domain STDDEV = sqrt(volumeAve((Velocity-Vavg)^2)@domain) Note that I used a volume average function, not the nodal average you defined. If you do the nodal average it can get distorted in meshes with changes in element size. Note you will probably have to add a units correction for the sqrt function (ie, make it unitless). |
|
July 18, 2016, 12:07 |
|
#3 |
New Member
Justin
Join Date: Jan 2015
Posts: 28
Rep Power: 11 |
Thanks for your help! Although, I had to use areaAve rather than volumeAve because my domain was a plane (a.k.a. clip plane) of the fluid body. Also, I attempted to make it unitless by giving the expression units of [m^-1 s] but it wouldn't allow me to do so. I'll figure that out though. I really appreciate your help!
|
|
July 18, 2016, 20:33 |
|
#4 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143 |
If the expression evaluates to units [m^-1 s] then multiply by 1 [m s^-1] and it will be unitless. But this sort of thing is usually a bad idea, you should check your function to get the units right in the first place.
|
|
July 20, 2016, 16:54 |
|
#5 |
New Member
Justin
Join Date: Jan 2015
Posts: 28
Rep Power: 11 |
I appreciate your help! Everything is working just fine.
On another note, I'm now wanting to determine the percentage of fluid in two velocity ranges: range A is 0-5% maximum velocity in the fluid domain; and range B 0-0.003 m/s. My method was to create a volume, select it as an Isovolume with the variable velocity. I chose the mode as below value and checked inclusive. Of course, I created two volumes: one for each range. In the value box for the Isovolume of range A, I put the expression 0.05*maxVal(Velocity)@fluid. Then in the Expressions tab, I created two new expressions: PercentRangeA = ((volume()@Volume A)/(volume()@fluid))*100 PercentRangeB = ((volume()@Volume B)/(volume()@fluid))*100 The percentages were both much higher than I had anticipated. When I had used EnSight, the percentages were around 12% and 5% for range A and range B, respectively. My questions are: first, did I create the desired Isovolumes correctly; and second, did I use the correct expressions? Again, I really appreciate your help! Thanks. |
|
July 20, 2016, 21:07 |
|
#6 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143 |
You will have to work your way through the way you calculated it. Is the isovolume correct? Is the volume calculated correctly?
|
|
July 21, 2016, 16:24 |
|
#7 |
New Member
Justin
Join Date: Jan 2015
Posts: 28
Rep Power: 11 |
Going back to the original question, why do I use volumeAve or areaAve rather than just plain old ave (average)? I understand the two former are volume weighted or area weighted averages...but it definitely makes a difference as to which one I use. I experimented around with areaAve and ave and the standard deviation changes.
Why I'm asking is because there's a difference between the standard deviations I calculated using EnSight and CFD-Post. If both softwares are using nodal values for velocity magnitude, I'd expect to get nearly the same result for standard deviation. Am I wrong? The CFD-Post results differed from those in EnSight even though they were formed from the same mesh and same Fluent simulation. |
|
July 21, 2016, 18:17 |
|
#8 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143 |
Ave simply sums up the nodal values and divides by the number of nodes. It takes no account of the size of the control volumes the nodes represent.
CFD-Post uses the integration points to calculate some values whereas exported data to Ensight would probably be just the nodal values. Thus the CFD-Post values should be on higher resolution data and be more accurate. |
|
October 27, 2021, 17:04 |
|
#9 |
New Member
kailash
Join Date: Jun 2018
Posts: 19
Rep Power: 7 |
Thank you very much for this expression. I am able to implement it for a problem similar to the one you faced last time.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
CFD Design...The CFD Future | John C. Chien | Main CFD Forum | 20 | November 19, 2015 23:40 |
Error reading profile data in expression in cfx post | banu | CFX | 4 | March 27, 2015 09:03 |
CFD Online Celebrates 20 Years Online | jola | Site News & Announcements | 22 | January 31, 2015 00:30 |
CFD Post - How to check for case in an expression | pilakin | ANSYS | 0 | September 26, 2014 04:44 |
How to install CGNS under windows xp? | lzgwhy | Main CFD Forum | 1 | January 11, 2011 18:44 |