|
[Sponsors] |
March 16, 2019, 08:07 |
Motion with DEFINE_GRID_MOTION
|
#1 |
New Member
Raśl
Join Date: Feb 2017
Posts: 4
Rep Power: 9 |
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! |
|
December 12, 2021, 02:15 |
|
#2 |
New Member
Join Date: Dec 2021
Posts: 1
Rep Power: 0 |
so I'd like to ask you how to deal with this problem? I met a similar problem.thanks
|
|
December 14, 2021, 08:38 |
|
#3 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
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 |
|
|
|
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 |