|
[Sponsors] |
March 10, 2014, 15:59 |
parallel fluent on pc with udf
|
#1 |
New Member
Mike
Join Date: Dec 2013
Posts: 7
Rep Power: 13 |
Hello all,
I have a simulation that requires a sin wave pressure pulse at the inlet. In order to do this I have written the udf shown below and added the two extra lines for parallel operation. Even with these I am still getting errors when trying to load all the nodes for parallel implementation. I have found bits and pieces about running this through visual studio but the implementation there is beyond me provided the lack of structure to the instructions and my personal ignorance. I am sure there is something simple or obvious I am missing but sadly I am an undergraduate mechanical student and my adviser is of little help. If anyone can assist me here it would be greatly appreciated. I am working and limited to working on a pc running windows 7 with 4 cores. I understand this is a much simpler job on linux but, as is life I must work with what I am given (and please avoid responses about running dual boot. this is an academic machine and they will not let me load such things onto the computer). Thanks all in advance for any help provided. //************************************************** ********************* //stepfunction.c //UDF for specifying step pressure rise boundary condition //************************************************** **********************// #include "udf.h" DEFINE_PROFILE(unsteady_pressure, thread, position) { #if !RP_HOST face_t f; real g; real x1 = CURRENT_TIME*12.566; g = sin(x1); begin_f_loop(f,thread); { F_PROFILE(f, thread, position) = (55+10*g)*6894.757; } end_f_loop(f, thread) #endif } |
|
March 13, 2014, 09:36 |
|
#2 |
Senior Member
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 732
Rep Power: 23 |
What is the error message?
|
|
March 13, 2014, 12:57 |
Error Message
|
#3 |
New Member
Mike
Join Date: Dec 2013
Posts: 7
Rep Power: 13 |
So I went through all the other stuff with adding system variables and finally got it to compile a non-parallel code.
Copied C:\Users\Michael\Desktop\APU ew 3.c to libudf\src Copied C:\Users\Michael\Desktop\APU\udf.h to libudf\src user_nt.udf file is outdated. So, recreating the file for 3ddp_host ... udf_names.c file is outdated. So, recreating the file for 3ddp_host ... (system "copy "C:\PROGRA~1\ANSYSI~1\v150\fluent"\fluent15.0.0\sr c\makefile_nt.udf "libudf\win64\3ddp_host\makefile" ") 1 file(s) copied. (chdir "libudf")(chdir "win64\3ddp_host")user_nt.udf file is outdated. So, recreating the file for 3ddp_node ... udf_names.c file is outdated. So, recreating the file for 3ddp_node ... (system "copy "C:\PROGRA~1\ANSYSI~1\v150\fluent"\fluent15.0.0\sr c\makefile_nt.udf "libudf\win64\3ddp_node\makefile" ") 1 file(s) copied. (chdir "libudf")(chdir "win64\3ddp_node") Done. However, when I attempted the parallel code i got this: opied C:\Users\Michael\Desktop\APU/C:\Users\Michael\Desktop\APU\SIN_Par.c to libudf\src Copied C:\Users\Michael\Desktop\APU/C:\Users\Michael\Desktop\APU\udf.h to libudf\src udf_names.c and user_nt.udf files in 3ddp_host are upto date. (system "copy "C:\PROGRA~1\ANSYSI~1\v150\fluent"\fluent15.0.0\sr c\makefile_nt.udf "libudf\win64\3ddp_host\makefile" ") 1 file(s) copied. (chdir "libudf")(chdir "win64\3ddp_host")user_nt.udf file is outdated. So, recreating the file for 3ddp_node ... udf_names.c file is outdated. So, recreating the file for 3ddp_node ... (system "copy "C:\PROGRA~1\ANSYSI~1\v150\fluent"\fluent15.0.0\sr c\makefile_nt.udf "libudf\win64\3ddp_node\makefile" ") 1 file(s) copied. (chdir "libudf")(chdir "win64\3ddp_node")# Generating udf_names.c because of makefile SIN_Par.obj udf_names.c udf_names.c(9) : warning C4113: 'void (*)()' differs in parameter lists from 'void (*)(void)' # Linking libudf.dll because of makefile user_nt.udf udf_names.obj SIN_Par.obj Microsoft (R) Incremental Linker Version 12.00.21005.1 Copyright (C) Microsoft Corporation. All rights reserved. Creating library libudf.lib and object libudf.exp SIN_Par.obj : error LNK2019: unresolved external symbol __imp__RP_Get_Float referenced in function _unsteady_pressure libudf.dll : fatal error LNK1120: 1 unresolved externals Done. |
|
March 17, 2014, 03:39 |
|
#4 |
Senior Member
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 732
Rep Power: 23 |
Have you installed visual studio and SDK properly? If not then you must do it first.
|
|
March 17, 2014, 09:13 |
|
#5 |
New Member
Mike
Join Date: Dec 2013
Posts: 7
Rep Power: 13 |
If it was not installed correctly, would it have compiled the non parallel udf?
|
|
March 17, 2014, 17:57 |
|
#6 |
Senior Member
Andrew Kokemoor
Join Date: Aug 2013
Posts: 122
Rep Power: 14 |
If it successfully compiled your serial code, the compiler is probably fine. Could you post your new code that works in serial?
|
|
March 17, 2014, 17:59 |
|
#7 |
New Member
Mike
Join Date: Dec 2013
Posts: 7
Rep Power: 13 |
same code, it just gets rid of the parallel stuff.
//************************************************** ********************* //stepfunction.c //UDF for specifying step pressure rise boundary condition //************************************************** **********************// include "udf.h" DEFINE_PROFILE(unsteady_pressure, thread, position) { face_t f; real g; real x1 = CURRENT_TIME*12.566; g = sin(x1); begin_f_loop(f,thread); { F_PROFILE(f, thread, position) = (55+10*g)*6894.757; } end_f_loop(f, thread) } |
|
March 17, 2014, 18:04 |
|
#8 |
Senior Member
Andrew Kokemoor
Join Date: Aug 2013
Posts: 122
Rep Power: 14 |
Ah, I misunderstood; thought you had made some changes. Looking more closely, it looks like it might be related to your sin(x1) call. Try replacing that with 'g=2*x1' or something similarly basic, and see if it will compile.
|
|
March 18, 2014, 09:01 |
|
#9 |
Senior Member
François Grégoire
Join Date: Jan 2010
Location: Canada
Posts: 392
Rep Power: 17 |
Hi Mike,
May I ask why you absolutely want to compile the udf? It can be interpreted. Just curious. As Andrew pointed out, the sin call is inside the f_loop in the example of section 8.2.1.2 of the UDF Manual 15.0, maybe it's for a reason? |
|
March 18, 2014, 10:05 |
|
#10 |
Senior Member
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 732
Rep Power: 23 |
Your UDF may not not need #if !RP_HOST if you ensure that the face to which you are applying the condition is intact (not shared by multiple parts) after dividing your mesh in to multiple parts for parallel processing.
I have used a UDF with DEFINE_PROFILE macro on a cluster with 4-8 processors without changing the UDF and it worked fine. I can say this ONLY for UDF with DEFINE_PROFILE and DEFINE_PROPERTY macros. |
|
March 18, 2014, 10:51 |
|
#11 |
Senior Member
Alex
Join Date: Jan 2014
Posts: 126
Rep Power: 12 |
Well, if you just need it once, you can open fluent serial, import udf, close fluent, save, open fluent in parallel. Or doesn't that work for you?
|
|
April 14, 2014, 14:35 |
Sorry for the delay in response
|
#12 |
New Member
Mike
Join Date: Dec 2013
Posts: 7
Rep Power: 13 |
Its the end of the semester and im getting hammered. So in response to your comments and suggestions:
So I tried replacing the sin call and it gave me the same error. When I attempt to interpret I get an error for each core I had requested to run on. And when I attempt to interpret or compile without the RP_HOST I get errors about the .c not being parallel Further, I have attempted to run this on a unix cluster and am getting the same errors. What am I missing? (sorry I am not providing you with these errors...the licenses are being used and I cannot get into the system to run and screen shot the output) |
|
April 25, 2014, 06:30 |
|
#13 |
Member
Join Date: Jul 2013
Posts: 80
Rep Power: 13 |
#include "udf.h"
DEFINE_PROFILE(unsteady_pressure, thread, position) { #if !RP_HOST face_t f; real g; real x1 = CURRENT_TIME*12.566; g = sin(x1); begin_f_loop(f,thread); { F_PROFILE(f, thread, position) = (55+10*g)*6894.757; } end_f_loop(f, thread) #endif } You must delete the semi colon after begin_f_loop. If I were you, I would include "math.h" since you are using a "sin" function. Cheers |
|
April 28, 2015, 04:14 |
Clarification
|
#14 | |
Member
Baradwaj B S
Join Date: Jan 2015
Posts: 75
Rep Power: 11 |
Quote:
I just wanted to ask you if there were any changes to the results by using same serial code in parallel? And is this applicable to only DEFINE_PROFILE and DEFINE_PROPERTY or any other macros also? Thanks in advance, Bharadwaj B S |
||
April 29, 2015, 04:05 |
|
#15 | |
Senior Member
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 732
Rep Power: 23 |
Quote:
My claim is limited to the two macros that I mentions. I can not comment on the other macros. |
||
April 29, 2015, 05:47 |
Working
|
#16 |
Member
Baradwaj B S
Join Date: Jan 2015
Posts: 75
Rep Power: 11 |
Dear Paritosh,
Thanks for your reply. It is working fine in parallel. Thanks again, Bharadwaj B S |
|
Tags |
fluent, parallel, udf, windows 7 |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Fluent UDF on parallel computing | Andrea | Fluent UDF and Scheme Programming | 22 | August 12, 2015 08:44 |
Differences of parallel UDF for Fluent 6.3 and 13 | didiean | Fluent UDF and Scheme Programming | 9 | March 25, 2013 22:37 |
Problem with Parallel Fluent | mohamed_ | FLUENT | 1 | December 28, 2012 12:23 |
PROBLEM in UDF on parallel fluent mode | rakadit | Fluent UDF and Scheme Programming | 0 | July 13, 2012 07:51 |
UDF in parallel version. | yobee | FLUENT | 0 | August 17, 2004 05:12 |