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

Motion with DEFINE_GRID_MOTION

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 16, 2019, 08:07
Default Motion with DEFINE_GRID_MOTION
  #1
New Member
 
Raśl
Join Date: Feb 2017
Posts: 4
Rep Power: 9
LeftCoefficient is on a distinguished road
Hi! I'm trying to define the motion of a thread with DEFINE_GRID_MOTION. The movement of the wall is sinusoidal, and this occurs around a point of equilibrium. Then I need to save de initial coordinates of my thread to use them en the loop in order to update the position of the wall correctly.

Could any one help me??

This is my UDF:

DEFINE_GRID_MOTION(Expansion, domain, dt, time, dtime)
{
Thread *tf = DT_THREAD((Dynamic_Thread *)dt);
face_t f;
Node *v;
real displ;
real NV_VEC(axis);
real NV_VEC(posinit);
real NV_VEC(posupdate);
real A[ND_ND]; /* face area normal vector */
real AMag; /* face area magnitude */
int n;

SET_DEFORMING_THREAD_FLAG(THREAD_T0(tf));

begin_f_loop(f, tf)

{

f_node_loop(f,tf,n)
{

F_AREA(A,f,tf); /*A is a vector, f face index, t thread index */
AMag=NV_MAG(A); /* Face normal vector magnitude*/
A[0]=A[0]/AMag; /* Componente en X del vector unitario */
A[1]=A[1]/AMag; /* Componente en Y del vector unitario */
NV_D(axis, =, A[0], A[1]);

v=F_NODE(f,tf,n);

if (NODE_POS_NEED_UPDATE(v))
{
NODE_POS_UPDATED(v);
displ=0.001*cos(2*M_PI*freq*CURRENT_TIME);
NV_V_VS(NODE_COORD(v), =, posinit, +, axis,*,displ);
Message("\n");
Message("Posicion inicial del nodo %i: %g mm\n",n,NV_MAG(posinit)*1000);
}

}
Update_Face_Metrics(f, tf);
}
end_f_loop(f,tf);
}

In summary, I need to get "posinit" was constant in all the time steps

Thanks in advance!
LeftCoefficient is offline   Reply With Quote

Old   December 12, 2021, 02:15
Default
  #2
New Member
 
Join Date: Dec 2021
Posts: 1
Rep Power: 0
Kimtero is on a distinguished road
so I'd like to ask you how to deal with this problem? I met a similar problem.thanks
Kimtero is offline   Reply With Quote

Old   December 14, 2021, 08:38
Default
  #3
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
Quote:
Originally Posted by Kimtero View Post
so I'd like to ask you how to deal with this problem? I met a similar problem.thanks
if you need help open new thread and explain in detail your problem, attach your code and compilation log
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ 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
sliding mesh problem in CFX Saima CFX 46 September 11, 2021 08:38
How to use "translation" in solidBodyMotionFunction in OpenFOAM rupesh_w OpenFOAM Running, Solving & CFD 5 August 16, 2016 05:27
DFBI Morphing for roll and heave motion Lingfeng Su STAR-CCM+ 0 November 10, 2015 08:08
External management of solid motion (using dynamicmesh) maxou1993 Main CFD Forum 0 July 28, 2015 12:37
Convergence moving mesh lr103476 OpenFOAM Running, Solving & CFD 30 November 19, 2007 15:09


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