CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   STAR-CD (http://www.cfd-online.com/Forums/star-cd/)
-   -   Alter coordinate system (http://www.cfd-online.com/Forums/star-cd/64321-alter-coordinate-system.html)

jimmer May 7, 2009 03:38

Alter coordinate system
 
Does anyone know how I can command the change of coordinate system in a subroutine?

vishyaroon May 7, 2009 10:22

Changing can be coded using

csys,<Co-ordinate sys number>

Is this what you are looking for?

Pauli May 7, 2009 13:46

Maybe, it depends upon what you are trying to accomplish.

Your post does not provide enough details. Which user subroutine? What are you trying to change?

A_Lyaskin May 8, 2009 05:00

AFAIK all coordinates in user subroutines are treated in global cartesian (i.e. computational) system. So you need to recalculate everything yourself

olauer May 11, 2009 03:49

There are two provided subroutines which could be used.

DIMENSION CIN(3),COUT(3)
CALL GLOLOC(CIN,COUT,ICOR)
CALL LOCGLO(COUT,CIN,ICOR)


Example from newxyz.f:

ICOR=5
do iv=1,nvert
CIN(1)=VCORN(1,IV)
CIN(2)=VCORN(2,IV)
CIN(3)=VCORN(3,IV)

CALL GLOLOC(CIN,COUT,ICOR)

any operation on local coordinates possible
COUT(2)=COUT(2)+OFFSET

CALL LOCGLO(COUT,CIN,ICOR)
VCORN(1,IV)=CIN(1)
VCORN(2,IV)=CIN(2)
VCORN(3,IV)=CIN(3)

enddo

Attention: all vertex values are in SI coordinates, local coordinate systems
could be defined in mm


All times are GMT -4. The time now is 05:12.