|
[Sponsors] |
April 15, 2024, 19:12 |
Finding Lift force in CG motion UDF
|
#1 |
New Member
badShinchan
Join Date: Apr 2022
Posts: 3
Rep Power: 4 |
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*/ } |
|
Tags |
airfoil 2d, ansys fluent, udf |
|
|
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 16:50 |
Moving mesh | Niklas Wikstrom (Wikstrom) | OpenFOAM Running, Solving & CFD | 122 | June 15, 2014 07:20 |
Urgently Need the code of Lift force and VM force | Kai Yan | Main CFD Forum | 0 | July 16, 2008 08:07 |
UDF error CG Motion | Alex | FLUENT | 0 | March 22, 2006 18:40 |
Saffman Lift Force | CFD MAN | Main CFD Forum | 0 | November 26, 2002 19:26 |