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

UDF error mass transfer

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 23, 2023, 07:56
Default UDF error mass transfer
  #1
New Member
 
Italy
Join Date: Apr 2022
Posts: 5
Rep Power: 4
Alessandro_Lamberti is on a distinguished road
Hy everyone, i'm trying to define an udf for mass transfer between a discrete phase and a continous phase.
The udf is defined as follows:
#include "udf.h"

DEFINE_SOURCE(coupled_mass_transfer, cell, thread, from_species_index, to_species_index)
{
real C_bulk, C_interface, mass_transfer_rate;
real Re, Sc, Sh;
real rho, mu, D;
real droplet_diameter, flow_velocity, droplet_velocity;
real vapor_diffusivity;
real **C_vapor_bulk, **C_vapor_interface;
real vapor_transfer_coeff;

rho = C_R(cell, thread);
mu = C_MU_L(cell, thread);
D = mu / rho;
droplet_diameter = C_UDMI(cell, thread, 0);
flow_velocity = C_UDMI(cell, thread, 1);
droplet_velocity = C_UDMI(cell, thread, 2);
Re = rho * (flow_velocity - droplet_velocity) * droplet_diameter / mu;
vapor_diffusivity = 1e-5;

Sc = mu / (rho * vapor_diffusivity);
Sh = 2 + 0.6 * pow(Re, 0.5) * pow(Sc, 1.0/3.0);
vapor_transfer_coeff = Sh * D / droplet_diameter;
C_bulk = C_YI(cell, thread, from_species_index);
C_interface = C_YI(cell, thread, to_species_index);
C_vapor_bulk = C_UDMI_POINTER(cell, thread, 3);
C_vapor_interface = C_UDMI_POINTER(cell, thread, 4);
mass_transfer_rate = vapor_transfer_coeff * rho * (**C_vapor_bulk - **C_vapor_interface);

source = -mass_transfer_rate;

return mass_transfer_rate;
}

but when i compile it on fluent it says line 25: non-integer subscript expression: pointer to float.

can anyone help me?
Thanks
Alessandro_Lamberti is offline   Reply With Quote

Reply


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
Foam::error::PrintStack almir OpenFOAM Running, Solving & CFD 92 May 21, 2024 08:56
Problems with Saturation Temperature UDF and mass transfer UDF SteffenBcfd Fluent UDF and Scheme Programming 12 February 4, 2024 08:43
Accessing phase interaction mass transfer rate in UDF ahmadimo Fluent UDF and Scheme Programming 1 October 7, 2021 00:08
Mass transfer UDF expecting void return Quinos Fluent UDF and Scheme Programming 0 January 8, 2014 19:36
Error finding variable "THERMX" sunilpatil CFX 8 April 26, 2013 08:00


All times are GMT -4. The time now is 18:13.