This section presents the steps you will need to follow to compile your UDWSPF C code and build a shared library file. This process requires the use of a C compiler. For more details on compiler requirements, see Compilers in the Fluent Customization Manual.
Important: To use the UDWSPF you will need to first build the UDWSPF library by compiling your UDWSPF C code and then loading the library into the ANSYS Fluent code.
The UDWSPF shared library is built in the same way that the ANSYS Fluent executable
itself is built. Internally, a script called Makefile is used to invoke the system C compiler to build an object code
library that contains the native machine language translation of your
higher-level C source code. This shared library is then loaded into ANSYS Fluent (either
at run time or automatically when a case file is read) by a process
called dynamic loading. The object libraries
are specific to the computer architecture being used, as well as to
the particular version of the ANSYS Fluent executable being run.
The libraries must, therefore, be rebuilt any time ANSYS Fluent is
upgraded, when the computer’s operating system level changes,
or when the job is run on a different type of computer.
The general procedure for compiling UDWSPF C code is as follows:
Place the UDWSPF C code in your working directory (that is, where your case file resides).
Launch ANSYS Fluent.
Read your case file into ANSYS Fluent.
You can now compile your UDWSPF C code and build a shared library file using the commands provided in the text command interface (TUI):
Select the define/models/multiphase/wet-steam menu item.
define → models
→ multiphase →
wet-steam
If the Wet Steam model has not been enabled yet, use the following TUI commands to enable it:
define/models/multiphase/wet-steam>
enable?
Enable wet steam model? [no]
yes
Select the compile-user-defined-wetsteam-functions option.
Enter the compiled UDWSPF library name.
The name given here is the name of the directory where the shared library (for example, libudf) will reside. For example, if you press Enter then a directory should exist with the name libudf, and this directory will contain library file called libudf. If, however, you type a new library name such as mywetsteam, then a directory called mywetsteam will be created and it will contain the library libudf.
Continue on with the procedure when prompted.
Enter the C source file names.
Important: Ideally you should place all of your functions into a single file. However, you can split them into separate files if desired.
Enter the header file names, if applicable. If you do not have an extra header file, then press Enter when prompted.
ANSYS Fluent will then start compiling the UDWSPF C code and put it in the appropriate architecture directory.