|July 16, 2012, 05:16||
Translating a user defined code in Fluent to Star-CCM
Join Date: Dec 2011
Posts: 121Rep Power: 5
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
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;
|July 16, 2012, 16:44||
Join Date: Oct 2009
Posts: 637Rep Power: 13
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!
|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|