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

Beam deflection UDF in 2D

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 8, 2018, 08:24
Default Beam deflection UDF in 2D
  #1
Member
 
Join Date: Aug 2016
Posts: 43
Rep Power: 9
aero_cfd is on a distinguished road
Hi,

I am trying to apply the udf found in the manual for beam deflections in 2D
Code:
/**********************************************************
   node motion based on simple beam deflection equation
   compiled UDF
 **********************************************************/
 #include "udf.h"
 
 DEFINE_GRID_MOTION(beam,domain,dt,time,dtime)
 {
    Thread *tf = DT_THREAD(dt);
    face_t f;
    Node *v;
    real NV_VEC(omega), NV_VEC(axis), NV_VEC(dx);
    real NV_VEC(origin), NV_VEC(rvec);
    real sign;
    int n;
    /* set deforming flag on adjacent cell zone */
    SET_DEFORMING_THREAD_FLAG(THREAD_T0(tf));
    sign = -5.0 * sin (26.178 * time);
    Message ("time = %f, omega = %f\n", time, sign);
    NV_S(omega, =, 0.0);
    NV_D(axis, =, 0.0, 1.0, 0.0);
    NV_D(origin, =, 0.0, 0.0, 0.152);
    begin_f_loop(f,tf)
    {
       f_node_loop(f,tf,n)
       {
        v = F_NODE(f,tf,n);
        /* update node if x position is greater than 0.02    
        and that the current node has not been previously
        visited when looping through previous faces */
        if (NODE_X(v) > 0.020 && NODE_POS_NEED_UPDATE (v))
        {
         /* indicate that node position has been update
         so that it’s not updated more than once */
         NODE_POS_UPDATED(v);
         omega[1] = sign * pow (NODE_X(v)/0.230, 0.5);
         NV_VV(rvec, =, NODE_COORD(v), -, origin);
         NV_CROSS(dx, omega, rvec);
         NV_S(dx, *=, dtime);
         NV_V(NODE_COORD(v), +=, dx);
        }
     }
  }
  end_f_loop(f,tf);
 }
The problem is that the dx is always evaluated as 0 , I tried the code for a 3d case and it gave large random deformations even though I adapted the values .
Attached is the example I am trying to run.

Does anyone know how to solve this ?

thank you !
Attached Images
File Type: jpg beam.JPG (34.2 KB, 38 views)
aero_cfd is offline   Reply With Quote

Reply

Tags
beam, define grid motion, deformation, mesh, udf


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
Dynamic Mesh UDF Qureshi FLUENT 7 March 23, 2017 07:37
Source Term UDF VS Porous Media Model pchoopanya Fluent UDF and Scheme Programming 1 August 28, 2013 06:12
How to add a UDF to a compiled UDF library kim FLUENT 3 October 26, 2011 21:38
comsol cantilever beam problem bhu47 COMSOL 0 June 30, 2008 14:59
UDF...UDF...UDF...UDF Luc SEMINEL FLUENT 0 November 25, 2002 04:03


All times are GMT -4. The time now is 03:40.