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

Linux commands to write udf for remote Linux nodes

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By blackmask
  • 1 Post By AvaShahrokhi

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 5, 2013, 10:18
Default Linux commands to write udf for remote Linux nodes
  #1
New Member
 
Samuel
Join Date: Nov 2012
Location: Malaysia
Posts: 4
Rep Power: 14
saayo3 is on a distinguished road
Good day, everyone!

(A)

* I am using ANSYS Fluent 14.0 to solve an incompressible steady-state turbulent wind flow problem around a group of buildings.

* I desire to configure the model in my PC operating on Windows OS & send to a remote Linux High Performance Computer (HPC) for faster processing.

* I have used udf (Interpreted) to define the inflow velocity, turb. kinetic energy & dissipation rate profiles.

* I have also been able to set up the fluent.cas & .dat files in the Journal file, and configured the pbs-script.

* But the job would not execute when I sent it to the remote system for processing (I keep getting error message).

* However, when I specified fixed values for the inlet parameters, the program ran.

* I guess the problem is with the udf. I could not write the necessary Fluent text commands for the udf in the Journal file.

* I tried to compile the udf but this also failed.

* I read from ANSYS Fluent udf manual that automatically compiling udfs is not supported on mixed Windows/Linux systems.

* Could someone. pls help me out with the necessary commands.

(B).

* In the present Journal file I intend to modify , the solution is terminated by the use of no of iterations using 'solve/iterate n'.

* I desire to use Residuals to terminate the solution.

* Pls what are the commands for effecting this in the Journal file?

Thanking you, in advance.

Samuel
saayo3 is offline   Reply With Quote

Old   June 5, 2013, 22:33
Default
  #2
Senior Member
 
Join Date: Aug 2011
Posts: 421
Blog Entries: 1
Rep Power: 22
blackmask will become famous soon enough
It should be ok to use the compiled udf as long as you keep the source file in the same directory as your case and data file. When you use the GUI setting interpreted UDF the path for the source files would be expanded to absolute path which would result in error for cases used in different OS. You can use TUI to do the compiling, e.g.
Code:
/define/user-defined/compiled-functions compile "libudf" yes "xxx.c" "" "" 
/define/user-defined/compiled-functions load "libudf"
If you have not modified the default settings for residual, then it will stop as soon as residual criterion met. You can choose a sufficient large 'n' if you would like your criterion met no matter whatever it takes. But you should be aware convergence criterion is problem specific and an estimated criteria is not guaranteed to be met. Sometimes we want to iterate a certain steps to study the residuals change and we can use
Code:
/solve/monitors/residual/check-convergence no no no no no no no no
to disable the convergence criterion. How many 'no' depends on how many equations you have.
gaza likes this.
blackmask is offline   Reply With Quote

Old   June 7, 2013, 04:34
Default Re: Linux commands to write udf for remote Linux nodes
  #3
New Member
 
Samuel
Join Date: Nov 2012
Location: Malaysia
Posts: 4
Rep Power: 14
saayo3 is on a distinguished road
Blackmask,

Thanks so much for your wonderful contributions/comments to the questions I posted.

I now understand that the remote system uses the same order as our local system to monitor convergence.

However, I still attempted compiling the udf but failed.

By the procedure stipulated, the source file is to be kept in the same directory as the case and data files.

But the case and data files are not available or active in Fluent until Fluent is executed with all the b.cs which include the compiled udf. This is not really clear to me.

Pls., kindly shed light on this.

I another case, the domain I am modeling has a surrounding area with non-uniform surface roughness, in which case the surface Roughness Constant, Cs, is outside the upper limit of the range (0.5 - 1.0) that can be specified in Fluent.

I desire to specify a value of Cs greater than 1.0 as has been done in previous researches, and this requires udf.

Pls., what are the udf codes for writing constant value Roughness Constant, Cs.

Thanks again. And hoping to hear from you.

Samuel.
saayo3 is offline   Reply With Quote

Old   March 6, 2014, 11:35
Default
  #4
New Member
 
Ava
Join Date: Nov 2013
Location: UK
Posts: 17
Rep Power: 13
AvaShahrokhi is on a distinguished road
Hi friends

I could sort out the problem. Here is the Script file format:

file/read-case *.cas
/define/user-defined/compiled-functions compile "libudf" yes "/address/…/…/…/xxx.c" "" ""
/define/user-defined/compiled-functions load "libudf"
file/read-data *.dat


