|
[Sponsors] |
Translating a user defined code in Fluent to Star-CCM |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 16, 2012, 06:16 |
Translating a user defined code in Fluent to Star-CCM
|
#1 |
Senior Member
Join Date: Dec 2011
Posts: 121
Rep Power: 15 |
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); } |
|
July 16, 2012, 17:44 |
|
#2 |
Senior Member
Join Date: Oct 2009
Location: Germany
Posts: 636
Rep Power: 22 |
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! |
|
|
|
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 08:43 |
how to solve the diverage of high speed centrifugal compressor, CFD code is STAR CCM | layth | STAR-CCM+ | 3 | May 21, 2012 06:48 |
Question about user defined memories in FLUENT 6.3 | lordofnoldor | FLUENT | 0 | August 18, 2011 11:17 |
Gradient of a User defined Variable | Ramadas | CFX | 2 | August 21, 2007 10:19 |
Design Integration with CFD? | John C. Chien | Main CFD Forum | 19 | May 17, 2001 16:56 |