CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Heat flux with position dependent on time

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By AlexanderZ

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 19, 2019, 16:56
Default Heat flux with position dependent on time
  #1
New Member
 
Luis Donaldo Cuevas Iturbe
Join Date: Nov 2019
Posts: 2
Rep Power: 0
LuisDo is on a distinguished road
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.
LuisDo is offline   Reply With Quote

Old   November 21, 2019, 00:51
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 33
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
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;
LuisDo likes this.
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   November 21, 2019, 23:02
Default
  #3
New Member
 
Luis Donaldo Cuevas Iturbe
Join Date: Nov 2019
Posts: 2
Rep Power: 0
LuisDo is on a distinguished road
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
LuisDo is offline   Reply With Quote

Old   November 22, 2019, 00:48
Default
  #4
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 33
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
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
AlexanderZ is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 10:53.