|
[Sponsors] |
June 23, 2023, 07:56 |
UDF error mass transfer
|
#1 |
New Member
Italy
Join Date: Apr 2022
Posts: 5
Rep Power: 4 |
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 |
|
|
|
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 |