CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

UDF - Parallel

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 17, 2017, 11:28
Default UDF - Parallel
  #1
New Member
 
Join Date: Jan 2014
Posts: 10
Rep Power: 12
FRibeiro is on a distinguished road
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
FRibeiro is offline   Reply With Quote

Old   May 17, 2017, 12:38
Default
  #2
New Member
 
Swapnil Chavanda
Join Date: Jan 2017
Location: Pune
Posts: 19
Rep Power: 9
swpnl9282@gmail.com is on a distinguished road
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
swpnl9282@gmail.com is offline   Reply With Quote

Reply

Tags
prallelize, udf


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 20:26.