CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   STAR-CCM+ (https://www.cfd-online.com/Forums/star-ccm/)
-   -   Using cylindrical coordinates (https://www.cfd-online.com/Forums/star-ccm/173873-using-cylindrical-coordinates.html)

harry123 June 29, 2016 06:09

Using cylindrical coordinates
 
Hi,

Can someone tell me how to use cylindrical coordinate (radius) value in defining a field functin ?

I have made this Cylindrical coordinate system under Tools>coordinate system>Laboratory>Local coordinate system.

I would like to use the radial length in a field function. The function ${RadialCoordinate} seems to give me axial length. (My radial length is in the original X axis direction and axis lies along Y axis)

Thanks for your replies and suggestions.

kirrer June 29, 2016 16:01

You can refer to components of a coordinate system (or any vector component) using the [i] notation, with i=0 for the first element, i=1 for the 2nd, etc. In a field function, $$Position[0] returns the x-coordinate in the lab coordinate system. For a custom coordinate system, you need to add the name in parenthesis and quotes like $$Position("myCustomCsys")[0]. For positions, 0 refers to x, 1 refers to y, 2 refers to z component of the position vector. In the case of a cylindrical coordinate system, 0 refers to radius, 1 refers to theta, and 2 refers to z. More info (including embedded coordinate systems) is in the user guide, search for "Referencing Field Functions, Coordinate Systems, and Reference Frames".

I should add, I believe that $RadialCoordinate refers to the coordinate with respect to the region's defined axis. Under the Region you can define the axis origin and orientation for this and other purposes (like moving reference frame). So, typically you are better off defining the coordinate system and referring to components as indicated above, rather than defining the region axis and using RadialCoordinate (or TangentialVelocity, etc).

harry123 July 1, 2016 03:26

Thank you very much. That helped a lot.

DanielStar May 25, 2020 12:20

Quote:

Originally Posted by kirrer (Post 607308)
You can refer to components of a coordinate system (or any vector component) using the [i] notation, with i=0 for the first element, i=1 for the 2nd, etc. In a field function, $$Position[0] returns the x-coordinate in the lab coordinate system. For a custom coordinate system, you need to add the name in parenthesis and quotes like $$Position("myCustomCsys")[0]. For positions, 0 refers to x, 1 refers to y, 2 refers to z component of the position vector. In the case of a cylindrical coordinate system, 0 refers to radius, 1 refers to theta, and 2 refers to z. More info (including embedded coordinate systems) is in the user guide, search for "Referencing Field Functions, Coordinate Systems, and Reference Frames".

I should add, I believe that $RadialCoordinate refers to the coordinate with respect to the region's defined axis. Under the Region you can define the axis origin and orientation for this and other purposes (like moving reference frame). So, typically you are better off defining the coordinate system and referring to components as indicated above, rather than defining the region axis and using RadialCoordinate (or TangentialVelocity, etc).

I still dont get it, lets say I want to make a drag force report on a rotating body, hence I need to choose theta direction. How do I write it?
Assuming that Cylindrical 1 is my cylindrical coordinate system, is that will be okay?

$$Position("Cylindrical 1")[0,1,0]

or I should write:
[$$Position("Cylindrical 1")[0]=0 ,$$Position("Cylindrical 1")[1]=1 , $$Position("Cylindrical 1")[2]=0]

I don't see my coordinate system on the options list, there is a screenshot:

https://ibb.co/wg4w0pS


All times are GMT -4. The time now is 04:18.