|
[Sponsors] |
November 19, 2019, 16:56 |
Heat flux with position dependent on time
|
#1 |
New Member
Luis Donaldo Cuevas Iturbe
Join Date: Nov 2019
Posts: 2
Rep Power: 0 |
Hi everyone,
I'm trying to use a UDF to define my problem, which like the title says, is a heat flux changing position each second. I tried looking for examples in here but I was not able to find any, if you know want please share it to me. So, this is the code I used, but apparently it's not working pretty well because the heat source doesn't move with time. ----------------------------------------------- #include "udf.h" #define r 5/10000 DEFINE_PROFILE(wall_heat_flux,t,i) { real x[ND_ND]; real ti= CURRENT_TIMESTEP; real source = 84745; face_t f; begin_f_loop(f,t) { F_CENTROID(x,f,t); x[1]=x[1]+x[1]; x[2]=x[2]*ti; F_PROFILE(f,t,i) = M_PI*pow(r+x[0],2)*source*x[2]; } end_f_loop(f,t) } ------------------------------------------------------------------------- r is the raidus in meters of the area I want my heat source to heat. ti should be the time step source is the heat source (w/m^2) So, I have a rectangle prism, and I want this circle of r radius to heat one face of the prism in the z direction. Since F_centroid will locate me in the center of the face, with x[1]=x[1]+x[1] I'm triyng to locate me in the the surface of the prism and not in the middle. x[2] should be z so I want the initial position of x[2], in the center, to move each time step. F_Profile I'm trying to build the circle of r radius and multiply it by the source power. Can anyone please tell me where am I having a mistake? or any suggestions I would be very grateful. |
|
November 21, 2019, 00:51 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
this is strange part from my point of view
x[1]=x[1]+x[1]; x[2]=x[2]*ti; change to y=x[1]+x[1]; z=x[2]*ti; or something like that. I recommend to use this structure of code: real ti; ti= CURRENT_TIMESTEP;
__________________
best regards ****************************** press LIKE if this message was helpful |
|
November 21, 2019, 23:02 |
|
#3 |
New Member
Luis Donaldo Cuevas Iturbe
Join Date: Nov 2019
Posts: 2
Rep Power: 0 |
Hi Alexander,
First of all thank you for answering, secondly I wrote : x[1]=x[1]+x[1]; x[2]=x[2]*ti; because if x[n], represents the actual position, then I want x[2] to be changing. I don't know if I making myself clear. If I write z=x[2]*ti; How does fluent will know that z is this x[2]? I z values would be the ones I want of the position, but my main objective is the actual z position of the heat flux being in these changing places. I'm new in the field, so maybe I'm mistaking, please tell me if I'm wrong. Regards |
|
November 22, 2019, 00:48 |
|
#4 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
x[n] are coordinates of this cell(face)
and you can't change it. (if you want to move cell(face) you should use dynamic mesh) if you want your flux(heat source) "move" than you may vary the magnitude of flux in this cell(face). For example: 1sec flux = 1 2 sec flux = 2 3 sec flux = 3 4 sec flux = 10 5sec flux = 3 6sec flux = 2 7 sec flux = 1 for the neighbor cell(face) flux could be: 1sec flux = 0 2 sec flux = 1 3 sec flux = 2 4 sec flux = 3 5sec flux = 10 6sec flux = 3 7 sec flux = 2 I hope my idea is clear
__________________
best regards ****************************** press LIKE if this message was helpful |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[solidMechanics] Support thread for "Solid Mechanics Solvers added to OpenFOAM Extend" | bigphil | OpenFOAM CC Toolkits for Fluid-Structure Interaction | 686 | December 22, 2022 10:10 |
Average heat flux on surface over time | dsaen | FLUENT | 1 | October 14, 2019 17:54 |
pressure in incompressible solvers e.g. simpleFoam | chrizzl | OpenFOAM Running, Solving & CFD | 13 | March 28, 2017 06:49 |
Star cd es-ice solver error | ernarasimman | STAR-CD | 2 | September 12, 2014 01:01 |
UDF for time dependent heat flux | Rameshwar Ajja | FLUENT | 0 | February 16, 2006 01:26 |