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

Finding Lift force in CG motion UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 15, 2024, 18:12
Default Finding Lift force in CG motion UDF
  #1
New Member
 
badShinchan
Join Date: Apr 2022
Posts: 2
Rep Power: 0
nahian_masud is on a distinguished road
Is there any way to find the lift force in CG motion udf? I need to to use in the vertical velocity. Here is the code I have written so far. The 2D airfoil is flapping, so I described a flapping motion. The airfoil has boundary ID of 7. now I use Compute_Force_and_Moment macro to find lift force and use it in the vertical velocity.*
The problem is, it says floating point error after 2 or 3 time steps ( residuals goes super high and simulation stops), but if i dont use the compute force and moment macro, the flapping only works well. I need to find the lift force anyhow to get the transational velocity. can anyone help me please?



#include "udf.h"
DEFINE_CG_MOTION(paperfreq,dt,vel,omega,time,dtime )
{
Thread *t;*
face_t f;
/* get moment or force */
Domain *d = Get_Domain(1); /* for single phase flow*/

Thread *t_object = Lookup_Thread(d, 7); /* you get Boundary_ID from the boundary condition panel in Fluent*/
real force[ND_ND], moment[ND_ND], cg[ND_ND]; /*initialise*/

Compute_Force_And_Moment (d,t_object,cg,force,moment,TRUE);

*/* force components of surface "Boundary_ID" real force_y = force[1];*/

real w,a, pi;*
pi = 3.14159265;*
a = (pi*15)/180; /*pitch amplitude*/*
w = 0.62832; /*angular velocity*/**
/*defining the flapping motion*/*
omega[2]=-a*2*pi*2.97*cos(2*pi*2.97*time); /*pitching motion*/
vel[1]= force[1]*dtime/0.0116;

}

The code above shows the error with very high residuals. But the bottom code works just fine,

#include "udf.h"
DEFINE_CG_MOTION(paperfreq,dt,vel,omega,time,dtime )
{
Thread *t;*
face_t f;
real w,a, pi;*
pi = 3.14159265;*
a = (pi*15)/180; /*pitch amplitude*/*
w = 0.62832; /*angular velocity*/**
/*defining the flapping motion*/*
omega[2]=-a*2*pi*2.97*cos(2*pi*2.97*time); /*pitching motion*/

}
nahian_masud is offline   Reply With Quote

Reply

Tags
airfoil 2d, ansys fluent, 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
Fluent UDF Mesh Motion Issue: Blade Pitch w/ Respect to Azimuth Angle recmvp Fluent UDF and Scheme Programming 0 July 30, 2023 15:50
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
Urgently Need the code of Lift force and VM force Kai Yan Main CFD Forum 0 July 16, 2008 07:07
UDF error CG Motion Alex FLUENT 0 March 22, 2006 17:40
Saffman Lift Force CFD MAN Main CFD Forum 0 November 26, 2002 18:26


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