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

Unsteady Inlet Velocity UDF in Parallel Batch Mode

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By vtyler

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 31, 2017, 13:10
Question Unsteady Inlet Velocity UDF in Parallel Batch Mode
  #1
New Member
 
Tyler V.
Join Date: May 2017
Posts: 2
Rep Power: 0
vtyler is on a distinguished road
I am attempting to run an unsteady computation using interpreted UDF in parallel batch mode. I have the following simple UDF, which works fine when interpreted in the ansys GUI:

#include "udf.h"
DEFINE_PROFILE(unsteady_velocity, thread, position)
{
face_t f;
real t = CURRENT_TIME;
begin_f_loop(f, thread)
{
F_PROFILE(f, thread, position) = (0.33-0.033) + 0.033*cos(3.14159265359*2.*10.*t);
}
end_f_loop(f, thread)
}


It is a 2D computation so I use the following to call my journal file:

fluent 2ddp -t$nprocs -pinfiniband -cnf=$PBS_NODEFILE -g -i < ../run.input.transient.txt


And my journal file is:

define/user-defined/interpreted-functions "udf_unsteadyXinlet.c" "gcc" 10000 no
file/read-case ../Input/transientInlet_0001dt_033mps.cas
file/read-data ../Input/transientInlet_0001dt_033mps.dat

solve/dual-time-iterate 1000
exit yes


I receive the following error output:

Cleanup script file is /home/vtyler/Output/cleanup-fluent-nr107-2344.sh
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
/scratch-local/210074.master.cluster/ccKrifUu.o: In function `unsteady_velocity':
udf_unsteadyXinlet.c.text+0x16): undefined reference to `RP_Get_Float'
udf_unsteadyXinlet.c.text+0x7d): undefined reference to `cos'
collect2: error: ld returned 1 exit status
Error: "udf_unsteadyXinlet.c": line 1: syntax error.
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
/scratch-local/210074.master.cluster/ccH6qbKK.o: In function `unsteady_velocity':
udf_unsteadyXinlet.c.text+0x16): undefined reference to `RP_Get_Float'
udf_unsteadyXinlet.c.text+0x7d): undefined reference to `cos'



Also in my console output, I get the following:

Reading "../Input/transientInlet_0001dt_033mps.dat"...

Parallel variables...
Error: chip-exec: function "unsteady_velocity" not found.


Despite the errors, the code runs and outputs the solution, but it is clear the velocity boundary condition is not correct.

Any ideas would be appreciated!
Svetlana likes this.
vtyler is offline   Reply With Quote

Old   May 31, 2017, 21:30
Default Put the UDF into wd
  #2
Senior Member
 
Svetlana Tkachenko
Join Date: Oct 2013
Location: Australia, Sydney
Posts: 415
Rep Power: 14
Svetlana is on a distinguished road
Put the UDF in the FLUENT working directory («.», not «../Input/»)?
Svetlana is offline   Reply With Quote

Old   June 1, 2017, 10:27
Default
  #3
New Member
 
Tyler V.
Join Date: May 2017
Posts: 2
Rep Power: 0
vtyler is on a distinguished road
Thanks for the reply.

What is meant by the "Working Directory"?

Here is my full script setting up the parallel processing:

#!/bin/bash

#PBS -l nodes=1pn=24
#PBS -l walltime=80:00:00
#PBS -q normal_q
#PBS -A TtProbes
#PBS -W group_list=newriver
#PBS -N transient_CFD
#PBS -m bea
#PBS -M anonymous@vt.edu

cd \Output

module load ansys

nprocs=`wc -l $PBS_NODEFILE | awk '{ print $1 }'`
fluent 2ddp -t$nprocs -pinfiniband -cnf=$PBS_NODEFILE -g -i < ../run.input.transient.txt

exit
yes


I am assuming here my working directory is \Output and this is where my UDF is located. Also, I have reason to suspect its finding the UDF where its located since it will give me an error message if I intentionally put a bad line in the udf script.

Thanks again
vtyler is offline   Reply With Quote

Old   April 1, 2020, 05:24
Default
  #4
New Member
 
sajjan
Join Date: Jan 2016
Location: Nepal
Posts: 13
Rep Power: 10
sajjan is on a distinguished road
Quote:
Originally Posted by vtyler View Post
I am attempting to run an unsteady computation using interpreted UDF in parallel batch mode. I have the following simple UDF, which works fine when interpreted in the ansys GUI:

#include "udf.h"
DEFINE_PROFILE(unsteady_velocity, thread, position)
{
face_t f;
real t = CURRENT_TIME;
begin_f_loop(f, thread)
{
F_PROFILE(f, thread, position) = (0.33-0.033) + 0.033*cos(3.14159265359*2.*10.*t);
}
end_f_loop(f, thread)
}


It is a 2D computation so I use the following to call my journal file:

fluent 2ddp -t$nprocs -pinfiniband -cnf=$PBS_NODEFILE -g -i < ../run.input.transient.txt


And my journal file is:

define/user-defined/interpreted-functions "udf_unsteadyXinlet.c" "gcc" 10000 no
file/read-case ../Input/transientInlet_0001dt_033mps.cas
file/read-data ../Input/transientInlet_0001dt_033mps.dat

solve/dual-time-iterate 1000
exit yes


I receive the following error output:

Cleanup script file is /home/vtyler/Output/cleanup-fluent-nr107-2344.sh
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
/scratch-local/210074.master.cluster/ccKrifUu.o: In function `unsteady_velocity':
udf_unsteadyXinlet.c.text+0x16): undefined reference to `RP_Get_Float'
udf_unsteadyXinlet.c.text+0x7d): undefined reference to `cos'
collect2: error: ld returned 1 exit status
Error: "udf_unsteadyXinlet.c": line 1: syntax error.
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
/scratch-local/210074.master.cluster/ccH6qbKK.o: In function `unsteady_velocity':
udf_unsteadyXinlet.c.text+0x16): undefined reference to `RP_Get_Float'
udf_unsteadyXinlet.c.text+0x7d): undefined reference to `cos'



Also in my console output, I get the following:

Reading "../Input/transientInlet_0001dt_033mps.dat"...

Parallel variables...
Error: chip-exec: function "unsteady_velocity" not found.


Despite the errors, the code runs and outputs the solution, but it is clear the velocity boundary condition is not correct.

Any ideas would be appreciated!


Hello,
I am facing the exact issue? Do you remember how did you solve the problem?
Thank you
sajjan is offline   Reply With Quote

Old   April 1, 2020, 05:44
Default Interpreter
  #5
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
Prefer compilation. Since this is a Linux system, gcc is available. Just compile it. It will work.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Reply

Tags
batch, cluster, parallel, udf, unsteady


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
Having trouble adapting serial UDF to work in parallel muyuntao Fluent UDF and Scheme Programming 1 November 10, 2015 13:42
Pressure boundary condition for unsteady velocity inlet DanM OpenFOAM Running, Solving & CFD 6 July 5, 2015 09:21
Velocity inlet boundary condition for porous medium Chander CFX 3 March 11, 2012 21:18
UDF parallel velocity inlet profile Armengol FLUENT 3 September 30, 2009 15:08
Terrible Mistake In Fluid Dynamics History Abhi Main CFD Forum 12 July 8, 2002 09:11


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