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

Fluent UDF on Linux system.

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By pakk
  • 2 Post By AlexanderZ

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 20, 2018, 15:46
Post Fluent UDF on Linux system.
  #1
FSM
New Member
 
Felipe
Join Date: Nov 2017
Location: Brazil
Posts: 16
Rep Power: 9
FSM is on a distinguished road
Dears,

Please could someone help me with my UDF issue.
I build this code that reads velocity values and time from .txt files, storage the values in vectors and uses the values as input on time dependent boundary conditions (Coordinate U and Coordinate V).
The code works in a PC with Windows system with no problem, but I need it to run it in a cluster with Linux system.
I got the case, UDF, and the three files in a folder, and when I click on BUILD I got some warnings but, the libudf folder is created. However, when I click on LOAD, I get this error:
Code:
 Error:  received a fatal signal (Segmentation fault).
Error:  received a fatal signal (Segmentation fault).
 Error Object: #f
Follow below some details do the logs and the the UDF code.
please if anyone could help me solve this issue, I would appreciate.
Thanks.

Log details:
Quote:
for d in lnamd64/[23]*; do \
( \
cd $d; \
for f in ../../src/*.[ch] ../../src/makefile ../../src/user.udf; do \
if [ ! -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/3ddp
make[1]: Entering directory '/home/felipe-ubuntu/Desktop/casoudf/libudf/lnamd64/3ddp'
# Generating udf_names.c because of CFDvelocityudf.c
make[2]: Entering directory '/home/felipe-ubuntu/Desktop/casoudf/libudf/lnamd64/3ddp'
make libudf.so "CFLAGS=-D_lnamd64 -D_GNU_SOURCE -fpic -shared -ansi -Wall -O -DPTR_RESTRICT= " "LDFLAGS=-shared -lm"
make[3]: Entering directory '/home/felipe-ubuntu/Desktop/casoudf/libudf/lnamd64/3ddp'
# Compiling udf_names.o because of udf_names.c
cc -D_lnamd64 -D_GNU_SOURCE -fpic -shared -ansi -Wall -O -DPTR_RESTRICT= -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/`expr "\`pwd\`" : '.*/\(.*\)/[23].*'`/`basename "\`pwd\`"` -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/main -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/addon-wrapper -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/io -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/species -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/pbns -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/numerics -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/sphysics -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/storage -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/mphase -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/bc -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/models -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/material -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/amg -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/util -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/mesh -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/udf -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/ht -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/dx -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/turbulence -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/parallel -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/etc -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/ue -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/dpm -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/dbns -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/cortex/src -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/client/src -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/tgrid/src -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/multiport/src -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/multiport/mpi_wrapper/include -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/multiport/mpi_wrapper/src -I. -c udf_names.c
# Compiling CFDvelocityudf.o because of CFDvelocityudf.c
cc -D_lnamd64 -D_GNU_SOURCE -fpic -shared -ansi -Wall -O -DPTR_RESTRICT= -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/`expr "\`pwd\`" : '.*/\(.*\)/[23].*'`/`basename "\`pwd\`"` -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/main -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/addon-wrapper -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/io -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/species -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/pbns -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/numerics -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/sphysics -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/storage -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/mphase -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/bc -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/models -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/material -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/amg -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/util -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/mesh -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/udf -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/ht -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/dx -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/turbulence -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/parallel -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/etc -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/ue -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/dpm -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/dbns -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/cortex/src -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/client/src -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/tgrid/src -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/multiport/src -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/multiport/mpi_wrapper/include -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/multiport/mpi_wrapper/src -I. -c CFDvelocityudf.c
CFDvelocityudf.c: In function 'on_load':
CFDvelocityudf.c:29:3: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result]
fscanf (uvel, "%f", &datauvel);
^
CFDvelocityudf.c:30:3: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result]
fscanf (tm, "%f", &datatime);
^
# Linking libudf.so because of udf_names.c udf_names.o CFDvelocityudf.o
ld -shared -lm udf_names.o CFDvelocityudf.o -o libudf.so
make[3]: Leaving directory '/home/felipe-ubuntu/Desktop/casoudf/libudf/lnamd64/3ddp'
make[2]: Leaving directory '/home/felipe-ubuntu/Desktop/casoudf/libudf/lnamd64/3ddp'
make[1]: Leaving directory '/home/felipe-ubuntu/Desktop/casoudf/libudf/lnamd64/3ddp'


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


