CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   STAR-CCM+ (https://www.cfd-online.com/Forums/star-ccm/)
-   -   user field function (https://www.cfd-online.com/Forums/star-ccm/76048-user-field-function.html)

 girishg May 12, 2010 11:51

user field function

I want to define new variable {(velocity:Ycomponent)/(free_stream_velocity)}. But in system defined field functions I am not able to find function called velocity:Ycomponent. It is only showing velocity which is a vector quantity. How can I make all components of velocity visible in field functions tab? Please help me.

I searched on help menu and got this: System field functions are predefined field functions that are created by the models activated in the continua, and share a particular set of properties.

How can I activate velocity components and magnitude?

 plaunie May 12, 2010 14:15

Velocity vector components are:
\$\$velocity[1]
\$\$velocity[2] <--velocity:Ycomponent
\$\$velocity[3]

 girishg May 12, 2010 17:41

Thanks a lot.

But what is the syntax(definition) for free stream velocity that can be used in the above formula? And also it doesn't show the three components of velocity in field function tab (one of the example in help window showed velocity as well as its three components).

 plaunie May 12, 2010 20:24

Quote:
 Originally Posted by girishg (Post 258558) Thanks a lot. But what is the syntax(definition) for free stream velocity that can be used in the above formula? And also it doesn't show the three components of velocity in field function tab (one of the example in help window showed velocity as well as its three components).

Question: are you trying to get the velocity magnitude, or velocity at a freestream boundary?

for local velocity magnitude:

I don't know off the top of my head, but Velocity is a vector so...
sqrt(\$\$velocity[1]^2+\$\$velocity[2]^2+\$\$velocity[3]^2) if nothing else.

I think there is a velocity magnitutde field function something like \$velocity.magnitude, or mag(\$\$velocity). I'm not sure I don't have access to the documentation at the moment.

For boundary velocity it's probably just easier to enter the velocity. i.e.

\$\$velocity[2]/12345

 Vinicius May 12, 2010 21:32

for velocity magnitude, use mag(\$\$Velocity) and for Y direction, use \$\$Velocity[1]. The directions X,Y,Z are represented by [0],[1],[2] respectively.

 girishg May 13, 2010 09:21

Thanks a lot guys!!! :)

 All times are GMT -4. The time now is 07:53.