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

transient boundary condition for UDS

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 23, 2015, 07:01
Default transient boundary condition for UDS
  #1
Member
 
Dr. Moloy Kumar Banerjee
Join Date: Jun 2011
Posts: 71
Rep Power: 15
moloykb is on a distinguished road
Dear all,
I am trying to give a voltage input as defined by the square pulse (attached figure), while doing some mhd calculation using electric potential method in Fluent. Could u suggest me how to implement this in the boundary condition panel for the potential value defined by the UDS.
with regards,
Attached Images
File Type: jpg voltage input.jpg (15.6 KB, 34 views)
moloykb is offline   Reply With Quote

Old   April 23, 2015, 07:34
Default
  #2
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
This topic has been covered a number of times, here's a recent thread (less than two weeks old!) which should help get you started: UDF for unsteady velocity inlet.
`e` is offline   Reply With Quote

Old   April 23, 2015, 07:45
Default
  #3
Member
 
Dr. Moloy Kumar Banerjee
Join Date: Jun 2011
Posts: 71
Rep Power: 15
moloykb is on a distinguished road
Thanks for your quick response, but the same UDF I have already used for the definition of velocity but when it comes for the UDS boundary condition it gives the access violation error.
moloykb is offline   Reply With Quote

Old   April 23, 2015, 07:53
Default
  #4
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
Could you provide us further details including your UDF and the error? Have you enabled a sufficient number of User-Defined Scalars?
`e` is offline   Reply With Quote

Old   April 23, 2015, 08:10
Default
  #5
Member
 
Dr. Moloy Kumar Banerjee
Join Date: Jun 2011
Posts: 71
Rep Power: 15
moloykb is on a distinguished road
In fluent when the mhd model is initiated then it automatically load 1 UDS and 42 UDM through predefined UDF, which is automatically hooked during the initialization of the model. The 1st UDS gives the value for electric potential (E) and the 13th UDM gives magnitude of electric field.
So, I just want to define the UDS as a function that I have mentioned before with the following udf, it compiled without any error but once i hook this in the boundary condition panel for the electrode surface, it gives the access violation error.

#include "udf.h"

DEFINE_PROFILE(voltage, t, i)
{
real voltage;
real the_current_time;
face_t f;
cell_t c;

the_current_time = CURRENT_TIME;

if ((the_current_time>=0) && (the_current_time<=.1))
{
C_UDSI(c,t,0)=10;
}
else
{
C_UDSI(c,t,0)=0;
}
if ((the_current_time>=1.) && (the_current_time<=1.1))
{
C_UDSI(c,t,0)=10;
}
else
{
C_UDSI(c,t,0)=0;
}
if ((the_current_time>=2.) && (the_current_time<=2.1))
{
C_UDSI(c,t,0)=10;
}
else
{
C_UDSI(c,t,0)=0;
}

begin_f_loop(f,t)
{
F_PROFILE(f,t,i) = C_UDSI(c,t,0);
}
end_f_loop(f,t)
}


Error:
C:\PROGRA~1\ANSYSI~1\v145\fluent\fluent14.5.0
tx86\3d\fl1450s.exe received fatal signal (ACCESS_VIOLATION)
1. Note exact events leading to error.
2. Save case/data under new name.
3. Exit program and restart to continue.
4. Report error to your distributor.
Error Object: #f
moloykb is offline   Reply With Quote

Old   April 23, 2015, 09:54
Default
  #6
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
Your first two if statements are effectively doing nothing because the third if statement overwrites by setting your electric potential to 10 for time between 2 s and 2.1 s, and an electric potential of zero otherwise.

Why are you trying to set a value to C_UDSI(c,t,0) and then use this value for the F_PROFILE? Use if statements within the face loop and set a value directly, for example:

Code:
if ((the_current_time>=2.) && (the_current_time<=2.1))
    F_PROFILE(f,t,i) = 10.;
else
    F_PROFILE(f,t,i) = 0.;
You're receiving the access violation error because you're attempting to access "c", via C_UDSI(c,t,0), which has no value initialised (you have only declared it with "cell_t c").
`e` is offline   Reply With Quote

Old   April 24, 2015, 02:15
Default
  #7
Member
 
