CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > Siemens > STAR-CCM+

Translating a user defined code in Fluent to Star-CCM

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 16, 2012, 05:16
Default Translating a user defined code in Fluent to Star-CCM
  #1
Senior Member
 
Join Date: Dec 2011
Posts: 121
Rep Power: 14
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;
begin_f_loop(f,t)
{
F_CENTROID(x,f,t); //liest Koordinate aus
X=x[0];
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;
else
F_PROFILE(f,t,i) = 0;
}
end_f_loop(f,t);
}
fshak92 is offline   Reply With Quote

Old   July 16, 2012, 16:44
Default
  #2
Senior Member
 
Join Date: Oct 2009
Location: Germany
Posts: 636
Rep Power: 21
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:
GOOD, FAST AND CHEAP
You may choose any two!
abdul099 is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
User Defined Function in FLUENT Waqas Ahmed Fluent UDF and Scheme Programming 3 July 29, 2018 07:43
how to solve the diverage of high speed centrifugal compressor, CFD code is STAR CCM layth STAR-CCM+ 3 May 21, 2012 05:48
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 06:14.