Pass Through UDF
The pass through UDF may replace the built-in pass through models All Particles pass, Constant absorption rate, Clogging, Constant efficiency, Velocity-dependent efficiency, or Impassable. Select it on the Particles - Interaction Model tab.
A pass through UDF contains five functions.
The sample UDF PassThroughUDF.cpp is delivered with GeoDict.
udf_entryMessage
This function is called when the UDF is attached and can be used to print a message to the console.
Input: none
Return value: none
Example:
|
udf_exitMessage
This function is called when the UDF is detached and can be used to print a message to the console.
Input: none
Return value: none
Example:
|
udf_numberOfMaterialParameters
The function defines the number of material parameter that the UDF requires as input. This defines the number of material parameters to enter into the Particles tab table. These material parameters may be, for example, the thickness of the media and the corresponding filter efficiency.
Input: none
Return value: integer
Example: the example file PassThroughUDF.cpp defines two material parameters
|
udf_nameOfMaterialParameters
The function allows to set the headings that will appear in the Particles tab table. You must define headings for a number of parameters as defined in the udf_numberOfMaterialParameters function
Input:
- parameter number (integer)
Return value: const char*
Example: the example file PassThroughUDF.cpp defines two material parameters
For each porous material using the pass through UDF, two columns will now appear in the Size Distribution table
|
udf_passThrough
This function computes the passing probability (251) of a particles moving through a porous material. It is called whenever the particle moves through a porous material.
Input:
- PassThroughUDF_ParticleData struct
- double[] array containing the material parameters of the filter material at the particle position as entered in the FilterDict dialog. This array has as many entries as defined in the udf_numberOfMaterialParameters function
Return value: The probability that the particle moves from the previous position to the current position without being filtered. A result of 1.0 means that a particle will always pass through, and a result of 0.0 means that a particle will always be filtered inside the material.
Example: the example file PassThroughUDF.cpp
|
GeoDict passes the relevant data to these functions with help of the struct PassThroughUDF_ParticleData. The struct is defined in the CollisionStructs.h header file which can be found in the include folder.
PassThroughUDF_ParticleData