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_Programming

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 25, 2021, 07:13
Default UDF_Parallel_Programming
  #1
New Member
 
Rahul
Join Date: Jun 2019
Location: Pune
Posts: 23
Rep Power: 6
rahulmule797@gmail.com is on a distinguished road
Hello everyone,
i did the udf programming before but that was for serial mode. and i'm new to this parallel programming and bit confused about what to solve on host and what on node.
i've written a program for unsteady temperature profile is it correct or what changes should i make further ?
please guide.

/************************************************** ************************************************** ************************************************** ***/

#include "udf.h"


DEFINE_PROFILE(unsteady_temp, thread, position)
{
#if !RP_HOST /* Compile this section for computing processes only (serial
and node) since these variables are not available
on the host */
real x[ND_ND];
face_t f;
real t = CURRENT_TIME;

begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);
F_PROFILE(f, thread, position) = 6.61e-21*t*t*t*t*t-8.33e-18*t*t*t*t+1.5e-14*t*t*t+3.071e-08*t*t-7.518e-04*t+307.05;
}
end_f_loop(f, thread)
#endif /* !RP_HOST */
}

if i use this same program as above will it work fine for parallel solver?
thanks in advance.
rahulmule797@gmail.com is offline   Reply With Quote

Old   August 25, 2021, 23:54
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
this code doesn't require additional directives like #if !RP_HOST to work in parallel,
you may remove it and run your UDF in serial/parallel
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   August 26, 2021, 00:03
Default
  #3
New Member
 
Rahul
Join Date: Jun 2019
Location: Pune
Posts: 23
Rep Power: 6
rahulmule797@gmail.com is on a distinguished road
Quote:
Originally Posted by AlexanderZ View Post
this code doesn't require additional directives like #if !RP_HOST to work in parallel,
you may remove it and run your UDF in serial/parallel

i tried to compile udf by removing directives but it is throwing this error.

# Generating udf_names.c because of makefile unsteady_temp.C
udf_names.c
# Linking libudf.dll because of makefile user_nt.udf udf_names.obj unsteady_temp.C
Microsoft (R) Incremental Linker Version 14.10.25019.0
Copyright (C) Microsoft Corporation. All rights reserved.

LINK : fatal error LNK1181: cannot open input file 'unsteady_temp.C'
Creating user_nt.udf file for 2ddp_node ...
(system "copy "C:\PROGRA~1\ANSYSI~1\v190\fluent"\fluent19.0.0\sr c\udf\makefile_nt.udf "libudf\win64\2ddp_node\makefile" ")
1 file(s) copied.
(chdir "libudf")(chdir "win64\2ddp_node")# Generating ud_io1.h
unsteady_temp.C
rahulmule797@gmail.com is offline   Reply With Quote

Old   August 26, 2021, 05:55
Default
  #4
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
And with serial you did not get this error?
__________________
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build".
pakk is offline   Reply With Quote

Old   August 26, 2021, 05:59
Default
  #5
New Member
 
Rahul
Join Date: Jun 2019
Location: Pune
Posts: 23
Rep Power: 6
rahulmule797@gmail.com is on a distinguished road
Quote:
Originally Posted by pakk View Post
And with serial you did not get this error?
due to the above mentioned error it was not building the udf library.
Actually previously i tried with interpreting the udf..
rahulmule797@gmail.com is offline   Reply With Quote

Old   August 26, 2021, 06:01
Default
  #6
New Member
 
Rahul
Join Date: Jun 2019
Location: Pune
Posts: 23
Rep Power: 6
rahulmule797@gmail.com is on a distinguished road
Quote:
Originally Posted by rahulmule797@gmail.com View Post
i tried to compile udf by removing directives but it is throwing this error.

# Generating udf_names.c because of makefile unsteady_temp.C
udf_names.c
# Linking libudf.dll because of makefile user_nt.udf udf_names.obj unsteady_temp.C
Microsoft (R) Incremental Linker Version 14.10.25019.0
Copyright (C) Microsoft Corporation. All rights reserved.

LINK : fatal error LNK1181: cannot open input file 'unsteady_temp.C'
Creating user_nt.udf file for 2ddp_node ...
(system "copy "C:\PROGRA~1\ANSYSI~1\v190\fluent"\fluent19.0.0\sr c\udf\makefile_nt.udf "libudf\win64\2ddp_node\makefile" ")
1 file(s) copied.
(chdir "libudf")(chdir "win64\2ddp_node")# Generating ud_io1.h
unsteady_temp.C

/************************************************** ************************************************** *********/
this error is resolved just by renaming UDF from "unsteady_temp.C" to "unsteady_temp.c".
rahulmule797@gmail.com is offline   Reply With Quote

Reply

Tags
parallel computing, parallelize udf, temperature profile, udf code


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



All times are GMT -4. The time now is 14:17.