CFD Online Logo CFD Online URL
Home > Forums > STAR-CCM+

Translating a user defined code in Fluent to Star-CCM

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   July 16, 2012, 05:16
Default Translating a user defined code in Fluent to Star-CCM
Senior Member
Join Date: Dec 2011
Posts: 121
Rep Power: 5
fshak92 is on a distinguished road
I want To simulate the movement of a laser beam on my plate,to consider the thermal effect.
Because i could'nt find a way to simulate the radiation case,I tried to define my plate boundary condition as heat flux.Therefore i wrote a table to define the movement of the laser beam by time.simple case of my table :
x y z t(1s) t(2s) t(3s) ...
1 0 0 500 0 0
2 0 0 0 500 0
3 0 0 0 0 500

Writing such a table is time consuming,Fortunately a guy helped me and gave me a table which has been written in .c form for the fluent.But when i set this code to my user field function,nothing happens in my simulation.
I would appreciate if anybody tell me whether this code can be readable by star-CCM ?
Thanks in advance.

DEFINE_PROFILE(laser_beam,t,i) //Randbedingung für den Energiefluss durch den Laser
real x[ND_ND]; //Ortsvektor; ND liest aus ob 2D oder 3D-Fall
real X; //Ortskoordinate
real x_0=0.05; //starting point
real v=0.05; //velocity of the laser beam
real b=0.005; //width of the laser beam
real I_0=50000000; //Intensity
real time=RP_Get_Real("flow-time"); //der Variable time wird die Simulationszeit zugewiesen
face_t f;
F_CENTROID(x,f,t); //liest Koordinate aus
if(X>=x_0+time*v-b/2 && X<=x_0+time*v+b/2) //Laser bewegt sich entlang X
F_PROFILE(f,t,i) = I_0;
F_PROFILE(f,t,i) = 0;
fshak92 is offline   Reply With Quote

Old   July 16, 2012, 16:44
Senior Member
Join Date: Oct 2009
Location: Germany
Posts: 637
Rep Power: 12
abdul099 is on a distinguished road
Not sure what Star-CCM+ can do with user coding, but at least field functions are not the right point to put the code posted here.
You can use field functions when you transform your code into the right syntax.
Or you can do it by writing a Java macro.
Or you can use any programming language to write that table.

When it would be up to me, I would try to translate the code to the field function syntax first...
We do three types of jobs here:
You may choose any two!
abdul099 is offline   Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to solve the diverage of high speed centrifugal compressor, CFD code is STAR CCM layth STAR-CCM+ 3 May 21, 2012 05:48
User Defined Function in FLUENT Waqas Ahmed Fluent UDF and Scheme Programming 0 May 8, 2012 16:03
Question about user defined memories in FLUENT 6.3 lordofnoldor FLUENT 0 August 18, 2011 10:17
Gradient of a User defined Variable Ramadas CFX 2 August 21, 2007 09:19
Design Integration with CFD? John C. Chien Main CFD Forum 19 May 17, 2001 15:56

All times are GMT -4. The time now is 10:47.