You can incorporate your own formulations and data for the properties
of the battery using the batt_user.c source
code file.
The following listing represents a description of the contents
of the batt_user.c source code file:
real CONDUCTIVITY_CELL(cell_t c, Thread
*t): Returns values for the electrical conductivity for
cells inside conductive zones, overwriting the values set in the Electric Field tab of the Battery Model dialog box.
real CONTACT_RESIST_FACE(cell_t f, Thread
*t): Returns values for the electrical contact resistance,
overwriting the values set in the Electric Field tab of the Battery Model dialog box.
real Compute_U (face_t f, Thread *t, real
DOD, real dUdJ, real a[], real *dUdJ): Returns values
for both U and the derivative of U with respect to J (dUdJ). Note that DOD represents
the depth of discharge and a[] is the set
of U coefficients.
real Compute_Y (face_t f, Thread *t, real
DOD, real b[]): Returns values for Y. Note that DOD represents the depth of discharge and b[] is the set of Y coefficients.
For more information, see the following sections:
This section includes instructions on how to compile a customized
Battery user-defined module. Note that you can also refer to the file INSTRUCTIONS-CLIENT that comes with your distribution
(see addons/battery).
Important: It is assumed that you have a basic familiarity with compiling user-defined functions (UDFs). For an introduction on how to compile UDFs, refer to the Fluent Customization Manual.
You will first want to use a local copy of the battery directory in the addons directory before
you recompile the Battery module.
Make a local copy of the battery directory. Do not create a symbolic link.
Important: The custom version of the library must be named according to
the convention used by ANSYS Fluent: for example, battery.
Change directories to the battery/src directory.
Make changes to the batt_user.c file.
Edit the makefile located
in the src/ directory and make sure that
the FLUENT_INC variable correctly refers
to the current ANSYS Fluent installation directory. Be careful not to
leave any trailing spaces when you make your changes.
Define the FLUENT_ADDONS environment
variable to correspond to your customized version of the Battery module.
Change directories to the battery/ directory.
Issue the following make command:
make FLUENT_INC=[ansys_inc/v182/fluent] FLUENT_ARCH=[arch] -f Makefile-client
where your_arch is lnx86 on LINUX, or ultra on the Sun operating
system, etc.
The following example demonstrates the steps required to set
up and run a customized version of the Battery module that is located
in a folder call home/sample:
Make a directory (for example, mkdir-p
/home/sample).
Copy the default addon library
to this location.
cp -RH [ansys_inc/v182/fluent]/fluent18.2.0/addons/battery /home/sample/battery
Using a text editor, make the appropriate changes
to the batt_user.c file located in /home/sample/battery/src/batt_user.c
Edit the makefile located
in the src/ directory and make sure that
the FLUENT_INC variable correctly refers
to the current ANSYS Fluent installation directory. Be careful not to
leave any trailing spaces when you make your changes.
Build the library.
cd /home/sample/battery make FLUENT_INC=[ansys_inc/v182/fluent] FLUENT_ARCH=[arch] -f Makefile-client
Set the FLUENT_ADDONS environment
variable (using CSH, other shells will differ).
setenv FLUENT_ADDONS /home/sample
Start ANSYS Fluent and load the customized module using the text interface command.
Open Visual Studio.NET at the DOS prompt.
Make sure that the FLUENT_INC environment variable is correctly set to the current ANSYS Fluent installation
directory (for example, ANSYS Inc\v182\fluent).
Make a local copy of the battery folder. Do not create a shortcut.
Enter the battery\src folder.
Make changes to the batt_user.c file.
Define the FLUENT_ADDONS environment
variable to correspond to your customized version of the Battery module.
Return to the battery folder.
Issue the following command in the command window:
nmake /f makefile_master-client.nt