-
-
April 18, 2024 at 12:37 pm
Ibrahim Allam
SubscriberHallo,
 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 pm
Rob
Forum ModeratorDid you copy (using CTRL+C and CTRL+P) the example from the manual and then adjust that?Â
-
April 18, 2024 at 3:29 pm
Ibrahim Allam
SubscriberYes i did thatÂ
-
-
April 18, 2024 at 3:50 pm
Rob
Forum ModeratorOpen the file in an editor that can show white space characters, and then delete those.Â
-
April 18, 2024 at 5:13 pm
Ibrahim Allam
SubscriberÂ
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 pm
Ibrahim Allam
SubscriberÂ
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 am
Rob
Forum ModeratorInterpreter or Compiler? Don't use the former.Â
-
April 21, 2024 at 10:53 am
-
-
April 22, 2024 at 8:38 am
Rob
Forum ModeratorBuilt 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.
- How do I get my hands on Ansys Rocky DEM
- Non-Intersected faces found for matching interface periodic-walls
- Unburnt Hydrocarbons contour in ANSYS FORTE for sector mesh
- Help: About the expression of turbulent viscosity in Realizable k-e model
- Script Error
- Facing trouble regarding setting up boundary conditions for SOEC Modeling
- convergence issue for transonic flow
- Running ANSYS Fluent on a HPC Cluster
- Point exception in erosion calculation
- Errors with multi-connected bodies using AQWA
-
1972
-
891
-
599
-
591
-
373
© 2025 Copyright ANSYS, Inc. All rights reserved.