February 24, 2022 at 4:41 pmfjulioSubscriber
I am working on the simulation of a heat pipe with non-condensable gases. For that I am using the VOF model with the Lee model for evaporation/condensation, as well as the species transport model to account for gas diffusion of vapor into the NCG-vapor mixture.
I am using a UDF to calculate the partial pressure of vapor in the gas mixture and then find the saturation temperature at each cell, everything goes well, it compiles, hooks, etc. My problem is the simulation runs for one time step, then in the next one when the residuals shoot up, it diverges. The fluids are water (phase-changing) and air (NCG). My gas mixture has water-vapor as the first component.
I am not sure if this is needed, but this is the UDF I am using (adapted from this post: https://forum.ansys.com/discussion/29866/saturation-temperature-udf)
#define MOLAR_MASS_WATER 18.01534 //g/mol
#define MOLAR_MASS_AIR 28.97 // g/mol
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
Thread *st = THREAD_SUB_THREAD(t, 1); // Secondary phase thread
// Get the volume fraction of both phases
real vf_s = C_VOF(c, st);
real vf_p = 1 - vf_s;
// Get the pressure of the mixture
real p_mix = C_P(c, t);
// Get the operating pressure
real p_op = RP_Get_Real("operating-pressure");
// Primary phase density
real rho_p = C_R(c, pt);
// Get mass fractions in primary phase
real mf; // to store mass fractions
Material *m = THREAD_MATERIAL(pt);
Material *sp = NULL;
int i; // Species index - 0 for water vapor and 1 for air
mixture_species_loop(m, sp, i)
mf[i] = C_YI(c, pt, i);
real p_w; // h20 pressure for cell
// If secondary phase only
if (vf_s == 1)
p_w = p_mix + p_op;
// If primary phase or mixture of phases
// Find the partial pressure of water vapour
// partial pressure = cell pressure * water mole fraction
// mass of primary phase in cell
real m_prim = rho_p * vol * vf_p;
// mass of water vapour and air in cell
real m_wv = mf * m_prim;
real m_air = m_prim - m_wv;
// No of moles in water vapour and air
real N_wv = m_wv / MOLAR_MASS_WATER;
real N_air = m_air / MOLAR_MASS_AIR;
real N_total = N_wv + N_air;
// water vapour partial pressure
p_w = (C_P(c, t)+ p_op)* (N_wv / N_total);
// Calculate saturation temperature
t_sat = (1730.63 / (10.196 - log10(p_w))) + 39.724;
}March 1, 2022 at 3:01 pmKarthik RAdministratorHello:
It is very difficult to say why your model is diverging as there may be several reasons for it. How did you set up your model? How are you handling your mass transfer? Can you share some details about your model set up?
March 1, 2022 at 7:57 pmfjulioSubscriberHi Kremella Thanks for your response, I agree this was a lot to take in.
In the meantime I tried rolling the complexity back a little bit and removed the species diffusion to treat it as a simple heat pipe with no NCG (non-condensable gas) and a UDF for saturation temperature as a function of absolute pressure. In this simplified problem I still encountered the same issue, this time I was able to track it to a sudden shift in the absolute pressure, causing it to be negative, I go into detail in this other thread: https://forum.ansys.com/discussion/comment/148781#Comment_148781.
But answering your questions:
this is a heat pipe with water as the phase-changing fluid with air as NCG.
I am using axisymmetric coordinates with evaporator, adiabatic section and condenser.
My boundary conditions are constant temperature in the evaporator wall and convection in the condenser wall.
For the diffusion I am using species diffusion with a mixture-template with species Air and Water-Vapor.
I am using explicit VOF model for multiphase with the air and water-vapor mixture as the primary phase and water-liquid as secondary phase.
For evaporation/condensation I am using the Lee model (from water-liquid to air-vapor mixture H2O component) with constants 0.1 and 181. I am using the UDF mentioned in the original post to track the saturation temperature with respect to partial pressure.
Viewing 2 reply threads
Ansys Innovation Space
- You must be logged in to reply to this topic.
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.
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.Trending discussions
- 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
© 2023 Copyright ANSYS, Inc. All rights reserved.Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.