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

UDF phase-change at surface

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 28, 2022, 13:35
Exclamation UDF phase-change at surface
  #1
New Member
 
Join Date: Jan 2022
Posts: 1
Rep Power: 0
prebenjs is on a distinguished road
Hi,
I want to implement a a reaction happening at a Wall (surface) where the gas phase (primary phase) changes to a liquid phase (secondary phase). It should be noted that these phases are completely different substances undergoing a "reaction" at the surface.

Reading up on the topic it seems like i must implement a UDF on the surface, much like discussed from this previous post:

How to use a UDF to set the volume fraction in the cells next to a wall?

Containing the UDF:
[CODE #include "udf.h"

DEFINE_ADJUST(remove_air,domain)
{
/* Cut-off volume fraction */
real VOF_limit=0.3; /* Volume fraction limit (of air) */

/* Create the thread pointers for the wall */
Thread *t; /* Mixture level thread */
Thread *t_air; /* Phase level thread */
Thread *t_water; /* Phase level thread */
face_t f; /* Face thread */
cell_t c; /* Cell thread */
domain = Get_Domain(1); /* Get the domain */

/* Set thread id's of wall (from Fluent) and phase domain indices */
int surface_thread_id=12; /* Wall thread id */
host_to_node_int_1(surface_thread_id); /* Pass thread id to nodes */
int phase_domain_index_air = 0; /* Air phase index */
int phase_domain_index_water = 1; /* Water phase index */
host_to_node_int_2(phase_domain_index_air, phase_domain_index_water); /* Pass domain index to nodes */


/* Calculate viscous resistance */
real R_V=0.0;
real volume_fraction_air;
real volume_fraction_water;

/* Node calculations */
#if !RP_HOST
/* Find mixture level thread and phase level threads */
t = Lookup_Thread(domain,surface_thread_id);
t_air = THREAD_SUB_THREAD(t, phase_domain_index_air);
t_water = THREAD_SUB_THREAD(t, phase_domain_index_water);

/* Loop through faces on wall */
begin_f_loop(f,t)
{
if (PRINCIPAL_FACE_P(f,t))
{
/* Get thread for adjacent cell */
c = F_C0(f,t);

volume_fraction_air=C_VOF(c,t_air);
volume_fraction_water=C_VOF(c,t_water);
/* Message("Volume fraction air %f\n", volume_fraction_air); */

if (volume_fraction_air >= 0.38 && volume_fraction_air <= 0.39)
{
Message("Volume fraction air: %f\n", volume_fraction_air);
Message("Volume fraction water: %f\n", volume_fraction_water);
}

R_V -= F_STORAGE_R_N3V(f,t,SV_WALL_SHEAR)[0];
}
}
end_f_loop(f,t)

/* Sum values from nodes */
R_V = PRF_GRSUM1(R_V);
#endif
node_to_host_real_3(R_V, volume_fraction_air, volume_fraction_water);

/* Print variables to validate UDF */
#if !RP_NODE
Message("Viscous force: %f [N]\n", -R_V);
Message("Volume fraction air: %f\n", volume_fraction_air);
Message("Volume fraction water: %f\n", volume_fraction_water);
#endif
}][/CODE]

However, it seems like it wasn't solved completely. Is there anybody who can help we with this?
prebenjs is offline   Reply With Quote

Reply

Tags
multiphase boundary wall, pdf, surface reaction udf


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
Multiphase solvers and non-isothermal phase change erlend_grotle OpenFOAM 1 September 25, 2021 09:48
UDF for phase change N400 Fluent UDF and Scheme Programming 17 March 13, 2019 05:25
[Gmsh] Error : Self intersecting surface mesh, computing intersections & Error : Impossible velan OpenFOAM Meshing & Mesh Conversion 3 October 22, 2015 11:05
[Gmsh] Problem with Gmsh nishant_hull OpenFOAM Meshing & Mesh Conversion 23 August 5, 2015 02:09
udf for phase change ranjit.prakash FLUENT 0 February 26, 2007 10:10


All times are GMT -4. The time now is 23:50.