CFD Online Discussion Forums

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

amarjogot July 17, 2013 13:01

problem writing field function
 
2 Attachment(s)
Hello everyone, I am having some problem using star CCM+ for my model. I was trying to use a specific function for my velocity inlet. As my model is a cylinder. It has two velocity component. One with the radial and another one with the tangential. I used a code while using it in the fluent (attached file). I am also not sure how to compile user defined function in star ccm+. Thanks in advance for the assistance.

Zoheb

phanh January 5, 2014 22:16

Quote:

Originally Posted by amarjogot (Post 440363)
Hello everyone, I am having some problem using star CCM+ for my model. I was trying to use a specific function for my velocity inlet. As my model is a cylinder. It has two velocity component. One with the radial and another one with the tangential. I used a code while using it in the fluent (attached file). I am also not sure how to compile user defined function in star ccm+. Thanks in advance for the assistance.

Zoheb

Hi Zobeb,

Did you solve your problem? I have the similar problem but I have not yet know how to do it. Can you give me some advises?

Thank you so much.

dsk2 January 6, 2014 21:23

Phanh,

You may have resurrected an old thread.

In order to specify the inlet velocity as a variable, you can use a field function in "Tools->Field Functions"

Create 3 field functions for velocity, say, Velx, Vely and Velz.

In order to specify variable components for velocity, change the velocity from constant to composite. Then you will have to an option to specify x, y and z velocity components. Change the velocity component from constant to field function for x, y and z velocity component and assign the corresponding field functions- Velx, Vely and Velz.

Note: the function $$Position("Cylindrical 1") returns a cartesian vector of the position coordinates in local coordinate system Cylindrical 1; the subscript operator [] is appended to access a single component of the position vector (with an index of [0], [1], or [2]).

phanh January 6, 2014 23:03

Quote:

Originally Posted by dsk2 (Post 468894)
Phanh,

You may have resurrected an old thread.

In order to specify the inlet velocity as a variable, you can use a field function in "Tools->Field Functions"

Create 3 field functions for velocity, say, Velx, Vely and Velz.

In order to specify variable components for velocity, change the velocity from constant to composite. Then you will have to an option to specify x, y and z velocity components. Change the velocity component from constant to field function for x, y and z velocity component and assign the corresponding field functions- Velx, Vely and Velz.

Note: the function $$Position("Cylindrical 1") returns a cartesian vector of the position coordinates in local coordinate system Cylindrical 1; the subscript operator [] is appended to access a single component of the position vector (with an index of [0], [1], or [2]).

Hi DSK,

Thank you for your recommendation. Using user field function, I have succeeded for my requirement. But your suggestion is a good way that I should try it. Could you tell me how to do it with user code in STAR CCM+? For some reason, I prefer definition of velocity profile by user code (by C language) rather than user field function.

Best regards.


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