Done.


Opening library "/home/felipe-ubuntu/Desktop/casoudf/libudf"...
Library "/home/felipe-ubuntu/Desktop/casoudf/libudf/lnamd64/3ddp/libudf.so" opened
on_load
inlet_x_velocity


UDF Autorun:
on_load


Error: received a fatal signal (Segmentation fault).


Error: received a fatal signal (Segmentation fault).
Error Object: #f

Code:
#include "udf.h" 
#include <stdio.h> 
#include <math.h> 
 
int n=24;   
real *ttmm;                                                     
real *uvelocity; 
double hr=10; 
real k=0.42; 
 
DEFINE_EXECUTE_ON_LOADING(on_load,libudf)                                 
{ 
    int i; 
    float datauvel; 
    float datatime; 
    FILE *uvel; 
    FILE *tm; 
 
    uvel = fopen("U_velocity.txt","r"); 
    tm = fopen("time.txt","r"); 
     
    uvelocity = (real*)malloc((n)*sizeof(real)); 
    ttmm = (real*)malloc((n)*sizeof(real)); 
     
    for(i=0;i<n;i++) 
    { 
        datauvel=0; 
        datatime=0; 
        fscanf (uvel, "%f", &datauvel); 
        fscanf (tm, "%f", &datatime);                                     
        uvelocity[i]=datauvel; 
        ttmm[i]=datatime; 
         
        Message("* Velocity_U[%d] = %.2f\n",i,uvelocity[i]); 
        Message("* Time[%d] = %.2f\n",i,ttmm[i]); 
    } 
    fclose(uvel);  
    fclose(tm);                                                             
}

 
DEFINE_PROFILE(inlet_x_velocity, thread, nv)                             
{ 
    real x[ND_ND];      
    real z; 
    face_t f; 
    real currenttime; 
    double vref=0; 
    double a; 
    int j=0; 
    int i=0; 
    currenttime = CURRENT_TIME; 
                                                                 
    for(i=0;i<n-1;i++) 
    { 
        if(currenttime>=ttmm[i] && currenttime<ttmm[i+1]) 
        { 
            j=i; 
            break; 
        } 
        else if (currenttime>=ttmm[n-1]) 
        { 
            j=n-1; 
            break; 
        } 
    } 
 
    begin_f_loop(f, thread) 
    {                     
        F_CENTROID(x,f,thread); 
        z = x[1]; 
 
        if(j>=0 && j<n-1) 
        { 
            vref=(((currenttime-ttmm[j])*(uvelocity[j+1]-uvelocity[j]))/(ttmm[j+1]-ttmm[j]))+uvelocity[j]; 
        } 
        else 
        { 
            vref=uvelocity[n-1]; 
        } 
        a=vref*pow((z/hr),0.08);                                     
        F_PROFILE(f, thread, nv)=a; 
    } 
    end_f_loop(f, thread)     
}
FSM is offline   Reply With Quote

Old   March 21, 2018, 02:54
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Test if your files can be opened...
Code:
uvel = fopen("U_velocity.txt","r"); 
tm = fopen("time.txt","r"); 

