Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
EXAMPLE 55
HOW TO USE USER DEFINED FUNCTIONS
DESCRIPTION
The objective of this example is to illustrate how interpreted UDF’s can be used within
Polyflow for boundary condition. User Defined Functions which are documented in Chap.
23 of the Polyflow User’s Manual, and must be written using the CLIPS interpreter.
We base our example on the fourth Polyflow example, i.e. Planar die swell flow of a
Newtonian liquid.
As in example 4, the flow geometry, the fluid model and the boundary conditions are the
same as in example 4. Simply, one focus on the use of the UDF in order to impose the normal
velocity component along the inlet section. One impose a fully developed velocity profile
corresponding to the flow rate equal to 1 :
Vn = −1.5 * (1 - x 2 )
KEYWORDS
FILENAMES
POLYDATA SESSION
Note 1
This procedure requires that you program an external CLIPS function named inlet_vn in
a separate file that we name swell_udf.clp (the name is arbitrary). Our function is the
following:
RUNNING POLYFLOW
In the case UDF’s are being used, Polyflow needs to be informed of the file that contains the
CLIPS code. For this, use the –f option on the command line.
The solution is the same as example 4. As you can see in the listing file, the UDF for boundary
condition is call only once time for each node of the inlet section. This is why the CPU time is
not affected by the UDF for boundary condition.