-
-
November 14, 2018 at 6:42 am
vidyadhar.kpm
SubscriberHello All,
I am working on evaporation of a liquid using VOF method.
I have written the following UDF (single file) for simulating mass transfer.
When I press the "Run Calculate ----> calculate" button, after interpretation and initialization, I am facing this problem-
Error: received a fatal signal (Segmentation fault). Error Object: #f
I request you to help me what is wrong in the UDF.
#include "udf.h"
#include "sg_mphase.h"
#define T_SAT 343
#define LAT_HT 339.8e3
#define CON 3.2
DEFINE_ADJUST(my_adjust,d)
{
real source;
Thread *t0;
face_t f;
cell_t c0;
int ID=3; /* 3 IS THE ZONE ID FOR MENISCUS AS SEEN IN BOUNDARY CONDITIONS PANEL*/
/*BELOW MENTIONED IS THE POINTER FOR DOMAIN OF PHASE*/
Domain *domain = Get_Domain (3); /*CHECK WHETHER I HAVE TO SPECIFY 1-MIXTURE OR 2-PRIMARY PHASE OR 3-SECONDARY PHASE.*/
Thread *thread = Lookup_Thread(domain,ID);
begin_f_loop(f,thread)
{
/*TO SELECT ONE LAYER OF CELLS ADJACENT TO MENISCUS*/
c0 = F_C0(f,thread); /*See ADJACENT CELL INDEX*/
t0 = THREAD_T0(thread); /*See ADJACENT CELL THREAD*/
source= 0.002; /*MENTION SOURCE HERE*/;
if(C_T(c0,thread) >= T_SAT)
{
C_UDMI(c0,t0,0)=source;
}
}
end_f_loop(f,thread) /*the semicolon should be present or not check*/
}
DEFINE_MASS_TRANSFER(liq_gas_source,cell,mix_th,fr om_index,from_species_index,to_index,to_species_in dex)
{
real m_lg=0;
Thread *liq=THREAD_SUB_THREAD(mix_th,from_index);
Thread *gas=THREAD_SUB_THREAD(mix_th,to_index);
m_lg=C_UDMI(cell,liq,0);
return (m_lg);
}
-
November 14, 2018 at 7:07 am
DrAmine
Ansys EmployeeAs ANSYS Staff we are not here to debug udfs. But please check if you have defined the UDMI in GUI and verify the ID of the thread you want to pick up: Is it a cell or face zone?
-
November 15, 2018 at 4:59 am
vidyadhar.kpm
SubscriberHello Amine,
Thanks for the reply.
I have defined UDMI in GUI by switching the Number of user defined memory locations to 1. Even then I am facing the error upon pressing calculate button.
Error: received a fatal signal (Segmentation fault).
Error Object: #f
I wanted to pickup the "meniscus" zone which is of the type "interior" as seen in the boundary conditions panel with ID=3. Therefore the 'meniscus' comes under face zone.
I wanted to apply the source terms in one layer of cells adjacent to the "meniscus" in the liquid phase domain. The liquid phase domain is having an ID=3 under "Phases" dialogue box.
Does compilation instead of interpretation of the UDF solve the purpose as somebody has suggested it?
Thanks & Regards,
vidyadhar
-
November 15, 2018 at 6:22 am
DrAmine
Ansys EmployeeCompilation is always Superior to Interpretation. -
November 15, 2018 at 6:26 am
DrAmine
Ansys EmployeeStill not getting it sorted it you can just check for the free surface by checking the gradient of Vof instead of the checking a specific interior which is not always aligned with free surface. -
November 18, 2018 at 2:11 pm
Karthik R
AdministratorHello,
Just to add to Amine's comments, make sure you are initializing the model right. One you initialize and provide data for the initial meniscus location, the udf should start populating the UDMIs correctly. You should be able to go to contour plots and see you UDMI value she there. If you are not seeing these correct, you might want to use fprintf and message statement to debug your UDF.
Also, please check if you are seeing any error messages when you compile and load your UDF.
please let us know what you find.
Thanks.
Best,
Karthik
-
November 19, 2018 at 4:52 am
vidyadhar.kpm
SubscriberHello Karthik,
Thanks for the suggestions.
1) I have initialized the model and patched the required regions with liquid volume fraction 1 in the Fluent GUI panel. Even then I was facing the segmentation fault error.
2) When I compiled the UDF, I am facing the following issues:
Upon clicking the Build Button:
> Copied C:UsersSANTOSHDesktop est/C:UsersSANTOSHDesktop estUDF2_OLD.c to libudfsrc
Creating user_nt.udf file for 2ddp ...
(system "copy "C:PROGRA~1ANSYSI~1v171fluent"fluent17.1.0srcudfmakefile_nt.udf "libudfwin642ddpmakefile" ")
1 file(s) copied.
(chdir "libudf")(chdir "win642ddp")'nmake' is not recognized as an internal or external command,
operable program or batch file.
Done.
Upon clicking Load Button:
Opening library "C:UsersSANTOSHDesktoptestlibudf"...
Error: The UDF library you are trying to load (libudf) is not compiled for 2ddp on the current platform (win64).
The system cannot find the file specified.
C:UsersSANTOSHDesktoptestlibudfwin642ddplibudf.dll
Error: The UDF library you are trying to load (libudf) is not compiled for 2ddp on the current platform (win64).nnThe system cannot find the file specified.
nnC:UsersSANTOSHDesktoptestlibudfwin642ddplibudf.dll
Error Object: #f
3) I think the Lookup_Thread utility needs to be supplied with pointer of mixture domain?
Thanks & Regards,
vidyadhar
-
November 19, 2018 at 6:16 am
DrAmine
Ansys EmployeeDo you have compiler installed and compiler paths set? -
November 19, 2018 at 7:17 am
Keyur Kanade
Ansys EmployeeYou can use following link for downloading visual studio
https://www.visualstudio.com/post-download-vs/?sku=xdesk&clcid=0x409&telem=ga
-
November 24, 2018 at 11:31 am
vidyadhar.kpm
SubscriberHi,
Even after compilation, I am facing the same Segmentation Fault.
I think I have done a mistake in the UDF.
Instead of assigning UDMI at cells next to 'meniscus' which is an interior zone, now I am using the macro sub_domain_loop to apply source term at UDM which is defined at locations where C_VOF is neither zero nor one.
Thanks & Regards,
vidyadhar
-
- You must be logged in to reply to this topic.

Boost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.

Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.

Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- Suppress Fluent to open with GUI while performing in journal file
- Floating point exception in Fluent
- What are the differences between CFX and Fluent?
- Heat transfer coefficient
- Getting graph and tabular data from result in workbench mechanical
- The solver failed with a non-zero exit code of : 2
- Difference between K-epsilon and K-omega Turbulence Model
- Time Step Size and Courant Number
- Mesh Interfaces in ANSYS FLUENT
- error in cfd post
-
2702
-
2138
-
1355
-
1144
-
462
© 2023 Copyright ANSYS, Inc. All rights reserved.