|
[Sponsors] |
UDF for a time varying heat flux boundary condition |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 21, 2013, 15:38 |
UDF for a time varying heat flux boundary condition
|
#1 |
Member
Mohamed
Join Date: Jan 2011
Location: Algeria
Posts: 46
Rep Power: 15 |
Hello,
I'm VERY new to Fluent and I'm attempting to write a UDF that will make the heat flux at a wall a function of time. I've never programmed in C before either so I'm having some trouble getting the correct sytax My function in Attach Files: Please help me to witre it I : Heat flux. A : area of the front surface. t : Time. T : Temperature. h : heat transfer coefficient. X : depth. Cp: specific heat \rho: density. Thank you. |
|
November 21, 2013, 17:44 |
|
#2 |
Senior Member
Join Date: Jan 2010
Location: Germany
Posts: 268
Rep Power: 17 |
Please look into the UDF documentation there are some examples how to define a profile.
Macro to use is DEFINE_PROFILE(name,thread,nv) and then the function would be over F_PROFILE through the face_centroids in the face thread. |
|
November 21, 2013, 19:19 |
|
#3 |
Member
Mohamed
Join Date: Jan 2011
Location: Algeria
Posts: 46
Rep Power: 15 |
Thank you, but can you give me an idea how write it please.
|
|
November 22, 2013, 14:38 |
|
#4 |
Senior Member
François Grégoire
Join Date: Jan 2010
Location: Canada
Posts: 392
Rep Power: 17 |
here is an example, I guess you can just apply the profile on your boundary as a heat flux: http://www.cfd-online.com/Forums/flu...tml#post463127
|
|
November 27, 2013, 04:44 |
|
#5 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
||
August 5, 2018, 05:32 |
|
#6 | |
Member
Join Date: Oct 2017
Posts: 52
Rep Power: 9 |
Quote:
I have written a udf for this but it is showing "segmentation fault". can you tell me where might be the problem ? Code:
#include "udf.h" DEFINE_PROFILE(fluxloss,thread,position) { real h; real T_ext; face_t f; begin_f_loop(f,thread) { h = 10; T_ext = 300; F_PROFILE(f,thread,position) =-10*(WALL_TEMP_INNER(f,thread)-T_ext); } end_f_loop(f,thread) } |
||
August 5, 2018, 23:06 |
|
#7 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
try this code
Code:
#include "udf.h" DEFINE_PROFILE(fluxloss,thread,position) { real h; real T_ext; face_t f; Thread *t0=thread->t0; /* Do nothing if areas are not computed yet or not next to fluid. */ if (!Data_Valid_P() || !FLUID_THREAD_P(t0)) return; begin_f_loop(f,thread) { h = 10; T_ext = 300; F_PROFILE(f,thread,position) =-10*(WALL_TEMP_INNER(f,thread)-T_ext); } end_f_loop(f,thread) } |
|
August 7, 2018, 13:44 |
|
#8 | |
Member
Join Date: Oct 2017
Posts: 52
Rep Power: 9 |
Quote:
|
||
August 7, 2018, 22:56 |
|
#9 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
DEFINE_PROFILE macro is using to define user-defined boundary condition. You may use it anywhere.
to set this profile as BC for UDS go to boundary conditions-> select face you are interested in -> select UDS tab -> select specified value -> select this profile instead of "constant" best regards |
|
August 8, 2018, 13:51 |
|
#10 | |
Member
Join Date: Oct 2017
Posts: 52
Rep Power: 9 |
Quote:
it is working fine. but i have a doubt that the following expression is for heat flux, should i use specified flux instead of specified value? |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
mesh file for flow over a circular cylinder | Ardalan | Main CFD Forum | 7 | December 15, 2020 14:06 |
Constant Heat Flux Boundary Condition on Long Thin Pipe | CGramlich | SU2 | 3 | April 22, 2013 09:25 |
Enforce bounds error with heat loss boundary condition at solid walls | Chander | CFX | 2 | May 1, 2012 21:11 |
time varying boundary condition | cfd-student | CFX | 0 | April 15, 2008 09:31 |
UDF for time dependent heat flux | Rameshwar Ajja | FLUENT | 0 | February 16, 2006 01:26 |