-
-
July 18, 2023 at 4:15 am
Arun mathew
SubscriberHello,
I am currently working on a basic evaporation-condensation simulation and would appreciate some assistance.
Problem Statement:
I have a chamber that contains a mixture of moist air and water vapor, along with liquid water, all at atmospheric pressure and a relative humidity of 50%. My objective is to simulate the evaporation of the liquid water into the air. To achieve this, I found a suitable user-defined function (UDF) online.
After successfully compiling the UDF, I assigned it to the saturation tab in the evaporation-condensation model.
However, I encountered an error when trying to initialize the simulation, which resulted in the following error message:
Node 0: Process 26224 received signal SIGSEGV.
The FL process could not be started.
I attempted to edit the UDF and run the simulation, suspecting that the error might be related to the following lines in the UDF.
mixture_species_loop(m, sp, i)
{
mf[i] = C_YI(c, pt, i);
}
Could someone please help in resolving this issue?
UDF:
#include "udf.h"
#define MOLAR_MASS_WATER 18.01534 /* g/mol*/
#define MOLAR_MASS_AIR 28.97 /* g/mol*/
#define RHO_WV 0.5542 /* kg/m3*/
#define RHO_AIR 1.225 /* kg/m3*/
DEFINE_PROPERTY(saturation_temp,c,t) /* t: mixture thread, c: cell variable, Cell volume*/
{
real vol = C_VOLUME(c, t);
Thread *pt = THREAD_SUB_THREAD(t, 0); /* Primary phase thread-water*/
Thread *st = THREAD_SUB_THREAD(t, 1);/* Secondary phase thread-air-vapour mixture template*/
real vf_s = C_VOF(c, st); /* Get the volume fraction of secondary phases*/
real vf_p = 1 - vf_s; /* Get the volume fraction of primary phases*/
real p_mix = C_P(c, t); /* Get the pressure of the mixture */
real p_op = RP_Get_Real("operating-pressure"); /* Get the operating pressure*/
real rho_p = C_R(c, pt); /* Primary phase density*/
/* Get mass fractions in primary phase*/
real mf[2]; /*to store mass fractions*/
Material *m = THREAD_MATERIAL(pt);
Material *sp = NULL;
int i; /* Species index - 0 for water vapor and 1 for air+vapour*/
mixture_species_loop(m, sp, i)
{
mf[i] = C_YI(c, pt, i); /*species mass fraction*/
}
real p_w; /* Water vapor pressure for the cell*/
if (vf_s == 1) /* If secondary phase only*/
{
p_w = p_mix + p_op;
}
else /* If primary phase or mixture of phases*/
{
/* Find the partial pressure of water vapour, partial pressure = cell pressure * water mole fraction*/
real m_prim = rho_p * vol * vf_p; /* mass of primary phase in cell*/
real m_wv = mf[0] * m_prim; /* mass of water vapour in cell*/
real m_air = m_prim - m_wv; /* mass of air in cell*/
real N_wv = m_wv / MOLAR_MASS_WATER; /* No of moles in water vapour*/
real N_air = m_air / MOLAR_MASS_AIR; /* No of moles in air*/
real N_total = N_wv + N_air; /* total moles*/
p_w = (C_P(c, t)+ p_op)* (N_wv / N_total); /* water vapour partial pressure*/
}
real t_sat;
t_sat = (1730.63 / (10.196 - log10(p_w))) + 39.724; /* Calculate saturation temperature*/
return t_sat;
}
-
July 19, 2023 at 10:56 am
Atharva Nagarkar
SubscriberHello
SIGSEGV error is returned when there are issues related to storage/memory or data is missing in a place where it needs to be supplied.
The concern here is the macro defined as: Material *m = THREAD_MATERIAL(pt). The THREAD_MATERIAL macro returns a pointer that is associated with a cell thread (t) and NOT a phase thread (pt) as you have defined. Please have a look at the section 2.3.29.3 of the Ansys UDF User Manual for reference related to this and the 'mixture_species_loop' definition as well.
Link: 2.3.29. DEFINE_PROPERTY UDFs (ansys.com)
If you are not able to access the link, please refer to this forum discussion: Using Help with links (ansys.com)
Thanks!
-
July 20, 2023 at 7:54 am
Arun mathew
SubscriberThank you for your reply. I greatly appreciate it. It appears that the issue was resolved when the primary and secondary phases were swapped. In the previous setup, the primary phase consisted of water liquid, while the secondary phase was a mixture of air and water vapor.
-
- 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.
- Floating point exception in Fluent
- What are the differences between CFX and Fluent?
- Heat transfer coefficient
- Difference between K-epsilon and K-omega Turbulence Model
- Getting graph and tabular data from result in workbench mechanical
- The solver failed with a non-zero exit code of : 2
- Suppress Fluent to open with GUI while performing in journal file
- Mesh Interfaces in ANSYS FLUENT
- Time Step Size and Courant Number
- error: Received signal SIGSEGV
-
7592
-
4440
-
2953
-
1427
-
1322
© 2023 Copyright ANSYS, Inc. All rights reserved.