the important thing is that
1- You should not whatsoever define the udf in the serial case that you make because in this case it will look for the address of the file on your computer. I even try text command and it did not work. You need to leave it for the journal file to define the udf file and call the related libraries.
2- I guess reading the data files comes afterwards.
3- I am not sure but I guess that the address of the *.c file should be added when udf is defined ( I have not tried not using the address! )

Hope you find these useful

Ava.
gaza likes this.
AvaShahrokhi is offline   Reply With Quote

Old   November 1, 2017, 07:14
Default ansys fluent 18 on linux
  #5
New Member
 
Join Date: Jan 2017
Posts: 25
Rep Power: 9
sewgolam is on a distinguished road
Dear friend reasonly i instal ansys fluent 18 on linux.

ansys run oke on the system but when i compile a UDF it give a error. hoe can help me.

p, li { white-space: pre-wrap; }

Working...
for d in lnamd64/[23]*; do \
( \
cd $d; \
rm -rf *.{c,h,cpp,hpp}; \
for f in ../../src/*.{c,h,cpp,hpp} ../../src/makefile ../../src/user.udf; do \
if [ -f $f -a ! -f `basename $f` ]; then \
echo "# linking to" $f "in" $d; \
ln -s $f .; \
fi; \
done; \
echo ""; \
echo "# building library in" $d; \
if [ "" = "1" ]; then \
echo "# using gcc64"; \
make ARCHC=gcc64 -k>makelog 2>&1; \
else \
if [ "" = "1" ]; then \
echo "# using gcc"; \
make ARCHC=gcc -k>makelog 2>&1; \
else \
make -k>makelog 2>&1; \
fi; \
fi;\
cat makelog; \
) \
done


# building library in lnamd64/2ddp
make[1]: Entering directory '/home/ronnie/Desktop/10-17-2017_lagrainge_solution/w/lnamd64/2ddp'
make[1]: *** No rule to make target 'Particle_law.c', needed by 'udf_names.c'.
make[1]: *** No rule to make target 'Q.c', needed by 'udf_names.c'.
make[1]: *** No rule to make target 'absorption_coeff_mixture.c', needed by 'udf_names.c'.
make[1]: *** No rule to make target 'reaction_rate2.c', needed by 'udf_names.c'.
make[1]: Target 'default' not remade because of errors.
make[1]: Leaving directory '/home/ronnie/Desktop/10-17-2017_lagrainge_solution/w/lnamd64/2ddp'


You can also see the 'log'-file in
the working directory for this compilation history


Done.


i donot understand why this happen and i found the following that explain why but i still donot understand what to do.



2017-07-05
How to compile and load Fluent UDF on Linux

CFD linux programming troubleshooting
Corrections to the UDF manual (version 18.1)

Due to the following typographical errors, you cannot make the UDF. So you need to fix these:
  • Page 341-341: the path “path/ansys_inc/v181/fluent/fluent18.1.0/src/” is inccorect. In reality, it should be “path/ansys_inc/v181/fluent/fluent18.1.0/src/udf/
  • Page 342: In procedure 5, the file of interest is NOT the makefile.udf2 but makefile.udf . -
  • AND rename the copied makefile.udf to makefile . The manual says Makefile but this doesn’t work.
  • Most importantly, it appears you need to copy the makefile into the each of the subdirectory under the architecture directory, e.g., /libudf/lnamd64/3ddp_host/ and /libudf/lnamd64/3ddp_node/ . This information is absent in the manual at all, which is really annoying. Could be environment dependent? but still…
Then, you should finally be able to do the


please help
sewgolam is offline   Reply With Quote

Reply


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
[Helyx OS] Helyx-OS (GUI for SnappyHexMesh elvis OpenFOAM Community Contributions 210 January 30, 2017 19:57
how to write UDF to define 2 profiles at inlet? emma FLUENT 5 January 30, 2011 06:22
OpenFOAM14 for Mac OSX Darwin 104 gschaider OpenFOAM Installation 118 July 20, 2008 06:19
UDF TO WRITE OUT DATA!! Aishwarya FLUENT 0 August 12, 2004 11:11
UDF to write interp files Karl FLUENT 6 February 7, 2002 13:10


All times are GMT -4. The time now is 13:58.