if (!uvel) {
Message("U_velocity.txt" could not be opened.");exit(1);
}

if (!tm) {
Message("time.txt" could not be opened.");exit(1);
}
pakk is offline   Reply With Quote

Old   March 23, 2018, 15:31
Default
  #3
FSM
New Member
 
Felipe
Join Date: Nov 2017
Location: Brazil
Posts: 16
Rep Power: 9
FSM is on a distinguished road
Hi Pakk,

Thanks for the reply.
I have tested with the routine you sent me, and looks like files are actually not being opened. Thats might be why the warning is about the fscanf.
The information on the console shows the message that the file is not being opened.
Do you know if there is something wrong?
I am not an expert using UDF or programming, but maybe could have another way to open the files.
Thanks again, I hope you guys can help me.
Follow the logs bellow.

Quote:
for d in lnamd64/[23]*; do \
( \
cd $d; \
for f in ../../src/*.[ch] ../../src/makefile ../../src/user.udf; do \
if [ ! -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
# linking to ../../src/CFDvelocityudf.c in lnamd64/3ddp


# building library in lnamd64/3ddp
make[1]: Entering directory '/home/felipe-ubuntu/Desktop/casoudf/libudf/lnamd64/3ddp'
# Generating udf_names.c because of makefile CFDvelocityudf.c
make[2]: Entering directory '/home/felipe-ubuntu/Desktop/casoudf/libudf/lnamd64/3ddp'
make libudf.so "CFLAGS=-D_lnamd64 -D_GNU_SOURCE -fpic -shared -ansi -Wall -O -DPTR_RESTRICT= " "LDFLAGS=-shared -lm"
make[3]: Entering directory '/home/felipe-ubuntu/Desktop/casoudf/libudf/lnamd64/3ddp'
# Compiling udf_names.o because of udf_names.c
cc -D_lnamd64 -D_GNU_SOURCE -fpic -shared -ansi -Wall -O -DPTR_RESTRICT= -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/`expr "\`pwd\`" : '.*/\(.*\)/[23].*'`/`basename "\`pwd\`"` -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/main -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/addon-wrapper -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/io -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/species -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/pbns -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/numerics -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/sphysics -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/storage -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/mphase -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/bc -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/models -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/material -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/amg -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/util -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/mesh -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/udf -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/ht -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/dx -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/turbulence -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/parallel -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/etc -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/ue -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/dpm -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/dbns -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/cortex/src -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/client/src -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/tgrid/src -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/multiport/src -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/multiport/mpi_wrapper/include -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/multiport/mpi_wrapper/src -I. -c udf_names.c
# Compiling CFDvelocityudf.o because of CFDvelocityudf.c
cc -D_lnamd64 -D_GNU_SOURCE -fpic -shared -ansi -Wall -O -DPTR_RESTRICT= -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/`expr "\`pwd\`" : '.*/\(.*\)/[23].*'`/`basename "\`pwd\`"` -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/main -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/addon-wrapper -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/io -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/species -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/pbns -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/numerics -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/sphysics -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/storage -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/mphase -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/bc -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/models -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/material -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/amg -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/util -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/mesh -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/udf -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/ht -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/dx -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/turbulence -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/parallel -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/etc -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/ue -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/dpm -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/src/dbns -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/cortex/src -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/client/src -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/tgrid/src -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/multiport/src -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/multiport/mpi_wrapper/include -I/home/felipe-ubuntu/ansys_inc/v170/fluent/fluent17.0.0/multiport/mpi_wrapper/src -I. -c CFDvelocityudf.c
CFDvelocityudf.c: In function 'on_load':
CFDvelocityudf.c:35:3: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result]
fscanf (uvel, "%f", &datauvel);
^
CFDvelocityudf.c:36:3: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result]
fscanf (tm, "%f", &datatime);
^
# Linking libudf.so because of makefile user.udf udf_names.c udf_names.o CFDvelocityudf.o
ld -shared -lm udf_names.o CFDvelocityudf.o -o libudf.so
make[3]: Leaving directory '/home/felipe-ubuntu/Desktop/casoudf/libudf/lnamd64/3ddp'
make[2]: Leaving directory '/home/felipe-ubuntu/Desktop/casoudf/libudf/lnamd64/3ddp'
make[1]: Leaving directory '/home/felipe-ubuntu/Desktop/casoudf/libudf/lnamd64/3ddp'


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


Done.


Opening library "/home/felipe-ubuntu/Desktop/casoudf/libudf"...
Library "/home/felipe-ubuntu/Desktop/casoudf/libudf/lnamd64/3ddp/libudf.so" opened
on_load
inlet_x_velocity


UDF Autorun:
on_load
time.txt could not be opened. The fluent process could not be started.
p, li { white-space: pre-wrap; }
FSM is offline   Reply With Quote

Old   March 24, 2018, 08:36
Default
  #4
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Quote:
Originally Posted by FSM View Post
Hi Pakk,

Thanks for the reply.
I have tested with the routine you sent me, and looks like files are actually not being opened. Thats might be why the warning is about the fscanf.
The information on the console shows the message that the file is not being opened.
Do you know if there is something wrong?
I am not an expert using UDF or programming, but maybe could have another way to open the files.
Thanks again, I hope you guys can help me.
Follow the logs bellow.
The file can not be opened, so investigate why not. Does it exist? Is it in the right place? Does it have exactly this name, including capitalization?
FSM likes this.
pakk is offline   Reply With Quote

Old   April 6, 2018, 10:15
Default
  #5
FSM
New Member
 
Felipe
Join Date: Nov 2017
Location: Brazil
Posts: 16
Rep Power: 9
FSM is on a distinguished road
Thank you all for the help.
I made some modifications in the files name, and it worked. Now the Linux system is compiling the code, but only in serial.
I am trying to adjust the code to run in parallel, and getting a bit of trouble. I read the manual, and I see that I need to include some compiler directives (#if !RP_HOST, #if RP_NODE, etc), but I still didn't get it right. I am new to using a parallel process, and I am not sure what process should be done by the host or by the node.

If you guys have any suggestions of parallelizing this code, I would appreciate.

Thank you in advance.
FSM is offline   Reply With Quote

Old   April 8, 2018, 22:55
Default
  #6
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
to run your code in parallel you should modify read/write from file part
algorithm:
1. read from file to host
2. transfer read data to nodes
3. calculate on nodes
4. send back from nodes to host

also you should modify loops commands
was
Code:
begin_f_loop(f, thread) { ... } end_f_loop(f, thread)
tobe
Code:
begin_f_loop_int(f, thread) { ... } end_f_loop_int(f, thread)
best regards
clarice and FSM like this.
AlexanderZ is offline   Reply With Quote

Old   April 10, 2018, 00:19
Default Need help
  #7
FSM
New Member
 
Felipe
Join Date: Nov 2017
Location: Brazil
Posts: 16
Rep Power: 9
FSM is on a distinguished road
Thank you for the suggestions @AlexanderZ, I am working on the parallelization of this code, that's the first time I am working with parallel UDF in a cluster.
I still didn't figure out the proper way to organize the compiler directives. Also, I am using the command host_to_node to send the array of uvelocity, vvelocity and ttmm(time) form the ON_LOAD function to the DEFINE_PROFILE. I don't know if it's the correct way to use that.
I still have a few questions.
1) On step 3 of the list that you made @AlexanderZ, what exactly should I consider calculation on this code? should I put the #if !RP_HOST for all the DEFINE_ PROFILE macro?
2) On step 4, what should I send from node to host? I still don't get it?

