-
-
April 18, 2024 at 12:37 pmIbrahim AllamSubscriber
Hallo,
 I'm trying to write a udf to model the mass transfer equation indicated in the image below for condensation modelÂ
the porblem is when i press interpret in fluent it gives me an errorÂ
"line 13 parse error
line 14: parse error
line.15: parse error.
line 18: liq: undeclared variable"
here is my UDF codeÂ/* UDF to define a simple mass transfer based on Saturation  Temperature. The "from" phase is the gas and the "to" phase is the  liquid phase  */#include "udf.h"DEFINE_MASS_TRANSFER(Th_conds, cell, thread, from_index,from_species_index, to_index, to_species_index){  real m_lg;  real time_step;  time_step=5e-5;  real T_SAT = 309.15;  Thread *gas = THREAD_SUB_THREAD(thread, from_index);  Thread *liq = THREAD_SUB_THREAD(thread, to_index);  m_lg = 0;  if (C_T(cell, liq) >= T_SAT)   {    m_lg = - (C_R(cell,liq)*C_CP(cell,liq)*(C_T(cell,liq)-T_SAT))/(time_step*C_H(cell,liq));  Â   }     Â  if ((m_lg == 0 ) && (C_T(cell, gas) <= T_SAT))   {    m_lg =  (C_R(cell,gas)*C_CP(cell,gas)*(C_T(cell,liq)-T_SAT))/(time_step*C_H(cell,gas));    }  return (m_lg);} -
April 18, 2024 at 1:50 pmRobForum Moderator
Did you copy (using CTRL+C and CTRL+P) the example from the manual and then adjust that?Â
-
April 18, 2024 at 3:29 pmIbrahim AllamSubscriber
Yes i did thatÂ
-
-
April 18, 2024 at 3:50 pmRobForum Moderator
Open the file in an editor that can show white space characters, and then delete those.Â
-
April 18, 2024 at 5:13 pmIbrahim AllamSubscriber
Â
Hey Rob,
i removed all the whitespaces but it didnt work, and it gave me the same error.
But i came up with a solution ,i make the declarations of the variables in separeated lines and the assignement below them and it worked. I have no idea why ansys interpreter didn't accept the declaration and assignment of the variable in the same line!!
but here is my code in the image below and it has been interpreted sucessfully !Â
-
April 18, 2024 at 5:28 pmIbrahim AllamSubscriber
Â
If you could give me an explanation about what happened exaclty and how interpreter works i would be very grateful
Â
-
-
April 19, 2024 at 10:36 amRobForum Moderator
Interpreter or Compiler? Don't use the former.Â
-
April 21, 2024 at 10:53 am
-
-
April 22, 2024 at 8:38 amRobForum Moderator
Built in compiler uses a bundled CLANG compiler (do NOT use it on Linux) that's in with the Fluent install. Otherwise you're relying on having found & installed all of the correct bits of Microsoft Visual Studio and that's got much harder over the years as the bundles and licence agreements have changed.Â
-
- The topic ‘UDF for mass transfer parse error’ is closed to new replies.
- Non-Intersected faces found for matching interface periodic-walls
- Unburnt Hydrocarbons contour in ANSYS FORTE for sector mesh
- Fluent fails with Intel MPI protocol on 2 nodes
- Help: About the expression of turbulent viscosity in Realizable k-e model
- Cyclone (Stairmand) simulation using RSM
- error udf
- Mass Conservation Issue in Methane Pyrolysis Shock Tube Simulation
- Script Error
- Facing trouble regarding setting up boundary conditions for SOEC Modeling
- UDF, Fluent: Access count of iterations for “Steady Statistics”
-
1416
-
599
-
591
-
565
-
366
© 2025 Copyright ANSYS, Inc. All rights reserved.