CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Compiled UDF on BATCH file (https://www.cfd-online.com/Forums/fluent-udf/98420-compiled-udf-batch-file.html)

Bionico March 10, 2012 09:44

Compiled UDF on BATCH file
 
Hi everybody,
I have a problem running a BATCH file: it should open a certain number of simulations (case and data saved with UDF already compiled) and run them.
Nevertheless when it load the first simulation an error appears: it seems that it can't find the library (it tries to find it in the root?!!) !!
But if I load my simulation without BATCH file it finds the library in the same folder of the simulation, obviously...
Can anybody tell me how to solve my problem?
I think that maybe I have to add some commands to my BATCH file (for example a command that re-compile my UDF...)

Please help me! :(

PS: my batch file is quite simple, only rcd (read case and data), it # (execute a certain number of iteration) and wcd (write case and data)

fevi84 June 1, 2012 14:57

This is a journal file (unsteady problem) that I'm ussing:

file/read-cas-data VOFaxiNf1000-12
define/user-defined/compiled-functions load "libudf/lnamd64/2d/libudf.so"
define/user-defined/function-hooks/initialization "gas_fraction_axis::libudf.so" ""
solve/initialize/initialize-flow
file/auto-save/case-frequency if-case-is-modified
file/auto-save/data-frequency 100 (save numbered dat file every 100 time steps)
file/auto-save/root-name VOFaxiNf1000 (file format will be VOFaxiNf1000-####.dat)
file/confirm-overwrite y
solve/set/time-step 0.0001
solve/dual-time-iterate 1000 20
file/wd finVOFaxiNf1000
exit
yes

1000 = number phisical time step specified
20 = maximum number of iterations per time step



In this journal file the initialization (line red) don't work

This journal file open the library, but not initialized the UDF (my UDF is for a initial condition), the message is the follow:


>
Opening library "/home/####/Documents/VOFaxiNf1000/libudf/lnamd64/2d/libudf.so"...
Library "/home/#####/Documents/VOFaxiNf1000/libudf/lnamd64/2d/libudf.so" opened
gas_fraction_axis
Done.

Opening library "/home/#####/Documents/VOFaxiNf1000/libudf/lnamd64/2d/libudf.so"...
Library "/home/#####/Documents/VOFaxiNf1000/libudf/lnamd64/2d/libudf.so" opened
Opening library "/home/#####/Documents/VOFaxiNf1000/libudf/lnamd64/2d/libudf.so"...
Library "/home/#####/Documents/VOFaxiNf1000/libudf/lnamd64/2d/libudf.so" opened
Opening library "/home/######/Documents/VOFaxiNf1000/libudf/lnamd64/2d/libudf.so"...
Library "/home/######/Documents/VOFaxiNf1000/libudf/lnamd64/2d/libudf.so" opened
Opening library "/home/######/Documents/VOFaxiNf1000/libudf/lnamd64/2d/libudf.so"...
Library "/home/######/Documents/VOFaxiNf1000/libudf/lnamd64/2d/libudf.so" opened
> Enter Initialization function 1 from list: ("gas_fraction_axis::libudf.so" "")
Enter Initialization function 2 from list: ("gas_fraction_axis::libudf.so" "")


>
>
>
>
>
>
>
Updating solution at time level N...
Global Courant Number : 0.00
done.
iter continuity x-velocity y-velocity time/iter
1 1.0000e+00 1.0478e+00 0.0000e+00 0:00:00 1
1 0.0000e+00 6.5424e-02 1.2007e-05

...continue iteration


If you know why the initialization don't work, PLEASE HELP ME

fevi84 June 1, 2012 16:14

Hi, again

I found the erro. The erro is not in the initialization, the erro is in the compilation due to the file ".c" was created in Windows. The file ".c" has be to created in Linux. This manner, you can interpreted or compiled the file ".c" through a journal file for running your case on Cluster.

yomnag June 4, 2018 16:44

Quote:

Originally Posted by fevi84 (Post 364360)
Hi, again

I found the erro. The erro is not in the initialization, the erro is in the compilation due to the file ".c" was created in Windows. The file ".c" has be to created in Linux. This manner, you can interpreted or compiled the file ".c" through a journal file for running your case on Cluster.

do you mean that i should create .jou file and add the udf.c commands in it


All times are GMT -4. The time now is 22:01.