|
[Sponsors] |
May 17, 2017, 11:28 |
UDF - Parallel
|
#1 |
New Member
Join Date: Jan 2014
Posts: 10
Rep Power: 12 |
Hello,
Does anybody knows how can I parallelize my code? For exemple, I have a code to calculate the average temperature in a rod after downloading a .dat /* --------------------------------------------------------------- */ #include "udf.h" double temp_comb; DEFINE_ON_DEMAND(on_demand_Tcomb) { Domain *domain=Get_Domain(1); cell_t c; Thread *tc; int id_zone; double volume_comb; double temper_comb; id_zone=28; tc=Lookup_Thread(domain,id_zone); volume_comb = 0; temper_comb = 0; begin_c_loop(c,tc) { volume_comb += C_VOLUME(c,tc); temper_comb += C_T(c,tc)*C_VOLUME(c,tc); } end_c_loop(c,tc) temp_comb=temper_comb/volume_comb; Message("Fuel temp : %e \n", temp_comb); } /* --------------------------------------------------------------- */ Thank you very much. Regards, Felipe |
|
May 17, 2017, 12:38 |
|
#2 |
New Member
Swapnil Chavanda
Join Date: Jan 2017
Location: Pune
Posts: 19
Rep Power: 9 |
Insert
1. #if PARALLEL (After Curly brace of define on demand) 2. #endif (before last curly brace) Sent from my Moto G (4) using CFD Online Forum mobile app |
|
Tags |
prallelize, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
"Define_Profile" UDF for parallel solver | Antoine | Fluent UDF and Scheme Programming | 9 | February 29, 2016 07:09 |
Having trouble adapting serial UDF to work in parallel | muyuntao | Fluent UDF and Scheme Programming | 1 | November 10, 2015 14:42 |
UDF Error with Parallel affter several step | trantoan2008 | Fluent UDF and Scheme Programming | 0 | January 7, 2013 08:33 |
Parallel UDF Error | Andrew | FLUENT | 2 | March 30, 2007 12:11 |
UDF in parallel version. | yobee | FLUENT | 0 | August 17, 2004 05:12 |