Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.
Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.
ASK: easy functions in COMSOL4.3
Posted Sep 26, 2013, 1:54 a.m. EDT Interfacing, Heat Transfer & Phase Change, Parameters, Variables, & Functions Version 4.3b 3 Replies
Please login with a confirmed email address before reporting spam
Hi there,
I am now trying to model a moving laser beam (as heat flux) on a steel plate. I try to do this by following steps:
1. build a solid block (domain 1) to represent the steel plate.
2. set 'heat flux' on one of the surfaces (boundary 1).
3. type in all the parameters including r0(laser on-plate beam diameter), Q(laser power)
4. to implement a moving laser beam, I use variables x0, y0(laser center coordinates, time dependent, x0=0+2*t, y0=1+2*t, speed=2).
Now I encounter problems to specify the heat flux on the boundary. What I want to do is to set it this way:
****************
function [q_in] = SetHeatFlux(x, x0, y, y0, r0, Q)
distance=(sqrt(x-x0)^2+(y-y0)^2);
if distance<=r0
q_in=Q/(pi*r0^2);
else
q_in=0;
end
****************
Well, first let us forget about the moving laser, i.e. x0, y0 = constant. The aforementioned function may be implemented using LiveLink for MATLAB, but the manual says that I have to make all the input and output vectors, which brings too much trouble as I am not good at handling matrix··· I would prefer an easy function like this.
Could you help me? My appreciations.
Ce ZHU
I am now trying to model a moving laser beam (as heat flux) on a steel plate. I try to do this by following steps:
1. build a solid block (domain 1) to represent the steel plate.
2. set 'heat flux' on one of the surfaces (boundary 1).
3. type in all the parameters including r0(laser on-plate beam diameter), Q(laser power)
4. to implement a moving laser beam, I use variables x0, y0(laser center coordinates, time dependent, x0=0+2*t, y0=1+2*t, speed=2).
Now I encounter problems to specify the heat flux on the boundary. What I want to do is to set it this way:
****************
function [q_in] = SetHeatFlux(x, x0, y, y0, r0, Q)
distance=(sqrt(x-x0)^2+(y-y0)^2);
if distance<=r0
q_in=Q/(pi*r0^2);
else
q_in=0;
end
****************
Well, first let us forget about the moving laser, i.e. x0, y0 = constant. The aforementioned function may be implemented using LiveLink for MATLAB, but the manual says that I have to make all the input and output vectors, which brings too much trouble as I am not good at handling matrix··· I would prefer an easy function like this.
Could you help me? My appreciations.
Ce ZHU
3 Replies Last Post Sep 30, 2013, 4:56 a.m. EDT