CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > CFX

UDF for particle interception with pt_termination fortran routine

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 23, 2015, 10:52
Default UDF for particle interception with pt_termination fortran routine
  #1
New Member
 
Join Date: Oct 2014
Posts: 24
Rep Power: 11
abcdefgh is on a distinguished road
Hey,

i try to simulate a Filter with a complex geometry. For that I need the Interception of particles. The particles must have a Volume for that (not only being a mass point). The Particle meets the filter a radius before it's mass (middlepoint).This means, that particles get stuck on the filter wall, if they come closer than their radius. I hope you know what I mean.

I think I can realize that with the user fortran routine pt_termination from the Ansys fortran examples.
I first tried it on a sphere (based on a udf here from the forum): thats possible. Here I have die coordinates of the sphere. But for my real geometry I have no coordinates/ can't give it a radius.
Now I had the Idea: can I refer it to the boundary condition of my geometry, The wall of the filter???

For the sphere the code looks:

...
Particle fate : RET(1,1)
C
C Argument variables
C -------------------
C
C Particle mean diameter : ARG(1,1)
C Particle position : ARG(1,2:4)
C Sphere x-position : ARG(1,5)
C Sphere y-position : ARG(1,6)
C Sphere z-position : ARG(1,7)
C
C We know that NLOC is 1 for the particle user source routines!!!!
C================================================= ======================
C
C-----------------------------------------------------------------------
C Calculate the return variables
C-----------------------------------------------------------------------
C
CALL USER_FATE (RET(1,1),ARG(1,1),ARG(1,2),ARG(1,5),ARG(1,6),ARG( 1,7))
C
END

SUBROUTINE USER_FATE (FATE,DIA,PPOS,CPOSX,CPOSY,CPOSZ)
C
C ---------------------------
C Preprocessor includes
C ---------------------------
C
#include "cfd_sysdep.h"
#include "cfd_constants.h"
C
C ------------------------------
C Argument list
C ------------------------------
C
REAL FATE, DIA, PPOS(3), CPOSX, CPOSY, CPOSZ
REAL sphereRAD, PRAD
REAL CONTACT
C
C ------------------------------
C Local variables
C ------------------------------
C
REAL DEAD, ALIVE
C ------------------------------
C Executable statements
C ------------------------------
C
DEAD = 0.
ALIVE = 1.
C
sphereRAD = 0.001
C
C---- Particle starts as alive
C
FATE = ALIVE
C
C---- Calc particle radius
PRAD = ((CPOSX-PPOS(1))**2 + (CPOSY-PPOS(2))**2 + (CPOSZ-PPOS(3))**2)**0.5
CONTACT = sphereRAD - (PRAD - DIA/2.0)
C
C---- Check if user defined criterion was exceeded, stop particle
C --> Set particle mode to __dead__
C
IF (CONTACT.GT.0.0) THEN
FATE = DEAD
ENDIF
C
END





But can I really refer it to the boundary condition. I always get an error. Here is the changed code (the changes are bold):





...
INTEGER NARG, NRET, NLOC
C
CHARACTER*(4) CRESLT
C
REAL ARG(NLOC,NARG), RET(NLOC,NRET)
C
INTEGER IZ(*)
CHARACTER CZ(*)*(1)
DOUBLE PRECISION DZ(*)
LOGICAL LZ(*)
REAL RZ(*)
C
C================================================= ======================
C
C ---------------------------
C Executable Statements
C ---------------------------
C
C================================================= ======================
C
C Return variables:
C -----------------
C
C Particle fate : RET(1,1)
C
C Argument variables
C -------------------
C
C Particle mean diameter : ARG(1,1)
C Particle position : ARG(1,2:4)
C USERREG x-position : ARG(1,5)
C USERREG y-position : ARG(1,6)
C USERREG z-position : ARG(1,7)

C
C We know that NLOC is 1 for the particle user source routines!!!!
C================================================= ======================
C
C-----------------------------------------------------------------------
C Calculate the return variables
C-----------------------------------------------------------------------
C
CALL USER_FATE (RET(1,1),ARG(1,1),ARG(1,2),ARG(1,5),ARG(1,6),ARG( 1,7))
C
END

