|
[Sponsors] |
June 16, 2022, 17:45 |
Moving Energy Source
|
#1 |
New Member
Join Date: Apr 2022
Posts: 2
Rep Power: 0 |
Hello Everyone,
I am working on to create a volumetric heat source (VHS) with a gaussian profile inside a simple cubic domain. I am working on Fluent 'Solidification & Melting' model. In order to create a moving volumetric heat source-VHS I am using DEFINE_SOURCE for my UDF. The equation that I am using for gaussian profile for VHS is attached [https://doi-org.ezproxy.uta.edu/10.1...0-019-04908-3] However I have energy source equation as a function of time and position the energy source that I created did not move. Here you can see my UDF basically below #include "udf.h" #include "math.h" #include "metric.h" #include "sg.h" #include "sg_mphase.h" #include "mem.h" #include "sg_mem.h" #include "flow.h" #include "unsteady.h" #define A 0.24 /*Absorption coefficient*/ #define P 400 /*Laser Power*/ #define re 0.0001 /*radius on top*/ #define ri 0.0002 /*radius on bottom*/ #define zi 0.00005 /*cone length parameter lower z axis*/ #define ze 0.0001 /*cone length parameter upper z axis*/ #define v1 1.200 /*laser velocity*/ #define v2 0 /*laser velocity*/ #define pi 3.1415 DEFINE_SOURCE(heat_source, c, t, dS, eqn) { real x[ND_ND]; C_CENTROID(x, c, t); real x0 = 0.00061, y0 = 0, z0 = 0; /*initial position of the heat flux*/ real t0 = 1; /*the time that the heat flux is stationary*/ real time = CURRENT_TIME; real H = ze - zi; real r0; r0 = ri; /*r0 = re + ((ri - re) / H) * (z - ze) z-ze equals to H then r0 equals to ri*/ real d; real Q0; double Q = 0.0; if (time<= 1) { Q = 0.0; } else { d = M_PI * H * pow(re, 2) + (re * ri) + pow(ri, 2); Q0 = 6 * A * P / d; Q = Q0 * exp(-1 * pow(x[0] - x0 - v1 * time, 2.0) + pow(x[1] - y0, 2.0) / pow(r0, 2)); dS[eqn] = 0.0; } return Q; } The script compiled without any error but the heat source did not move. Do I need to add more comments for advective flux for scalar transport equation. This is one of the topics previously discussed for welding/AM applications in the forum but it seems it is not solved yet. I hope this time we will figure it out. Any comments are welcome and I will be more than happy if anybody in the forum knows how to UDF a moving heat source. Thanks in advance Updated by Ahmet Alptug Metadata Views 1 Last Activity less than a minute ago Tags Tags ·Add |
|
June 16, 2022, 23:38 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
coordinate of heat source location must be updated with time to make it move
as of know I can see that only magnitude of source is time dependent
__________________
best regards ****************************** press LIKE if this message was helpful |
|
Tags |
laser spot welding, melt pool, moving heat source |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
polynomial BC | srv537 | OpenFOAM Pre-Processing | 4 | December 3, 2016 10:07 |
what is swap4foam ?? | AB08 | OpenFOAM | 28 | February 2, 2016 02:22 |
[Other] How to use finite area method in official OpenFOAM 2.2.0? | Detian Liu | OpenFOAM Meshing & Mesh Conversion | 4 | November 3, 2015 04:04 |
[swak4Foam] Error bulding swak4Foam | sfigato | OpenFOAM Community Contributions | 18 | August 22, 2013 13:41 |
[swak4Foam] build problem swak4Foam OF 2.2.0 | mcathela | OpenFOAM Community Contributions | 14 | April 23, 2013 14:59 |