Fluids

Fluids

UDF unable to compile

    • Chinchedu
      Subscriber

      Hi Everyone, I'm able to compile User Defined Function(UDF) for varying property using DEFINE_PROPERTY. But when trying to build UDF for source term using DEFINE_SOURCE, then I'm getting an error as "NMAKE: fatal error U1073: don't know how to make '....srcudf' ". And when trying load "Error at host: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64)".

      What could be the reason, please let me know if anyone knows the solution to this problem.

    • Rob
      Ansys Employee
      It means the Visual Studio install didn't go to plan. There's an inbuild Clang compiler in 2020rx and onwards so use that.
    • Chinchedu
      Subscriber
      Thanks Rob. I'm working on phase change (evaporation-condensation) here I have mass and energy source in continuity and energy equation respectively based on saturation temperature using VOF method. And I have written UDF's using SOURCE macro, hooking mass source terms in respective phases under cell zone conditions and energy in mixture phase under cell zone conditions. Now, I got an error as "Node 0: Process 13932: Received signal SIGSEGV. The f1 process could not be started." What does this error mean.
      When I tried simulating only with energy source in mixture phase then it worked properly. I think the problem is with the mass source term.

    • Rob
      Ansys Employee
      Run one time step and then add the UDF. Some of the VOF terms are calculated at the end of the time step so the values you need in the UDF may not exist. Otherwise work through the code to see what you're doing.
    • Chinchedu
      Subscriber
      Thanks Rob, now I'm able run simulations. Actually in my governing equations there are mass and energy source terms. For which I have written Udf's using DEFINE_SOURCE macro for both the mass and energy transfer source terms. And I'm using VOF (Volume of fluid) method. But I'm unable to see any phase interactions between the vapor and liquid.
      My question is only DEFINE_SOURCE macro is sufficient or else do I need any additional Udf's like creating neighbor cell and liquid volume, etc,.
      These are my governing equations:


    • Rob
      Ansys Employee
      The VOF model should take care of the phase interaction. What, and where are you adding the source terms?
    • DrAmine
      Ansys Employee
      VOF model assumes that the sum of phase interaction when it comes to momentum is zero on mixture level (neglecting surface tension effects now) no mass on mixture level and just energy source term to account for latent heat times mdot plus sensitive part as the code is using Tref = 298 K and SS is not taken into account. To avoid all of this: use a dedicated phase change UDF macro where you don't need to take care about all secondary fluxes
    • Chinchedu
      Subscriber
      Hi Rob, I have written Udf's of mass source terms for both liquid and vapor phases separately and adding them to their respective phases under cell zone conditions. Even, wrote Udf for energy source term and added it to the mixture phase in cell zone conditions. Below I'm posting my Udf for liquid mass source term, please check is it correct.


    • Chinchedu
      Subscriber
      Hi DrAmine, Is the example given in Udf manual of DEFINE_MASS_TRANSFER, is it the Lee model? and does it consider the energy transfer due to phase change (i.e. latent heat). Are their any other dedicated phase change UDF macro.
    • Rob
      Ansys Employee
      Looking at the code I won't comment on the amount of source, but the ELSE part of the statement doesn't look to do anything useful. Note, for VOF you need to be very careful that you're adding enough phase into the system as it's not designed to track cells with "some" other phase, VOF is intended to track the free surface.
    • DrAmine
      Ansys Employee
      DEFINE_MASS_TRANSFER does not require from you any additional Energy consideration.
Viewing 10 reply threads
  • You must be logged in to reply to this topic.