SUBROUTINE USER_FATE (FATE,DIA,PPOS,CPOSX,CPOSY,CPOSZ)
C
C ---------------------------
C Preprocessor includes
C ---------------------------
C
#include "cfd_sysdep.h"
#include "cfd_constants.h"
C
C ------------------------------
C Argument list
C ------------------------------
C
REAL FATE, DIA, PPOS(3), CPOSX, CPOSY, CPOSZ
REAL USERREG, PRAD
REAL CONTACT
C
C ------------------------------
C Local variables
C ------------------------------
C
REAL DEAD, ALIVE
C ------------------------------
C Executable statements
C ------------------------------
C
DEAD = 0.
ALIVE = 1.

C USERREG = area@Wall
C---- Particle starts as alive
C
FATE = ALIVE
C
C---- Calc particle radius
PRAD = ((CPOSX-PPOS(1))**2 + (CPOSY-PPOS(2))**2 + (CPOSZ-PPOS(3))**2)**0.5
CONTACT = USERREG-(PRAD-DIA/2.0)
C
C---- Check if user defined criterion was exceeded, stop particle
C --> Set particle mode to __dead__
C
IF (CONTACT.GT.0.0) THEN
FATE = DEAD
ENDIF
C
END



Do you know where my mistake is, if it would be possible?

Thank you very much for your help.

Last edited by abcdefgh; July 27, 2015 at 04:42.
abcdefgh is offline   Reply With Quote

Old   July 23, 2015, 11:11
Default
  #2
Senior Member
 
Join Date: Jun 2009
Posts: 1,804
Rep Power: 32
Opaque will become famous soon enough
USERREG is unset, i.e. it is not initialized or evaluated anywhere in the shown code.
Opaque is offline   Reply With Quote

Old   July 23, 2015, 11:17
Default
  #3
New Member
 
Join Date: Oct 2014
Posts: 24
Rep Power: 11
abcdefgh is on a distinguished road
Is that not enough? "USERREG = area@Wall"

What and where would you write? And do you think its possible to refer it to the wall?
abcdefgh is offline   Reply With Quote

Old   July 23, 2015, 11:19
Default
  #4
Senior Member
 
Join Date: Jun 2009
Posts: 1,804
Rep Power: 32
Opaque will become famous soon enough
The line is commented out, and the syntax is invalid anyways.
Opaque is offline   Reply With Quote

Old   July 23, 2015, 11:23
Default
  #5
New Member
 
Join Date: Oct 2014
Posts: 24
Rep Power: 11
abcdefgh is on a distinguished road
Oh yes, you're right. Thank you very much.

hm...how else can I write it? Only 'Wall'...areaAve()@Wall...!?!
I have to say 'wall' is my boundary called in the setup.
abcdefgh is offline   Reply With Quote

Old   July 27, 2015, 04:40
Default
  #6
New Member
 
Join Date: Oct 2014
Posts: 24
Rep Power: 11
abcdefgh is on a distinguished road
I'm Sorry, but I didn't find the solution yet.
How can I write instead of sphereRad (see the part of the user Fortran)

C
DEAD = 0.
ALIVE = 1.
C
sphereRAD = 0.001
C
C---- Particle starts as alive
C
FATE = ALIVE
C
C---- Calc particle radius
PRAD = ((CPOSX-PPOS(1))**2 + (CPOSY-PPOS(2))**2 + (CPOSZ-PPOS(3))**2)**0.5
CONTACT = sphereRAD - (PRAD - DIA/2.0)
C


The Problem is, I have no Geometry like a cylinder, thats why I have no Radius. Is it possible to refer it to the boundary condition, the wall of the Filter? What is a valid syntax for that?
Thank you for your help!
abcdefgh is offline   Reply With Quote

Old   October 6, 2019, 13:30
Default
  #7
New Member
 
surya
Join Date: Jul 2015
Posts: 24
Rep Power: 10
surya.tdr is on a distinguished road
hey,
did you have a udf for interception part?
surya.tdr is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Comparison between C/C++ and Fortran? rick Main CFD Forum 45 September 6, 2011 00:52
Fortran routine for advection-convection equation khan Main CFD Forum 3 May 23, 2007 13:08
Fortran 90 faster than C/C++ B. R. Guirguis Main CFD Forum 48 March 6, 2006 13:49
Particle Injection User Fortran Routine Adam CFX 5 December 13, 2005 03:16
FORTRAN Routine - variable passing Malcolm CFX 1 August 11, 2005 18:51


All times are GMT -4. The time now is 19:09.