I am posting the code here if you guys could help me parallelizing this code, I really would appreciate.
I'm running out of time on my project and I need to get this UDF working on our cluster.


Thank you all.

Code:
#include "udf.h"
#include <stdio.h>
#include <math.h>


int n=24;  /*number of lines in the data files*/
real *ttmm;													
real *uvelocity;
real *vvelocity;
real href=10;
real Zzero=0.6;
real k=0.42;


/*Read data from files*/
DEFINE_EXECUTE_ON_LOADING(on_load,libudf)								
{
#if RP_HOST
	int i;
	float datauvel;
	float datavvel;
	float datatime;
	FILE *uvel;
	FILE *vvel;
	FILE *tm;

	uvel = fopen("U_velocity.txt","r");
	vvel = fopen("V_velocity.txt","r");
	tm = fopen("time.txt","r");

	uvelocity = (real*)malloc((n)*sizeof(real));
	vvelocity = (real*)malloc((n)*sizeof(real));
	ttmm = (real*)malloc((n)*sizeof(real));


	for(i=0;i<n;i++)
	{
		datauvel=0;
		datavvel=0;
		datatime=0;
		fscanf (uvel, "%f", &datauvel);
		fscanf (vvel, "%f", &datavvel); 	
		fscanf (tm, "%f", &datatime);									
		uvelocity[i]=datauvel;
		vvelocity[i]=datavvel;
		ttmm[i]=datatime;
		
		Message("* Velocity_U[%d] = %.2f\n",i,uvelocity[i]);
		Message("* Velocity_V[%d] = %.2f\n",i,vvelocity[i]);
		Message("* Time[%d] = %.2f\n",i,ttmm[i]);

	}
	fclose(uvel); 
	fclose(vvel);
	fclose(tm);
#endif

host_to_node_real(uvelocity,n);
host_to_node_real(vvelocity,n);
host_to_node_real(ttmm,n);

}

