CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   STAR-CCM+ (https://www.cfd-online.com/Forums/star-ccm/)
-   -   Coordinate Systems and Vector Field Function (https://www.cfd-online.com/Forums/star-ccm/217601-coordinate-systems-vector-field-function.html)

cwl May 18, 2019 01:23

Coordinate Systems and Vector Field Function
 
Hi,

Let's say we've got two coordinate systems: default - "Laboratory" and a user-created one - "Coordinate System 1".

What I'm not getting:

1) How would I set a Vector Field Function with components [x, y, z] in Coordinate System 1?

2) If i know components [x, y, z] of a Vector in Coordinate System 1 - how can I obtain it's components in Laboratory coordinate system?

PS Copying data from Coordinate System properties and using it in Field Fuctions as constants is not a way, since Coordinate System 1 can be set on the body in CAD model and it's position can be changed.

fluid23 May 21, 2019 17:40

1) That is somewhat dependent on what you are trying to define. Do you have discrete XYZ values that you want to prescribe and the interpolate to the rest of the domain?
Is it a constant vector everywhere? Is it a function of other vector field functions that are already defined?

In general, Right-click the 'Tools > Field Functions' node and select 'New > Vector Function'. Where you go from there depends on what you want to do. For example, if you wanted to define a constant global vector in the Y direction you could define your function as [0,1,0]. If you wanted to get the normal force due to pressure you might define $StaticPressure*$$Area[].

2) If you already have a function defined and you want to change to a different coordinate system, you call (@CoordinateSystem("csys name"). For example, you can report position in the cylindrical csys as, $$Position(@CoordianteSystem("Laboratory.Cylindric alSystem")).

cwl May 23, 2019 21:02

Hi fluid 23

Thank you for your reply :>

Quote:

Originally Posted by fluid23 (Post 734361)
Do you have discrete XYZ values that you want to prescribe and the interpolate to the rest of the domain?

It's not about interpolation. Just imagine that I've got a constant vector which components I know for Coordinate System 1 - and I want to obtain its components in Laboratory.

Quote:

Originally Posted by fluid23 (Post 734361)
Is it a constant vector everywhere?
Is it a function of other vector field functions that are already defined?

In general theese cases should not be different.


Quote:

Originally Posted by fluid23 (Post 734361)
In general, Right-click the 'Tools > Field Functions' node and select 'New > Vector Function'.
Where you go from there depends on what you want to do. For example, if you wanted to define a constant global vector in the Y direction you could define your function as [0,1,0].
If you wanted to get the normal force due to pressure you might define $StaticPressure*$$Area[].

What if I want to define a constant vector in the Y-direction of Coordinate System 1, not Laboratory? - How do I set it?

Quote:

Originally Posted by fluid23 (Post 734361)
2) If you already have a function defined and you want to change to a different coordinate system, you call (@CoordinateSystem("csys name").
For example, you can report position in the cylindrical csys as, $$Position(@CoordianteSystem("Laboratory.Cylindric alSystem")).

Exactly - it changes to a different coordinate system from Laboratory.
Thus $$Vector1(@CoordianteSystem("Laboratory.Cylindrica lSystem")) works in a way that it treats Vector1 components as if they were set in global (Laboratory) coordinate system - and returns components of Vector1 in CylindricalSystem.

Bot how would I change Vector's components known in different coordinate system to Laboratory?


All times are GMT -4. The time now is 17:14.