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

Neumann boundary condition for heat flux using UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 10, 2021, 10:59
Default Neumann boundary condition for heat flux using UDF
  #1
New Member
 
YADU KRISHNAN N
Join Date: Aug 2021
Posts: 14
Rep Power: 5
Yadu krishnan is on a distinguished road
Trying to give Neumann boundary condition for heat flux using below UDF and getting error Error: received a fatal signal (Segmentation fault).


#include "udf.h"
#include "mem.h"
DEFINE_PROFILE(Heat_flux,thread,position)
{

cell_t c;
face_t f;
real x[ND_ND];
real cell[ND_ND];
int k = 1;
real wf;
real nc;
real temp;
real tempgrad ;
real Twall=300;
real delta;

begin_f_loop(f, thread)

{
F_CENTROID(x,f, thread);
wf = x[1];
c = F_C0(f,thread);
C_CENTROID(cell,c, thread);
nc = cell[1];
delta = wf-nc;
temp = C_T(c, thread);
tempgrad= (temp - Twall)/delta ;
F_PROFILE(f, thread, position) = k * tempgrad;
}
end_f_loop(f, thread)


}




Tried initializing and run a few iterations before loading UDF and not working.

Yadu krishnan is offline   Reply With Quote

Old   September 10, 2021, 15:34
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
temp = C_T(c, thread);

Here is the problem: "thread" is a face thread, not a cell thread. You still need to find the cell thread for cell c.

I forgot how that works.
__________________
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build".
pakk is offline   Reply With Quote

Old   September 12, 2021, 11:53
Default Problem with wall heat flux in supersonic flow related validation case
  #3
New Member
 
Tamil Nadu
Join Date: Apr 2021
Posts: 6
Rep Power: 5
aved is on a distinguished road
Hi!
I am doing a heat transfer to air from the hot wall which is almost a Rayleigh flow case kinda simulation. I wanted to do a validation but couldn't find a good experimental paper. Can anyone suggest me a paper?
Thanks!
aved is offline   Reply With Quote

Old   September 13, 2021, 02:49
Default
  #4
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
as Pakk said you need to define cell and thread of the finite volume adjusted to face you are looping
you need to use macros:
F_C0(f,t);
THREAD_T0(t);
final code
Code:
#include "udf.h"

DEFINE_PROFILE(my_heat_flux,thread,position)
{

cell_t c0;
Thread *t0;
face_t f;
real x[ND_ND];
real cell[ND_ND];
int k = 1;
real wf;
real nc;
real temp;
real tempgrad ;
real Twall=300;
real delta;

begin_f_loop(f, thread)

{
F_CENTROID(x,f, thread);
wf = x[1];
c0 = F_C0(f,thread);
t0 = THREAD_T0(thread);
C_CENTROID(cell,c0, t0);
nc = cell[1];
delta = wf-nc;
temp = C_T(c0, t0);
tempgrad= (temp - Twall)/delta ;
F_PROFILE(f, thread, position) = k * tempgrad;
}
end_f_loop(f, thread)


}
__________________
best regards


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

Old   September 13, 2021, 11:22
Default
  #5
New Member
 
YADU KRISHNAN N
Join Date: Aug 2021
Posts: 14
Rep Power: 5
Yadu krishnan is on a distinguished road
Thanks. There is no error showing now. But when I load the udf for heat flux boundary condition and running the simulation, solution is not converged for cold flow without reaction. Below are the model parameters and BCs.



Energy equation - ON
Viscous - Laminar
Species transport - ON , H2&air mixture,No volumetric reactions


inlet BC : velocity = 0.3 m/s , Mass fraction of h2 =0.6,

Mass fraction of o2=0.23


wall BC : above UDF
Hybrid initialization.


The temperature contour is same from the beginning and not changing even after 5000 iterations and attached herewith.
Attached Images
File Type: png mesh1 temp.png (32.1 KB, 10 views)
Yadu krishnan is offline   Reply With Quote

Old   September 14, 2021, 01:53
Default
  #6
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
check the units of heat flux you are applying
__________________
best regards


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

Old   September 14, 2021, 08:53
Default
  #7
New Member
 
YADU KRISHNAN N
Join Date: Aug 2021
Posts: 14
Rep Power: 5
Yadu krishnan is on a distinguished road
Heat flux units are W/m2 which is in mismatch with UDF output. So if I access thermal conductivity of wall(W/mK) and store it in variable 'k' , will it work?


Or do i need to make temperature gradient non dimensional.
Yadu krishnan is offline   Reply With Quote

Reply


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
Heat flux UDF boundary condition on a wall KsaMe Fluent UDF and Scheme Programming 8 June 25, 2020 19:28
How to define Heat flux UDF in ansys in Boundary Condition? Azim07 FLUENT 1 August 16, 2019 01:28
Define_profile UDF for Transient Heat flux boundary condition Amoljoshi Fluent UDF and Scheme Programming 2 June 20, 2018 22:55
CFD analaysis of Pelton turbine amodpanthee CFX 31 April 19, 2018 19:02
UDF : Neumann boundary condition PierreM FLUENT 1 December 5, 2008 08:06


All times are GMT -4. The time now is 04:24.