|
[Sponsors] |
Neumann boundary condition for heat flux using UDF |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 10, 2021, 10:59 |
Neumann boundary condition for heat flux using UDF
|
#1 |
New Member
YADU KRISHNAN N
Join Date: Aug 2021
Posts: 14
Rep Power: 5 |
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. |
|
September 10, 2021, 15:34 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
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". |
|
September 12, 2021, 11:53 |
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 |
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! |
|
September 13, 2021, 02:49 |
|
#4 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
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 |
|
September 13, 2021, 11:22 |
|
#5 |
New Member
YADU KRISHNAN N
Join Date: Aug 2021
Posts: 14
Rep Power: 5 |
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. |
|
September 14, 2021, 01:53 |
|
#6 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
check the units of heat flux you are applying
__________________
best regards ****************************** press LIKE if this message was helpful |
|
September 14, 2021, 08:53 |
|
#7 |
New Member
YADU KRISHNAN N
Join Date: Aug 2021
Posts: 14
Rep Power: 5 |
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. |
|
|
|
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 |