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

UDF for y displacement

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 27, 2018, 13:38
Default UDF for y displacement
  #1
Member
 
Mustafa
Join Date: May 2013
Posts: 54
Rep Power: 13
Mohawk is on a distinguished road
Need help


I am working on a Stirling engine , To describe the motion of piston , I have written a UDF for the y displacement or position . Is it correct

* moving piston-CG movement of piston*/

#include "udf.h"

DEFINE_CG_motion(piston,dt,y,time,dtime)
{
real x

y = 0.06869+0.06496 * (sin(3.14*(x-0.22597)/0.54806));

}


regards,
Mohawk is offline   Reply With Quote

Old   December 28, 2018, 00:28
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
It seems, that your code is not correct,
use Ansys FLuent Customization manual for more information
"Dynamic Mesh DEFINE Macros"

best regards
AlexanderZ is offline   Reply With Quote

Old   December 28, 2018, 03:21
Default
  #3
Member
 
Mustafa
Join Date: May 2013
Posts: 54
Rep Power: 13
Mohawk is on a distinguished road
Dear AlexanderZ

could you help me with correction of this udf ?

Regards,
Mohawk is offline   Reply With Quote

Old   December 28, 2018, 09:37
Default
  #4
New Member
 
Join Date: Jun 2018
Posts: 8
Rep Power: 7
RCamp is on a distinguished road
You’re missing some variables such as omega I believe.
RCamp is offline   Reply With Quote

Old   December 28, 2018, 09:40
Default
  #5
New Member
 
Join Date: Jun 2018
Posts: 8
Rep Power: 7
RCamp is on a distinguished road
It should be DEFINE_CG_MOTION(whatever_name, dt,vel, omega, time ,dtime)
RCamp is offline   Reply With Quote

Old   December 28, 2018, 09:53
Default
  #6
New Member
 
Join Date: Jun 2018
Posts: 8
Rep Power: 7
RCamp is on a distinguished road
With that I also believe you should add vector placements. So your y should be vel[1] = whatever. [1] here saying the y direction. Omega should probably be added as well where it would be omega[2]=0.0 and I would probably even have a vel[0]=0.0. This may not be necessary.

Additionally, I do not think Ansys knows what “x” is here. Instead use vel[0] or you may have to look up in the manual what Ansys stores it’s positions as. I am unsure what your x is rather it is velocity or position.

Best,

RCamp
RCamp 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
UDF for vapor pressure anuarun Fluent UDF and Scheme Programming 12 December 24, 2021 10:12
Replicating Scalable Wall Function with a UDF yousefaz FLUENT 0 August 4, 2017 02:30
UDF in Fluent Andrew Fluent UDF and Scheme Programming 5 March 7, 2016 03:38
Displacement of particles with an udf Michael Heim FLUENT 0 July 6, 2004 14:08
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 04:01


All times are GMT -4. The time now is 17:20.