CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   STAR-CCM+ (http://www.cfd-online.com/Forums/star-ccm/)
-   -   Coordinate System Orientation (http://www.cfd-online.com/Forums/star-ccm/106201-coordinate-system-orientation.html)

ryancoe August 21, 2012 17:14

Coordinate System Orientation
 
Does anyone know how to get the relative orientation of a local coordinate system in a field function?

I have an overset region in my simulation, which rotates at an arbitrary rate (will eventually be controlled by a macro). I'd like to get the orientation of that region directly (without integrating the rotation rate over time).

I thought I could use something with the $$Centroid or $$Position functions, possibly in conjunction with the cross product function, but just get zeros.

Any thoughts?

Thanks,

Ryan

siara817 August 22, 2012 06:04

Have you tried to generate a new coordinat system, and then use that coordinate system in the field funtion?

ryancoe August 22, 2012 07:59

Yes. I've created a local coordinate system that is "managed" by the rotation motion (it rotates according to that motion).

So I have a coordinate system that is rotated, and the lab coordinate system to which I would like to find its relative orientation, but haven't figured out a field function to do so.

Ryan

husker August 22, 2012 08:15

Hi,

You can find the relation between user created coordinate system and lab coordinate system. You should open the edit menu of the coordinate system you created. Then you will find the center coordinates and the relative angles of it.

Regards

ryancoe August 22, 2012 08:28

Yes, I've noticed that. If I could only get those numbers into my field function, I'd be happy. Any ideas?

Thanks,

Ryan

abdul099 August 28, 2012 19:47

When you anyway do it with a macro, you can get the orientation from the coordinate system by the macro. Then you can either process it directly in the macro or the macro can put it in the field function.

ryancoe January 31, 2013 17:17

I finally came back to this issue... As abdul points out, doing this in a macro is much easier.

Code:

angle = Vector3D.angle(rudderCsys.getBasis0().toDoubleArray(), bodyfixedCSys.getBasis0().toDoubleArray())

bvieira November 4, 2014 04:46

Hi Ryan,

I see that you figured a way of extracting the orientation of the coordinate system within a macro (java file).

However, I need to calculate the orientation at every time step (or at every X time-steps) and then export these values on a table. My macros don't allow me to perform activities during run time, except if I define field functions and tables.

Any ideia on how to do define a field function that extract that orientation?

Thanks a lot.


All times are GMT -4. The time now is 00:59.