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

UDF for Boundary Condition

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 31, 2022, 05:53
Default UDF for Boundary Condition
  #1
Member
 
sina
Join Date: Nov 2021
Posts: 41
Rep Power: 4
sina_sls is on a distinguished road
Hello,

I want to write UDF for boundary condition (electric potential of wall by using MHD) , the electric potential is sinusoidal , I think , I must use DEFINE_ADJUST and DEFINE_PROFILE but I'm new in UDF and I don't know how to write and couple two DEFINE together, Could someone help me?

Best Regards,
sina_sls is offline   Reply With Quote

Old   July 31, 2022, 12:40
Default
  #2
Member
 
sina
Join Date: Nov 2021
Posts: 41
Rep Power: 4
sina_sls is on a distinguished road
Quote:
Originally Posted by sina_sls View Post
Hello,

I want to write UDF for boundary condition (electric potential of wall by using MHD) , the electric potential is sinusoidal , I think , I must use DEFINE_ADJUST and DEFINE_PROFILE but I'm new in UDF and I don't know how to write and couple two DEFINE together, Could someone help me?

Best Regards,
I attached box picture which show that part i want to use sinusoidal value
Attached Images
File Type: png UDS b v.png (14.5 KB, 11 views)
sina_sls is offline   Reply With Quote

Old   July 31, 2022, 20:34
Default
  #3
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
DEFINE_PROFILE is a way for you

DEFINE_PROFILE and DEFINE_ADJUST are just functions same as in any language -> you may use global variables to communicate between functinos

for some expamles of DEFINE_PROFILE macro you may take a look into
Ansys Fluent Customization manual
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   August 1, 2022, 02:02
Default
  #4
Member
 
sina
Join Date: Nov 2021
Posts: 41
Rep Power: 4
sina_sls is on a distinguished road
Quote:
Originally Posted by AlexanderZ View Post
DEFINE_PROFILE is a way for you

DEFINE_PROFILE and DEFINE_ADJUST are just functions same as in any language -> you may use global variables to communicate between functinos

for some expamles of DEFINE_PROFILE macro you may take a look into
Ansys Fluent Customization manual
Thank you for your response,

I write this code :

#include "udf.h"
#define PI 3.141592654

DEFINE_PROFILE(current_density,thread,position)
{

face_t f;
real t = CURRENT_TIME;

begin_f_loop(f,thread)
{

F_PROFILE(f,thread,position)=13*sin((2*PI/0.04)*t);

end_f_loop(f,thread)
}
}

i want to use it for User Defined Scalar Boundary Value For MHD module, but when i choose it for a wall, fluent consider the wall as insulated , Do you know how can i fix it ?
sina_sls is offline   Reply With Quote

Reply

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
Non-uniform heat flux UDF boundary condition around a cylinder climshwuling FLUENT 0 May 24, 2022 10:20
UDF boundary condition (heat flux), in corrugated area (adjustment factor needed)) JMM_UC3M Fluent UDF and Scheme Programming 0 June 10, 2021 00:57
UDF as a boundary condition msd FLUENT 2 April 7, 2021 07:19
How to setup the wall boundary condition of maxwell_slip_velocity_x_full UDF? ailee0303 Fluent UDF and Scheme Programming 4 January 13, 2021 08:14
write a UDF to give a velocity boundary condition at an interior face Tharanga Fluent UDF and Scheme Programming 19 August 5, 2018 04:29


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