/*Print the velocity and time values*/
DEFINE_ON_DEMAND(list_velocity)											
{
#if RP_HOST

	int i=0;
	int j=0;
	for(i=0;i<n;i++)
	{
		Message("\nVelocity_U[%d]=%.2f\n",i,uvelocity[i]);
		Message("\nVelocity_V[%d]=%.2f\n",i,vvelocity[i]);
		Message("\nTime[%d]=%.2f\n",i,ttmm[j]);
		j++;
	}
#endif
}


/*Velocity components X and Y*/
DEFINE_PROFILE(inlet_x_velocity, thread, nv)							
{
#if !RP_HOST
	real x[ND_ND];	 
	real z;
	face_t f;
	real currenttime;
	real vref=0;
	real ufric;
	double a;
	double b;
	double vel;
	int j=0;
	int i=0;
	currenttime = CURRENT_TIME;

	for(i=0;i<n-1;i++)
	{
		if(currenttime>=ttmm[i] && currenttime<ttmm[i+1])
		{
			j=i;
			break;
		}
		else if (currenttime>=ttmm[n-1])
		{
			j=n-1;
			break;
		}
	}

	begin_f_loop_int(f, thread)
	{					
		F_CENTROID(x,f,thread);
		z = x[1];

/*Interporlation function*/
		if(j>=0 && j<n-1)
		{
			vref=(((currenttime-ttmm[j])*(uvelocity[j+1]-uvelocity[j]))/(ttmm[j+1]-ttmm[j]))+uvelocity[j];
		}
		else
		{
			vref=uvelocity[n-1];
		}
		ufric=(vref*k)/log(href/Zzero);
		a=(z/Zzero);
		b= log(a);
		vel=(ufric/k)*b;
		F_PROFILE(f, thread, nv)=vel;
	}
	end_f_loop_int(f, thread)
#endif

}

DEFINE_PROFILE(inlet_y_velocity, thread, nv)							
{
#if !RP_HOST
	real y[ND_ND];	 
	real z;
	face_t f;
	real currenttime;	
	real vref=0;
	real ufric;
	double a;
	double b;
	double vel;
	int j=0;
	int i=0;
	currenttime = CURRENT_TIME;

	for(i=0;i<n-1;i++)
	{
	
		if(currenttime>=ttmm[i] && currenttime<ttmm[i+1])
		{
			j=i;
			break;
		}
		else if (currenttime>=ttmm[n-1])
		{
			j=n-1;
			break;
		}
	}

	begin_f_loop_int(f, thread)
	{					
		F_CENTROID(y,f,thread);
		z = y[1];
/*Interporlation function*/
		if(j>=0 && j<n-1)
		{
			vref=(((currenttime-ttmm[j])*(vvelocity[j+1]-vvelocity[j]))/(ttmm[j+1]-ttmm[j]))+vvelocity[j];
		}
		else
		{
			vref=vvelocity[n-1];
		}
		ufric=(vref*k)/log(href/Zzero);
		a=(z/Zzero);
		b= log(a);
		vel=(ufric/k)*b;
		F_PROFILE(f, thread, nv)=vel;
	}
	end_f_loop_int(f, thread)
#endif

}

