|
[Sponsors] |
June 3, 2013, 05:57 |
temperature profile variation -UDF
|
#1 |
Senior Member
Moha
Join Date: Mar 2013
Location: EU
Posts: 103
Rep Power: 0 |
Does fluent allow the external temperature function to be defined "by branches": i.e. one equation for 0<t<10000s and another for t>10000s for example. This way, the fitting would become much easier with distinct equations for distinct branches of time…
I have this code but it has only one fitting curve equation, while I have two equations for distinct times. how to do this ? Code:
/*********************************************************************** udfexample.c UDF for specifying transient temperature profile boundary condition ************************************************************************/ #include "udf.h" #include "mem.h" DEFINE_PROFILE(Temp_Profile, thread, position) { real x[ND_ND]; real y; real theProfile; face_t f; begin_f_loop(f, thread); { F_CENTROID(x,f,thread); y = CURRENT_TIME; theProfile=(283.7656)+25.44573*exp(-0.5*((y-49657.42)*(y-49657.42)/(11529.66*11529.66))); F_PROFILE(f, thread, position) =theProfile; } end_f_loop(f,thread) } regards, |
|
June 10, 2013, 15:11 |
|
#2 | |
New Member
ousegui
Join Date: Oct 2010
Posts: 19
Rep Power: 16 |
See Added part to your code (in red)
Quote:
|
||
June 10, 2013, 16:10 |
|
#3 |
Senior Member
Moha
Join Date: Mar 2013
Location: EU
Posts: 103
Rep Power: 0 |
thank you very much
|
|
June 17, 2013, 20:07 |
|
#4 |
Senior Member
Moha
Join Date: Mar 2013
Location: EU
Posts: 103
Rep Power: 0 |
I tried to change the domain of my temperature profile by defining time limits:
but the results are very strange. is the code written properly ? Code:
/*********************************************************************** udfexample.c UDF for specifying transient temperature profile boundary condition ************************************************************************/ #include "udf.h" #include "mem.h" DEFINE_PROFILE(Temp_Profile, thread, position) { real x[ND_ND]; real y; real t1=32399; real t2=89999; real t3=118799; real theProfile; face_t f; begin_f_loop(f, thread); { F_CENTROID(x,f,thread); y = CURRENT_TIME; if(y<=t1) theProfile=(-3e-12*pow(y,3.))+(1e-7*pow(y,2.))-(-0.0004*pow(y,1.))+(282.08); F_PROFILE(f, thread, position) =theProfile; { if(t1<y<=t2) theProfile=(-3e-13*pow(y,3.))+(7e-8*pow(y,2.))-(0.0055*pow(y,1.))+426.51; F_PROFILE(f, thread, position) =theProfile; } { if(t2<y<=t3) theProfile=(-2e-12*pow(y,3.))+(6e-7*pow(y,2.))-(0.0587*pow(y,1.))+2143.9; F_PROFILE(f, thread, position) =theProfile; } { if(y>t3) theProfile=(-4e-13*pow(y,3.))-(2e-7*pow(y,2.))-(0.0301*pow(y,1.))+1881.6; F_PROFILE(f, thread, position) =theProfile; } } end_f_loop(f,thread) } regards, |
|
July 23, 2013, 08:55 |
|
#5 |
Member
sooraj
Join Date: Dec 2012
Posts: 38
Rep Power: 14 |
hi
I need a udf for a work.I'm quite new in this area, so i really need your help. i need a linear varying temperature profile boundary condition to be applied on a circular face of a cylinder. temperature varies from 25 to 50 degrees from bottom to top of circle. diameter of circle is 470 mm . can you please help??? |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF error - parabolic velocity profile - 3D turbine | Zaqie | Fluent UDF and Scheme Programming | 9 | June 25, 2016 20:08 |
Define profile inlet_temperature in UDF | mohammadkm | Fluent UDF and Scheme Programming | 19 | December 24, 2013 23:42 |
is internalField(U) equivalent to zeroGradient? | immortality | OpenFOAM Running, Solving & CFD | 7 | March 29, 2013 02:27 |
UDF temp. profile BC | Shashikant | FLUENT | 0 | June 24, 2006 04:16 |
temperature profile on boundary | sivakumar | FLUENT | 5 | November 24, 2002 01:58 |