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

UDF to set the particle Z position to its initial Z position

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 3, 2025, 10:56
Default UDF to set the particle Z position to its initial Z position
  #1
New Member
 
Larry
Join Date: Apr 2018
Posts: 2
Rep Power: 0
lmtlmt12@yahoo.com is on a distinguished road
I need to fix the particle position in the Z direction to its initial value. The following is the UDF I tried:

#include "udf.h"
#include "dpm.h"

DEFINE_DPM_SCALAR_UPDATE(fix_particle_z, c, t, initialize, p)
{
if (initialize)
{
TP_USER_REAL(p, 0) = TP_POS(p)[2];
}
else
{
TP_POS(p)[2] = TP_USER_REAL(p, 0);
}
}

The UDF can be compiled without any problem and is called by Fluent, but it seems the particle Z position is not fixed at its initial value. Does anyone know what is wrong with the UDF? Thank you in advance!
lmtlmt12@yahoo.com is offline   Reply With Quote

Reply

Tags
fix particle position, fluent, udf

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
[solidMechanics] Support thread for "Solid Mechanics Solvers added to OpenFOAM Extend" bigphil OpenFOAM CC Toolkits for Fluid-Structure Interaction 686 December 22, 2022 10:10
chtMultiRegionSimpleFoam: maximum number of iterations excedeed. Nkl OpenFOAM Running, Solving & CFD 19 October 10, 2019 03:42
Floating point exception error lpz_michele OpenFOAM Running, Solving & CFD 53 October 19, 2015 03:50
Unstabil Simulation with chtMultiRegionFoam mbay101 OpenFOAM Running, Solving & CFD 13 December 28, 2013 14:12
pisoFoam with k-epsilon turb blows up - Some questions Heroic OpenFOAM Running, Solving & CFD 26 December 17, 2012 04:34


All times are GMT -4. The time now is 01:12.