# Fieldfunction Velocity (i) Direction

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 LinkBack Thread Tools Display Modes
 September 19, 2011, 07:25 Fieldfunction Velocity (i) Direction #1 Senior Member   Join Date: Dec 2010 Posts: 135 Rep Power: 8 Hi guys. I want to setup a field function for calculation of beta1 and beta2 (angles of fluid before blade and after). my idea is to calcluate this in the following way: 1. Radial Angle = atan2(x.abs(y)) 2. Relative Radial Velocity = sin(\$Radial Angle)*\$\$Velocity[1] - cos(\$Radial Angle)*\$\$Velocity[2] 3. Beta = atan2(\$\$Relative Radial Velocity/\$\$Velocity[3]) It the syntax and also the calculation itself right`? Thanks a lot

 September 19, 2011, 19:06 #2 Senior Member   Join Date: Oct 2009 Location: Germany Posts: 637 Rep Power: 14 No, at least the syntax is not right. And this is no statement about the calculation itself, I haven't checked it (too late now, I have to go to bed). In 1, it should be atan2(x,abs(y)) with a comma instead of a dot In 3, you are referencing a vector field function (\$\$Relative Radial Velocity), but you didn't specify whether you want to use the magnitude (mag(\$\$Relative Radial Velocity) or any of it's components (\$\$Relative Radial Velocity[x]). Further there are spaces in the name, so you can't reference it without brakets. It has to be \$\${Relative Radial Velocity}[0]. Be aware, there are wavy brakets needed! By the way, this also affects point 1 and 2 (\$Radial Angle instead of \${Radial Angle}). Generally spoken, I recommend to use field function names without spaces or minus (-). A minus is a common error source, as nearly everybody forgets one day to put the field function name with the minus in wavy brakets and wonders, why the field function does not compile. That's hard to find, when you notice the compile error two hours after programming the field function when starting the simulation and an error message pops up. That's the point when you start to get crazy because you will double check all, the syntax, all other field functions, you will copy and paste the name and all looks fine - but the field function keeps on not to compile. I speak from experience A space in the name is the same. It's not matter IF you will forget to put the brakets, it's just a matter WHEN you will forget it. But you WILL forget it one day. And when another guy has to look at the simulation, maybe a colleague, this two errors will knock him out unless he isn't a really smart guy. When he is a smart guy, he will find it in two minutes. When he isn't, he will kill you...

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Sof_70_Usthb CFX 3 July 9, 2011 06:15 devesh FLUENT 2 November 18, 2008 02:46 salman FLUENT 3 January 3, 2007 12:34 Vidya FLUENT 8 July 31, 2006 08:28 Antech Main CFD Forum 0 April 25, 2006 02:15

All times are GMT -4. The time now is 06:32.

 Contact Us - CFD Online - Privacy Statement - Top