LOG after loading
Code:
for d in lnamd64/[23]*; do \
	  ( \
	    cd $d; \
	    for f in ../../src/*.[ch] ../../src/makefile ../../src/user.udf; do \
	      if [ ! -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
# linking to ../../src/user.udf in lnamd64/3ddp_host

# building library in lnamd64/3ddp_host
make[1]: Entering directory `/state/partition1/home/felipe/Documentos/teste8/libudf/lnamd64/3ddp_host'
# Generating udf_names.c because of makefile velocityudf_log.c
make[2]: Entering directory `/state/partition1/home/felipe/Documentos/teste8/libudf/lnamd64/3ddp_host'
make libudf.so "CFLAGS=-D_lnamd64 -D_GNU_SOURCE -fpic -shared -ansi -Wall -O -DPTR_RESTRICT=	" "LDFLAGS=-shared -lm"
make[3]: Entering directory `/state/partition1/home/felipe/Documentos/teste8/libudf/lnamd64/3ddp_host'
# Compiling udf_names.o because of udf_names.c
cc -D_lnamd64 -D_GNU_SOURCE -fpic -shared -ansi -Wall -O -DPTR_RESTRICT=	 -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/`expr "\`pwd\`" : '.*/\(.*\)/[23].*'`/`basename "\`pwd\`"` -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/main -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/addon-wrapper -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/io -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/species -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/pbns -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/numerics -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/sphysics -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/storage -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/mphase -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/bc -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/models -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/material -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/amg -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/util -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/mesh -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/udf -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/ht -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/dx -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/turbulence -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/parallel -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/etc -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/ue -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/dpm -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/dbns -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/cortex/src -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/client/src -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/tgrid/src -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/multiport/src -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/multiport/mpi_wrapper/include -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/multiport/mpi_wrapper/src -I. -c udf_names.c
# Compiling velocityudf_log.o because of velocityudf_log.c
cc -D_lnamd64 -D_GNU_SOURCE -fpic -shared -ansi -Wall -O -DPTR_RESTRICT=	 -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/`expr "\`pwd\`" : '.*/\(.*\)/[23].*'`/`basename "\`pwd\`"` -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/main -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/addon-wrapper -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/io -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/species -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/pbns -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/numerics -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/sphysics -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/storage -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/mphase -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/bc -I/share/apps
You can also see the 'log'-file in 
the working directory for this compilation history

Done.
/ansys_inc/v172/fluent/fluent17.2.0/src/models -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/material -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/amg -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/util -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/mesh -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/udf -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/ht -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/dx -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/turbulence -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/parallel -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/etc -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/ue -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/dpm -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/dbns -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/cortex/src -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/client/src -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/tgrid/src -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/multiport/src -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/multiport/mpi_wrapper/include -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/multiport/mpi_wrapper/src -I. -c velocityudf_log.c
# Linking libudf.so because of makefile user.udf udf_names.c udf_names.o velocityudf_log.o
ld -shared -lm udf_names.o velocityudf_log.o  -o libudf.so
make[3]: Leaving directory `/state/partition1/home/felipe/Documentos/teste8/libudf/lnamd64/3ddp_host'
make[2]: Leaving directory `/state/partition1/home/felipe/Documentos/teste8/libudf/lnamd64/3ddp_host'
make[1]: Leaving directory `/state/partition1/home/felipe/Documentos/teste8/libudf/lnamd64/3ddp_host'
# linking to ../../src/user.udf in lnamd64/3ddp_node

# building library in lnamd64/3ddp_node
make[1]: Entering directory `/state/partition1/home/felipe/Documentos/teste8/libudf/lnamd64/3ddp_node'
# Generating udf_names.c because of makefile velocityudf_log.c
make[2]: Entering directory `/state/partition1/home/felipe/Documentos/teste8/libudf/lnamd64/3ddp_node'
make libudf.so "CFLAGS=-D_lnamd64 -D_GNU_SOURCE -fpic -shared -ansi -Wall -O -DPTR_RESTRICT=	" "LDFLAGS=-shared -lm"
make[3]: Entering directory `/state/partition1/home/felipe/Documentos/teste8/libudf/lnamd64/3ddp_node'
# Compiling udf_names.o because of udf_names.c
cc -D_lnamd64 -D_GNU_SOURCE -fpic -shared -ansi -Wall -O -DPTR_RESTRICT=	 -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/`expr "\`pwd\`" : '.*/\(.*\)/[23].*'`/`basename "\`pwd\`"` -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/main -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/addon-wrapper -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/io -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/species -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/pbns -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/numerics -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/sphysics -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/storage -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/mphase -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/bc -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/models -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/material -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/amg -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/util -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/mesh -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/udf -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/ht -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/dx -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/turbulence -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/parallel -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/etc -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/ue -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/dpm -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/dbns -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/cortex/src -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/client/src -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/tgrid/src -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/multiport/src -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/multiport/mpi_wrapper/include -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/multiport/mpi_wrapper/src -I. -c udf_names.c
# Compiling velocityudf_log.o because of velocityudf_log.c
cc -D_lnamd64 -D_GNU_SOURCE -fpic -shared -ansi -Wall -O -DPTR_RESTRICT=	 -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/`expr "\`pwd\`" : '.*/\(.*\)/[23].*'`/`basename "\`pwd\`"` -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/main -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/addon-wrapper -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/io -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/species -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/pbns -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/numerics -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/sphysics -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/storage -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/mphase -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/bc -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/models -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/material -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/amg -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/util -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/mesh -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/udf -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/ht -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/dx -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/turbulence -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/parallel -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/etc -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/ue -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/dpm -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/src/dbns -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/cortex/src -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/client/src -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/tgrid/src -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/multiport/src -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/multiport/mpi_wrapper/include -I/share/apps/ansys_inc/v172/fluent/fluent17.2.0/multiport/mpi_wrapper/src -I. -c velocityudf_log.c
# Linking libudf.so because of makefile user.udf udf_names.c udf_names.o velocityudf_log.o
ld -shared -lm udf_names.o velocityudf_log.o  -o libudf.so
make[3]: Leaving directory `/state/partition1/home/felipe/Documentos/teste8/libudf/lnamd64/3ddp_node'
make[2]: Leaving directory `/state/partition1/home/felipe/Documentos/teste8/libudf/lnamd64/3ddp_node'
make[1]: Leaving directory `/state/partition1/home/felipe/Documentos/teste8/libudf/lnamd64/3ddp_node'

Opening library "/state/partition1/home/felipe/Documentos/teste8/libudf"...Node 0: Doesn't have write permissions for libudf/lnamd64/3ddp_node. If using local disk, make sure UDF lib is synced up on all nodes.


Error at Node 2: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (lnamd64).

No such file or directory
Error at Node 1: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (lnamd64).

No such file or directory
Error at Node 3: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (lnamd64).

No such file or directory
//libudf/lnamd64/3ddp_node/libudf.so
//libudf/lnamd64/3ddp_node/libudf.so
//libudf/lnamd64/3ddp_node/libudf.so

Error at Node 0: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (lnamd64).

No such file or directory
//libudf/lnamd64/3ddp_node/libudf.so
Opening library "//libudf"...
Opening library "//libudf"...
Opening library "//libudf"...
Opening library "//libudf"...
FSM is offline   Reply With Quote

Old   April 10, 2018, 01:11
Default
  #8
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
first of all, I looks like you have problems with permissions
Code:
Node 0: Doesn't have write permissions for libudf/lnamd64/3ddp_node.
that's why compilation was not finished
unfortunatelly, I have no experience working on linux.

on the other hand
Code:
DEFINE_ON_DEMAND(list_velocity)											
{
#if RP_HOST

	int i=0;
	int j=0;
	for(i=0;i<n;i++)
	{
		Message("\nVelocity_U[%d]=%.2f\n",i,uvelocity[i]);
		Message("\nVelocity_V[%d]=%.2f\n",i,vvelocity[i]);
		Message("\nTime[%d]=%.2f\n",i,ttmm[j]);
		j++;
	}
#endif
}
n is not defined

regarding step 4. it is needed in case you want to write into file.

best regards
AlexanderZ is offline   Reply With Quote

Reply

Tags
compile probelms, fatal error, fluent - udf, linux server, udf compilation


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
Problem in compiling fluent UDF lunched from MATLAB cfdman10 Fluent UDF and Scheme Programming 16 December 5, 2019 06:32
UDF in Fluent Andrew Fluent UDF and Scheme Programming 5 March 7, 2016 04:38
Fluent in Linux vs. Fluent in Windows Melih FLUENT 6 November 16, 2014 10:39
Fluent UDF for thermal NOx larsschwarzer Fluent UDF and Scheme Programming 1 July 18, 2014 09:39
fluent UDF on linux machine Min-Hua Wang Fluent UDF and Scheme Programming 6 June 29, 2013 09:41


All times are GMT -4. The time now is 19:41.