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

Help About a UDF setup

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 3, 2024, 20:50
Unhappy Help About a UDF setup
  #1
New Member
 
Jishan Ahmed
Join Date: Feb 2024
Posts: 2
Rep Power: 0
Jishan Ahmed is on a distinguished road
#include "udf.h"
#include "math.h"
#include "sg_udms.h"
#define debye 0.001
#define rhomax 0.0008
#define phimax 5000
#define sigma 0.003
#define rholoc 0.5
enum {
phi,
rho
};
enum {
Ex,
Ey,
Fx,
Fy,
Fm
};

DEFINE_ADJUST(udf_adjust, domain)
{
Thread *t;
cell_t c;
thread_loop_c(t,domain)
{
begin_c_loop(c,t)
{
C_UDMI(c,t,Ex)=-C_UDSI_G(c,t,phi)[0];
C_UDMI(c,t,Ey)=-C_UDSI_G(c,t,phi)[1];
}
end_c_loop(c,t)
}
}

DEFINE_SOURCE(rho_source, c, t, dS, eqn)
{
real source;
source=-pow(debye,-2)*C_UDSI(c,t,rho);
dS[eqn]=-pow(debye,-2);
return source;
}

DEFINE_SOURCE(X_Source, c, t, dS, eqn)
{
real Sourcex;
Sourcex=-rhomax*phimax*C_UDSI(c,t,rho)*C_UDSI_G(c,t,phi)[0];
dS[eqn]=-rhomax*phimax;
C_UDMI(c,t,Fx)=Sourcex;
return Sourcex;
}

DEFINE_SOURCE(Y_Source, c, t, dS, eqn)
{
real Sourcey;
Sourcey=-rhomax*phimax*C_UDSI(c,t,rho)*C_UDSI_G(c,t,phi)[1];
dS[eqn]=-rhomax*phimax;
C_UDMI(c,t,Fy)=Sourcey;
C_UDMI(c,t,Fm)=sqrt(C_UDMI(c,t,Fx)*C_UDMI(c,t,Fx)+ C_UDMI(c,t,Fy)*C_UDMI(c,t,Fy));
return Sourcey;
}

DEFINE_PROFILE(rho_profile,thread,i)
{
float r[3];
float x;
real xloc;
face_t f;
begin_f_loop(f,thread)
{
F_CENTROID(r,f,thread);
xloc = r[0];
F_PROFILE(f,thread,i)=exp(-pow((xloc-rholoc),2)/(2*pow(sigma,2)));
}
end_f_loop(f,thread)
}

this is a udf by
Modeling of Dielectric-Barrier Discharge Actuator
Implementation, validation and generalization of an electrostatic model
A. Bouchmal

how to implement this on an airfoil (noting its cambered profile) study. Specially the changes in cell zone boundary conditions or any other.
I tried my best to my knowledge.
Jishan Ahmed is offline   Reply With Quote

Old   May 31, 2024, 23:45
Default
  #2
New Member
 
Yijun Lu
Join Date: May 2024
Posts: 3
Rep Power: 2
Yijun Lu is on a distinguished road
I met the same problem. I complied the UDF in fluent, but when I define the number of UDM and UDS, which are 5 and 2 respectively, and x, y momentum in the source term, errors occur after calculation and "fluent process cannot be ...".
Yijun Lu is offline   Reply With Quote

Old   June 1, 2024, 14:08
Default
  #3
New Member
 
Jishan Ahmed
Join Date: Feb 2024
Posts: 2
Rep Power: 0
Jishan Ahmed is on a distinguished road
Solved your problem?
Jishan Ahmed is offline   Reply With Quote

Old   June 1, 2024, 21:09
Default
  #4
New Member
 
Yijun Lu
Join Date: May 2024
Posts: 3
Rep Power: 2
Yijun Lu is on a distinguished road
Quote:
Originally Posted by Jishan Ahmed View Post
Solved your problem?
Not yet!

Here are the problems I met.

When I complied this UDF in FLUENT successfully, I take the following steps:

(1) define the numbers of UDM and UDS, which are 5 and 2 respectively.

(2) add the x-momentum and y-mom sources term in cell zone condition

the next step is adding the User scalar 0 and 1 with rho_profile and rho_source, which I cannot be sure.

Then errors occur after clicking calculation

By the way, the author of this UDF uses it to solve the body force of the plasma only, not on airfoil. So may be we can solve the UDF inplementation on plasma firstly, and then on airfoil?
Yijun Lu is offline   Reply With Quote

Reply

Tags
airfoil, plasma actuator, plasma actuator modeling

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 13 June 23, 2024 13:12
[ICEM] Hexa mesh, curve mesh setup, bunching law Anorky ANSYS Meshing & Geometry 4 November 12, 2014 00:27
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 22:14
Help Parallelizing UDF AndresC FLUENT 0 February 25, 2010 15:50
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 04:01


All times are GMT -4. The time now is 18:50.