|
[Sponsors] |
October 23, 2018, 07:56 |
Paralellizing UDF DEFINE_PROFILE
|
#1 |
New Member
Burak
Join Date: Apr 2013
Posts: 6
Rep Power: 12 |
Hi,
I would like to give heat flux from a surface depending on timestep. So I wrote an UDF for serial (haven't tried yet if it is working btw), but I am not sure if I need to paralellize it when I use parallel solver. I would like to use DEFINE_PROFILE as follows: --------------------------------------------------------- #include "udf.h" DEFINE_PROFILE(hf_profile,t,i) { real x[ND_ND]; real y; face_t f; if (CURRENT_TIME > 5 && CURRENT_TIME < 8) { F_PROFILE(f,t,i) = 100; } else if (CURRENT_TIME >= 8 && CURRENT_TIME < 15) { F_PROFILE(f,t,i) = 150; } } How should I need to add #if !RP_HOST or !RP_NODE ? I did not quite understand from the manual if I need to use these parallel functions because I think I am not using global functions. Thank you in advance, |
|
October 25, 2018, 00:50 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 33 |
Code:
#include "udf.h" DEFINE_PROFILE(hf_profile,t,i) { face_t f; begin_f_loop(f,t) { if (CURRENT_TIME > 5 && CURRENT_TIME < 8) {F_PROFILE(f,t,i) = 100;} else if (CURRENT_TIME >= 8 && CURRENT_TIME < 15) {F_PROFILE(f,t,i) = 150;} } end_f_loop(f,t) } you don't need to modify your code to use it in parallel best regards |
|
October 31, 2018, 11:42 |
|
#3 | |
New Member
Burak
Join Date: Apr 2013
Posts: 6
Rep Power: 12 |
Quote:
But Do I need to write a loop? I would like to give heatflux from one surface only. |
||
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
udf for one dimensional linear motion based on force | maccheese | Fluent UDF and Scheme Programming | 2 | September 1, 2019 03:18 |
Save output of udf in another udf! | JuanJoMex | FLUENT | 0 | February 8, 2018 13:43 |
UDF Compilation Error - Loading Library - COMMON Problem! Help! | robtheslob | Fluent UDF and Scheme Programming | 8 | July 24, 2015 01:53 |
UDF parallel error: chip-exec: function not found????? | shankara.2 | Fluent UDF and Scheme Programming | 1 | January 16, 2012 23:14 |
UDF, UDF, UDF, UDF | Luc SEMINEL | Main CFD Forum | 0 | November 25, 2002 05:01 |