CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > CFD Freelancers

Doubt regarding UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 4, 2017, 08:48
Default Doubt regarding UDF
  #1
Member
 
Ravi
Join Date: May 2017
Posts: 31
Rep Power: 8
raviramesh10 is on a distinguished road
Hello everyone,

I am simulating the behaviour of the non-Newtonian fluid, Colgate on top of a vibrating membrane of a speaker. I have been working on a UDF to apply on a vibrating membrane, giving it a sinusoidal input velocity, i.e.,
v =v0* cos(pi*x/L)*sin(2*pi*f*t)

Where v0 is the maximum velocity achieved by the vibrating membrane and pi is already defined. f is the input frequency which I have obtained from previous experiments.

#include "udf.h"
#include "dynamesh_tools.h"
#define pi 3.1416
DEFINE_GEOM(plane,domain,dt,position)
{
position[1]=0.001;
}
DEFINE_GRID_MOTION(inlet_y_velocity,d,dt,time,dtim e)
{
Thread *t;
real y[ND_ND];
real x_c;
face_t f;
real v;
Node *w;
int n;
SET_DEFORMING_THREAD_FLAG(THREAD_TO(t));

begin_f_loop(f,t)
{
f_node_loop(f,t)
{
w = F_NODE(f,t,n);
if (NODE_X(v)>0 && NODE_X(v)<0.08 && NODE_Y(v)==0 && NODE_POS_NEED_UPDATE(v))
{
NODE_POS_UPDATED(v);
v=.2*cos((pi*x_c)/.08)*sin(2*pi*120*time);
}
end_f_loop(f,t)
}
}

I would like to know the correction for the errors in the code, as well as suggestions to improve the code.
raviramesh10 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
UDF for vapor pressure anuarun Fluent UDF and Scheme Programming 12 December 24, 2021 10:12
Doubt about real x[ND_ND] declaration in FLUENT udf Abhya Fluent UDF and Scheme Programming 5 March 21, 2013 00:21
parse error while interpreting udf Kristin Fluent UDF and Scheme Programming 3 March 15, 2012 06:43
I need UDF help. S.Whitney FLUENT 0 October 15, 2007 11:29
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 04:01


All times are GMT -4. The time now is 23:09.