I want to define particle injection locations as a function of time. In CFX-Pre, I tried to use a CEL expression but that does not seem to work. So, how can I get around this restriction?


In CFX-Pre, one cannot use CEL expression for particle injection location. However, one can use the Command Editor to enter an expression. Right click Particle Injection Region in the outline tree and select `Edit in Command Editor`. Then in the Command Editor Window, put the CEL expression in the correct location.
However, please note that the CEL expressions can only take purely numeric values and cannot be a function of a solution variable.

To make the particle injection location a function of time, one would need to use particle user FORTRAN routine. There is an example of particle user FORTRAN routine in the /examples folder of the CFX installation folder. Please also check Knowledgebase solution (KBS 686885) which discusses the usage of this example routine.
In order to access time in the particle user FORTRAN routine, one can call PEEK subroutine in the main program of his/her user particle FORTRAN routine. See below for an example:

C-----------------------------------------------------------------------
CGather transient history information
C-----------------------------------------------------------------------
C
C---- Get accumulated timestep info
C
CALL PEEKI('/FLOW/SOLUTION/ATSTEP',IONE,ATSTEP,
& 'STOP',CRESLT,IZ)
CALL PEEKR('/FLOW/SOLUTION/LATEST/ZN1/TIME_DTEND',IONE,TIME,
& 'STOP',CRESLT,RZ)
C
C---- Get the current timestep number and time
C
CALL PEEKI('/FLOW/SOLUTION/NTSTEP',IONE,NTSTEP,
& 'STOP',CRESLT,IZ)
CALL PEEKR('/FLOW/SOLUTION/LATEST/ZN1/'RTIME_DTEND',IONE,RTIME,
& 'STOP',CRESLT,RZ)





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