|
[Sponsors] |
July 12, 2017, 13:50 |
Time variant temperature of wall
|
#1 |
New Member
Phanikumar
Join Date: Mar 2016
Posts: 5
Rep Power: 10 |
Hi,
Could anyone please tell me how to define the temperature of the wall in fluent which depends on time. I have approched in away but it shows an error such as "invalid lvalue in assignment.". Please resolve the error in the following program or please let me know how to program this particular scenario as I'm very bad at programming. Program: #include "udf.h" DEFINE_PROFILE(temperature, t, i) { real the_current_time; face_t f; the_current_time = CURRENT_TIME; if ((the_current_time>=0) && (the_current_time<=3600)) { temperature=20; } if ((the_current_time>3600) && (the_current_time<=7200)) { temperature=19; } if ((the_current_time>7200) && (the_current_time<=10800)) { temperature=18; } if ((the_current_time>10800) && (the_current_time<=14400)) { temperature=17; } if ((the_current_time>14400) && (the_current_time<=18000)) { temperature=16; } if ((the_current_time>18000) && (the_current_time<=21600)) { temperature=21; } if ((the_current_time>21600) && (the_current_time<=25200)) { temperature=31; } if ((the_current_time>25200) && (the_current_time<=28800)) { temperature=43; } if ((the_current_time>28800) && (the_current_time<=32400)) { temperature=56; } if ((the_current_time>32400) && (the_current_time<=36000)) { temperature=66; } if ((the_current_time>36000) && (the_current_time<=39600)) { temperature=70; } if ((the_current_time>39600) && (the_current_time<=43200)) { temperature=70; } if ((the_current_time>43200) && (the_current_time<=46800)) { temperature=75; } if ((the_current_time>46800) && (the_current_time<=50400)) { temperature=72; } if ((the_current_time>50400) && (the_current_time<=54000)) { temperature=72; } if ((the_current_time>54000) && (the_current_time<=57600)) { temperature=63; } if ((the_current_time>57600) && (the_current_time<=61200)) { temperature=55; } if ((the_current_time>61200) && (the_current_time<=64800)) { temperature=47; } if ((the_current_time>64800) && (the_current_time<=68400)) { temperature=39; } if ((the_current_time>68400) && (the_current_time<=72000)) { temperature=29; } if ((the_current_time>72000) && (the_current_time<=75600)) { temperature=24; } if ((the_current_time>75600) && (the_current_time<=79200)) { temperature=22; } if ((the_current_time>79200) && (the_current_time<=82800)) { temperature=21; } if ((the_current_time>82800) && (the_current_time<=86400)) { temperature=19; } begin_f_loop(f,t) { F_PROFILE(f,t,i) = temperature; } end_f_loop(f,t) } |
|
July 13, 2017, 07:00 |
|
#2 |
Senior Member
Kal-El
Join Date: Apr 2017
Location: Finland
Posts: 150
Rep Power: 9 |
You use "temperature" as both variable and UDF-name. (And you do not define the variable)
|
|
July 13, 2017, 07:02 |
|
#3 |
Senior Member
Kal-El
Join Date: Apr 2017
Location: Finland
Posts: 150
Rep Power: 9 |
I would make something like:
Code:
#include "udf.h" DEFINE_PROFILE(temperature, t, i) { real the_current_time, Temp; face_t f; the_current_time = CURRENT_TIME; if ((the_current_time>=0) && (the_current_time<=3600)) { Temp=20.0; } if ((the_current_time>3600) && (the_current_time<=7200)) { Temp=19.0; } ... } |
|
July 13, 2017, 07:54 |
|
#4 |
New Member
Phanikumar
Join Date: Mar 2016
Posts: 5
Rep Power: 10 |
Hi KaLium,
Thank you verymuch. It's working perfectly. |
|
Tags |
udf time temperature |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Multiphase flow - incorrect velocity on inlet | Mike_Tom | CFX | 6 | September 29, 2016 02:27 |
Extrusion with OpenFoam problem No. Iterations 0 | Lord Kelvin | OpenFOAM Running, Solving & CFD | 8 | March 28, 2016 12:08 |
Stuck in a Rut- interDyMFoam! | xoitx | OpenFOAM Running, Solving & CFD | 14 | March 25, 2016 08:09 |
Moving mesh | Niklas Wikstrom (Wikstrom) | OpenFOAM Running, Solving & CFD | 122 | June 15, 2014 07:20 |
Micro Scale Pore, icoFoam | gooya_kabir | OpenFOAM Running, Solving & CFD | 2 | November 2, 2013 14:58 |