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/)
-   -   Compiling the customized UDF code for PEMFC (https://www.cfd-online.com/Forums/fluent-udf/176266-compiling-customized-udf-code-pemfc.html)

dmfo August 14, 2016 15:05

Compiling the customized UDF code for PEMFC
 
Dear colleagues,

Can anyone explain how to compile basic or customized UDF code for PEMFC simulation?

I have VS 2012 prof x64 and fluent 17.1.

I compiled lots of simple UDF, but now I have an error compiling even basic UDF for fuelcell module.

dmfo August 14, 2016 15:57

2 Attachment(s)
I have done all steps as wrote in Solutions#2024479 (ANSYS Customer portal):

ANSYS Inc\v140\fluent\fluent14.0.0\addons\fuelcells

(Please note that folders "v140" & "fluent14.0.0" are valid for Release 14.0 and are slightly different for other releases. It is advised to find the exact location of the "fuelcells" folder using Windows Explorer)

3) Copy the above "fuelcells" directory from its standard location to your local directory where your case( and data) files are. For example, D:\Data\PEM_example.*

4) Enter the fuelcells/src folder, in our example: D:\Data\PEM_example\fuelcells\src. This folder contains a customizable pem_user.c file which you can modify. Please make a cosmetic change to this file so that you know and can check if the desired local pem_user.c is used (i.e. from your local directory) and not the one from the standard ANSYS installation directory. For, example you can modify one of the User-Defined Memories slightly. Upon loading the library into ANSYS FLUENT you are able to see the list and naming for all used User-Defined Memories and User-Defined Scalars.
For example, replace the line:

strncpy(udm[ 0], "X Current Flux Density", STRING_SIZE-1);

with:

strncpy(udm[ 0], "X CURRENT FLUX DENSITY", STRING_SIZE-1);

and then it will be very easy to spot which file/library is used.

5) Make sure that the FLUENT_INC environment variable is set correctly to the current ANSYS FLUENT installation directory i.e.:*

C:\Program Files\ANSYS Inc\v140\fluent*

The above path can be different for a different release of ANSYS Software or if the installation of ANSYS Software has been carried out in a non-default location.

6) Define the FLUENT_ADDONS environment variable to correspond to your customized version of the Fuel Cell and Electrolysis module, i.e FLUENT_ADDONS should point to your local directory that contains your case file and the customized "fuelcells" directory, i.e. D:\Data\PEM_Example in our case.

NOTE: In order to define the environment variables in Steps 5 & 6 above please go to:
Start -> Control Panel -> System -> Advanced System Settings -> Environment Variables:
Under "System variables" please press "New" to create "FLUENT_INC" & "FLUENT_ADDONS" variables.

7) Modify the "Path" environment variable by appending:

;C:\Program Files\ANSYS Inc\v140\fluent\ntbin\win64

to the existing Path.

8) Return to your local "fuelcells" folder.

9) Open a new DOS command prompt and issue the following command:

nmake -f makefile_master-client.nt clean

This will clean all old libraries.

10) Issue another command to build a new library so that the changes you've made can become active:

nmake -f makefile_master-client.nt

But when I check makelog file in my local fuelcells\win64\3ddp, I see some error.

I attached pem.c and makelog files.

Any suggestions?

engrarif October 1, 2017 18:30

Hi dmfo,
i am having the same problem. Is ur problem solved/ plz do guide me as well


All times are GMT -4. The time now is 04:02.