Is it possible to specify the mass fraction for multi-component particles from a user defined particle injection routine.
It is not normally possible to set the particle component mass fraction from a particle injection routine, since this is not one of the variables available for use in the return variables list. However, this limitation can be worked around with some user Fortran, as shown in the following example.
The example is based on an earlier example of injecting particles along a line. The subroutines USR_INJECT_LINE and USR_INJECT_WRAP generate a sequence of initial particle locations, based on the line end point coordinates must be defined in the USER section of the command language. The routine USR_SET_MFPIR sets the particle mass fraction.
The component names and mass fractions are hard coded, but could be passed through using user parameters. This code cannot be used for a spatially varying initial particle mass fraction, since the same initial mass fraction is used for all locations in a given injection region. However, it could be used to implement a time varying initial mass fraction.
Please note this example may become obeslete in a future release of the software.
A complete example is provided. This injects 50 particles in the way described above. The attached zip archive contains the following files:
README : This file
usr_inject_line.F : Main subroutine for defining particle initial coordinates
usr_inject_wrap.F : Wrapper subroutine called by the solver
usr_set_mfpir.F : Sets the mass fraction of a particle component
test1.def : Example definition file
To run this example, proceed as follows:
- Use the cfx5mkext utility to create the user Fortran shared library for the operating system you are using:
cfx5mkext -name test *.F
- Use the cfx5cmds utility to extract the command language from the definition file:
cfx5cmds -def test1.def -text test1.ccl -read
- Modify the file test1.ccl, such that the 'Library Path' parameter specifies the correct location of the shared library. The path should not include the platform specific subdirectory created by the cfx5mkext utility.
- Use the cfx5cmds utility to write the modified command language to the definition file:
cfx5cmds -def test1.def -text test1.ccl -write
- Run the solver:
cfx5solve -def test1.def
**** Entered By: dsclarke @ 12/24/2008 12:39 PM ****