|
[Sponsors] |
Temperature profile UDF for 3D cylinder surface |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 5, 2015, 13:17 |
Temperature profile UDF for 3D cylinder surface
|
#1 |
New Member
Himel Barua
Join Date: Aug 2014
Posts: 2
Rep Power: 0 |
Hi,
I am trying to incorporate a temperature profile on a surface of a 3D cylidner. I have been using this code. But, when i tried to interprete the code it starts to say undeclared variable. I have some idea to write UDF for 2D case where the boundary is a line, But for 3D case where the boundary is surface i am not very sure. Can anyone please help me in this regard? I am giving the code here. #include "udf.h" DEFINE_PROFILE(temperature_prof,thread,index) { real x[ND_ND]; real y; face_t f; begin _f_loop (f, thread) { F_centroid(x,f,thread); y=x[0]; F_PROFILE(f,thread,index)=-11497.5*y*y-659.781*y+1350; } end_f_loop(f,thread) } I am confused about particularly the red line, for 2D surface sholud the x should be 1D or 2D array ? |
|
June 16, 2015, 11:59 |
UDF for Imposing Heat Transfer Coefficient as a function of temperature on a line
|
#2 |
New Member
Joseph Thodiyil
Join Date: Jun 2015
Posts: 2
Rep Power: 0 |
Hi,
I am new to UDF's. I am trying to impose a Convection heat transfer coefficient on a line on the OD of the pipe (in a pipeline 2D axisymmetric model), as function of the surface temperature. This is my attempt. Please provide your comments. /*---------------------------------------------------------------------------------------- heffupstream_rev.c UDF for specifying steady-state external CHTC, heff on a line as a function of Surface Temperature, Ts in a 2D axisymmetric CFD model: heff(Ts) = beta1*exp(beta2*Ts) + beta3 Temperature Ts is in Kelvins. /*---------------------------------------------------------------------------------------*/ #include "udf.h" #define beta1 8.83421; /* W/m^2.K */ #define beta2 1.45536e-3; /* 1/K */ #define beta3 -5.25737; /* W/m^2.K */ /* t is a pointer to the face's thread */ DEFINE_PROFILE(heff_upstream, c, t) { /* Variable Declarations */ real Ts = C_T(c,t); /* Ts is in Kelvins & C_T is the Cell Temperature variable Macro */ face_t f; /* f is a face thread index */ begin_f_loop(f,t) { F_PROFILE(f, t) = beta1 * exp(beta2*Ts) + beta3; } end_f_loop(f, t) } |
|
Tags |
fluent, temperature profile, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[openSmoke] libOpenSMOKE | Tobi | OpenFOAM Community Contributions | 562 | January 25, 2023 10:21 |
How to do UDF for temperature profile on a semi-disc? | Reivax | Fluent UDF and Scheme Programming | 5 | April 7, 2015 23:54 |
temperature profile variation -UDF | ahvz | Fluent UDF and Scheme Programming | 4 | July 23, 2013 08:55 |
[snappyHexMesh] Layers don't fully surround surface | EVBUCF | OpenFOAM Meshing & Mesh Conversion | 14 | August 20, 2012 05:31 |
Boundary Temperature Profile UDF error | shikamaru | Fluent UDF and Scheme Programming | 1 | May 18, 2012 22:19 |