Dr. Moloy Kumar Banerjee
Join Date: Jun 2011
Posts: 71
Rep Power: 15
moloykb is on a distinguished road
Thanks for pointing the error. I have made the follwing correction in the code as mentioned by you.

begin_f_loop(f,t)
{
if ((the_current_time>=0) && (the_current_time<=.1))
F_PROFILE(f,t,i)=10;
else
F_PROFILE(f,t,i)=0;
}
end_f_loop(f,t)
}

but still, the voltage is not becoming zero once the time is>0.1
Attached Images
File Type: jpg Voltage vs time.jpg (45.2 KB, 24 views)
moloykb is offline   Reply With Quote

Old   April 24, 2015, 04:03
Default
  #8
Member
 
Dr. Moloy Kumar Banerjee
Join Date: Jun 2011
Posts: 71
Rep Power: 15
moloykb is on a distinguished road
Please go through the attached figures, which says that the there is no option to enter the udf for the voltage value in the BC panel for the mhd model window (fig.1) and thus it remains unaltered throughout the simulation, irrespective of the UDF entered as in fig.2
Attached Images
File Type: jpg 1-.jpg (45.9 KB, 24 views)
File Type: jpg 2-.jpg (43.7 KB, 28 views)
moloykb is offline   Reply With Quote

Old   April 25, 2015, 22:44
Default
  #9
Member
 
Dr. Moloy Kumar Banerjee
Join Date: Jun 2011
Posts: 71
Rep Power: 15
moloykb is on a distinguished road
Any body working with the mhd module please help me. I desperately need the support from your end.
moloykb is offline   Reply With Quote

Old   April 25, 2017, 17:53
Default
  #10
New Member
 
Yonatan Afework Tesfahunegn
Join Date: Mar 2013
Posts: 15
Rep Power: 13
yona is on a distinguished road
I have the same issue, anyone who has resolved this problem?
yona is offline   Reply With Quote

Old   August 1, 2022, 09:11
Default
  #11
Member
 
sina
Join Date: Nov 2021
Posts: 41
Rep Power: 5
sina_sls is on a distinguished road
Quote:
Originally Posted by moloykb View Post
Any body working with the mhd module please help me. I desperately need the support from your end.
Hello

I want to set sinusoidal value of electric potential (MHD module) for a wall, first i try expression but i faced to error :

Error: wta(2nd) to string_eq

Error Object: __expr__

then i try Profile and UDF profile , but agian i faced to problem , when i use them it consider the wall to insulated.

Could you help me how can i set sinusoidal value for current density ( Electric Potential MHD) ?

Best Regards,
Attached Images
File Type: png UDS b v.png (14.5 KB, 3 views)
sina_sls is offline   Reply With Quote

Old   August 3, 2022, 07:51
Default
  #12
Member
 
sina
Join Date: Nov 2021
Posts: 41
Rep Power: 5
sina_sls is on a distinguished road
Quote:
Originally Posted by `e` View Post
Your first two if statements are effectively doing nothing because the third if statement overwrites by setting your electric potential to 10 for time between 2 s and 2.1 s, and an electric potential of zero otherwise.

Why are you trying to set a value to C_UDSI(c,t,0) and then use this value for the F_PROFILE? Use if statements within the face loop and set a value directly, for example:

Code:
if ((the_current_time>=2.) && (the_current_time<=2.1))
    F_PROFILE(f,t,i) = 10.;
else
    F_PROFILE(f,t,i) = 0.;
You're receiving the access violation error because you're attempting to access "c", via C_UDSI(c,t,0), which has no value initialised (you have only declared it with "cell_t c").
Hello,

How can i change UDS boundary value in a Define Adjust UDF? i mean how can i call UDS boundary value to changing in a UDF of Define Adjust?

Regards,
sina_sls 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
sliding mesh problem in CFX Saima CFX 46 September 11, 2021 08:38
Low Mixing time Problem Mavier CFX 5 April 29, 2013 01:00
External Radiation Boundary Condition for Grid Interface CFD XUE FLUENT 0 July 9, 2010 03:53
External Radiation Boundary Condition (Two sided wall), Grid Interface CFD XUE FLUENT 0 July 8, 2010 07:49
vorticity boundary condition bearcharge Main CFD Forum 0 May 14, 2010 12:32


All times are GMT -4. The time now is 15:56.