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

VOF pulsating boundary condition UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 4, 2016, 18:47
Default VOF pulsating boundary condition UDF
  #1
New Member
 
Join Date: Nov 2016
Posts: 1
Rep Power: 0
psychobob is on a distinguished road
Hey all!
Im currently attempting to write a udf for a velocity inlet to turn on and off the volume fraction as a function of time (starting on and pulsing every 5 seconds). Ive tried to cobble together a code from other similar things but I am very inexperienced with C and really am unsure what a lot of the macros and such really mean. Below is what I have for the UDF but I get parsing errors when I try to interpret it and "Error: received a fatal signal (Segmentation fault)." when I tried running it at one point. Any help would be great and thanks ahead of time!

#include"udf.h"
DEFINE_PROFILE(volume_fraction, t, mixture_domain)
{
int phase_domain_index;
cell_t cell;
Thread *cell_thread;
Domain *subdomain;
real time;
time = CURRENT_TIME;
sub_domain_loop(subdomain, mixture_domain, phase_domain_index)
{
thread_loop_c(cell_thread,subdomain)
{
begin_c_loop(cell, t)
if (DOMAIN_ID(subdomain) == 2)
{
if((time=>0) && (time<5))
{
C_VOF(cell,time)=1;
}
if((time=>5) && (time<10))
{
C_VOF(cell,time)=0;
}
if((time=>10) && (time<15))
{
C_VOF(cell,time)=1;
}
if((time=>15) && (time<20))
{
C_VOF(cell,time)=0;
}
if((time=>20) && (time<25))
{
C_VOF(cell,time)=1;
}
}
end_c_loop(cell, time)
}
}
}
psychobob is offline   Reply With Quote

Old   November 7, 2016, 16:35
Default
  #2
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
The segmentation fault is caused by your variables which are not initialised (including subdomain, mixture_domain and phase_domain_index). Regardless, you shouldn't need to specify domain and thread loops for boundary UDFs, instead these are applied at a certain boundary from the GUI. Try following the logic of this UDF; note that you can use a conditional statement to alternate between on/off instead of specifying all time periods.
`e` is offline   Reply With Quote

Reply

Tags
transient, udf, vof


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 07:38
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
Basic Nozzle-Expander Design karmavatar CFX 20 March 20, 2016 08:44
Phase-dependent boundary condition for two-phase flow simulation using the VOF method Rui_27 Fluent UDF and Scheme Programming 0 February 4, 2016 11:04
VOF Outlet boundary condition in cfd - ace JM Main CFD Forum 0 December 15, 2006 08:07


All times are GMT -4. The time now is 17:19.