How can I inject particles along a line in the CFX 10.0 solver?


This can be achieved with some simple user Fortran. See the example below.


These two simple user subroutines allow particles to be injected along a line, something which is not available as a standard feature of the current release (CFX-10.0). However, users should be aware that line injection may become available in a future release, thereby making these routines superfluous.

The subroutine USR_INJECT_LINE generates a sequence of initial particle locations, used in the specification of a particle injection region. These points are uniformly spaced between the line end points, the coordinates of which are supplied by the user. USR_INJECT_WRAP is merely a wrapper for USR_INJECT_LINE and simplifies the coding by allowing the required array segments to be addressed locally in USR_INJECT_LINE.

The line end point coordinates must be defined in the USER section of the command language using the user parameters 'point1' and 'point2'. An example of this coordinate definition is shown below:

USER:
point1 = 0.14, 0.16, 0.9
point2 = 0.84, 0.86, 0.9
END

Specifying the coordinates in this way has the advantage that a change in coordinates does not require re-compilation and re-linking of the user subroutines.

The number of particles to be injected is specified using the parameter 'Number of Positions' (or 'Number of Positions per Unit Time' for transient simulations). This is a standard parameter for particle injection regions.

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
test1.def : Example definition file

To run this example, proceed as follows:


- Use the cfxtmkext utility to create the user Fortran shared libraryfor the operating system you are using:

cfx5mkext -name test usr_inject_line.F usr_inject_wrap.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





Show Form
No comments yet. Be the first to add a comment!