|
[Sponsors] |
August 28, 2018, 05:36 |
Pulsed laser udf
|
#1 |
Member
Saurabh Das
Join Date: Jul 2018
Posts: 43
Rep Power: 8 |
Hello, I am writing a udf that will allow me to apply laser at a given point repetitively.
In the following udf, laser will be applied for the first 1 second, followed by a lull for the next half second. Laser will fire again for a half second, and then the laser will fall silent. Code:
#include "udf.h" #define a 0.2e-3 //radius of laser beam #define I 1.05e9 //Laser Intensity DEFINE_PROFILE(heat_Momin_flux, thread, position) { face_t f; double x[ND_ND],r,t,tempp,vol,ft; t = CURRENT_TIME; //assigning current time vallue to t begin_f_loop(f,thread) { tempp = F_T(f,thread); F_CENTROID(x,f,thread); r = sqrt(pow(x[0],2.0) + pow(x[1],2.0)); vol = (r*r)/(a*a); //exponential for laser if (t >=0 && t < 1) ft = 1; else if (t >= 1 && t < 1.5) ft = 0; else if (t >= 1.5 && t < 2) ft = 1; else ft = 0; F_PROFILE(f,thread,position) = I*ft*exp(-vol); end_f_loop(f,thread) } } I do think that the if else ladder is creating a problem. But I am not too sure. Please help me, I would be thankful to you if you could point out the error in this code. |
|
August 28, 2018, 07:08 |
|
#3 |
Member
Saurabh Das
Join Date: Jul 2018
Posts: 43
Rep Power: 8 |
The equation in which the exp(-vol) is used is the laser equation and as such, the value of exp(-vol) indicates the effect of laser at a given distance. Points at a farther distance will have higher vol, thus exp(-vol) will be almost equal to zero, indicating no effect of laser at points far away from laser application, but the points which are closer to the point of laser application will have larger change in heat flux.
|
|
August 28, 2018, 07:36 |
|
#4 |
Senior Member
|
You should count the cells which have non-zero values, say, "exp(-vol) > 1.0e-15". And you might need to sum up all the heat flux caused by the laser and make appropriate normalization rather than rely on the analytical expression.
|
|
August 29, 2018, 02:39 |
|
#5 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
you may try to use UDMI variable to check your profile.
Add following line in your code Code:
F_UDMI(F,t,0)= I*ft*exp(-vol); |
|
Tags |
if-else, pulsed laser |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF for vapor pressure | anuarun | Fluent UDF and Scheme Programming | 13 | June 23, 2024 14:12 |
Replicating Scalable Wall Function with a UDF | yousefaz | FLUENT | 0 | August 4, 2017 03:30 |
Source Term UDF VS Porous Media Model | pchoopanya | Fluent UDF and Scheme Programming | 1 | August 28, 2013 07:12 |
DEFINE_GEOM UDF Problems | Pat | FLUENT | 0 | August 14, 2003 14:16 |
UDF on-off Pulsed velocity inlet | Samuel | FLUENT | 0 | March 10, 2002 23:07 |