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

Compiling the customized UDF code for PEMFC

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 14, 2016, 16:05
Default Compiling the customized UDF code for PEMFC
  #1
New Member
 
Dm Fo
Join Date: Apr 2015
Posts: 15
Rep Power: 11
dmfo is on a distinguished road
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 is offline   Reply With Quote

Old   August 14, 2016, 16:57
Default
  #2
New Member
 
Dm Fo
Join Date: Apr 2015
Posts: 15
Rep Power: 11
dmfo is on a distinguished road
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?
Attached Files
File Type: c pem_user.c (24.1 KB, 71 views)
File Type: txt makelog.txt (2.0 KB, 56 views)
dmfo is offline   Reply With Quote

Old   October 1, 2017, 19:30
Default
  #3
New Member
 
Arif
Join Date: Sep 2017
Posts: 17
Rep Power: 9
engrarif is on a distinguished road
Hi dmfo,
i am having the same problem. Is ur problem solved/ plz do guide me as well
engrarif is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
How to solve UDF compilation problems in Fluent. pakk Fluent UDF and Scheme Programming 16 September 10, 2018 03:48
UDF compiling and Interpreting error aduramolasode95 Fluent UDF and Scheme Programming 3 April 19, 2016 22:09
something wrong when compiling udf, however the code is correct when interpreting richard ben Fluent UDF and Scheme Programming 7 May 11, 2013 08:36
UDF code for concentration distribution szw_china Fluent UDF and Scheme Programming 0 July 22, 2012 22:35
ERROR in compiling UDF stefanos Fluent UDF and Scheme Programming 1 April 25, 2012 08:37


All times are GMT -4. The time now is 05:46.