Fluids

Fluids

Condensation on Droplets UDF

TAGGED: ,

    • Chris Runyan
      Subscriber

      Hello,

      I'm trying to simulate condensation on droplets using a UDF supplied by the ANSYS Fluent UDF Manual at 2.5.13.3 for DEFINE_DPM_SWITCH and I can't seem to get it to compile properly. I have named the file .cpp and put it in the directory where the case and data files live, but everytime I try to compile I get this error:

      "Will now auto-compile UDF library "libudf".
      Copied C:\Users\local_cerunyan\Temp est.tmp est_files\dp0\FLU-3\Fluent/C:\Users\local_cerunyan\Temp est.tmp est_files\dp0\FLU-3\Fluent\condensation.cpp to libudf\src
      (system "copy "C:\PROGRA~1\ANSYSI~1\v222\fluent"\fluent22.2.0\src\udf\sconstruct.udf "libudf\win64\3ddp_host\SConstruct" ")
      1 file(s) copied.
      (system "copy "C:\PROGRA~1\ANSYSI~1\v222\fluent"\fluent22.2.0\src\udf\scons_test.bat "libudf\win64\3ddp_host\scons_test.bat" ")
      1 file(s) copied.
      (chdir "libudf")(chdir "win64\3ddp_host")
      scons: warning: No version of Visual Studio compiler found - C/C++ compilers most likely not set correctly
      File "C:\Users\local_cerunyan\Temp\test.tmp\test_files\dp0\FLU-3\Fluent\libudf\win64\3ddp_host\SConstruct", line 8, in

      scons: warning: No version of Visual Studio compiler found - C/C++ compilers most likely not set correctly
      File "C:\Users\local_cerunyan\Temp\test.tmp\test_files\dp0\FLU-3\Fluent\libudf\win64\3ddp_host\SConstruct", line 18, in
      Compiler used is "C:\PROGRA~1\ANSYSI~1\v222\fluent"\ntbin\clang\bin\clang-cl
      Linker used is "C:\PROGRA~1\ANSYSI~1\v222\fluent"\ntbin\clang\bin\lld-link

      scons: warning: No version of Visual Studio compiler found - C/C++ compilers most likely not set correctly
      File "C:\Users\local_cerunyan\Temp\test.tmp\test_files\dp0\FLU-3\Fluent\libudf\win64\3ddp_host\SConstruct", line 152, in
      Copy("C:\Users\local_cerunyan\Temp\test.tmp\test_files\dp0\FLU-3\Fluent\libudf\win64\3ddp_host\resolve.exe", "C:\PROGRA~1\ANSYSI~1\v222\fluent\ntbin\win64\resolve.exe")
      Copy("C:\Users\local_cerunyan\Temp\test.tmp\test_files\dp0\FLU-3\Fluent\libudf\win64\3ddp_host\condensation.cpp", "C:\Users\local_cerunyan\Temp\test.tmp\test_files\dp0\FLU-3\Fluent\libudf\src\condensation.cpp")
      c_sources ['condensation.cpp', 'udf_names.c']
      c_sources_ ['condensation.cpp']
      (system "copy "C:\PROGRA~1\ANSYSI~1\v222\fluent"\fluent22.2.0\src\udf\sconstruct.udf "libudf\win64\3ddp_node\SConstruct" ")
      1 file(s) copied.
      (system "copy "C:\PROGRA~1\ANSYSI~1\v222\fluent"\fluent22.2.0\src\udf\scons_test.bat "libudf\win64\3ddp_node\scons_test.bat" ")
      1 file(s) copied.
      (chdir "libudf")(chdir "win64\3ddp_node")
      scons: warning: No version of Visual Studio compiler found - C/C++ compilers most likely not set correctly
      File "C:\Users\local_cerunyan\Temp\test.tmp\test_files\dp0\FLU-3\Fluent\libudf\win64\3ddp_node\SConstruct", line 8, in

      scons: warning: No version of Visual Studio compiler found - C/C++ compilers most likely not set correctly
      File "C:\Users\local_cerunyan\Temp\test.tmp\test_files\dp0\FLU-3\Fluent\libudf\win64\3ddp_node\SConstruct", line 18, in
      Compiler used is "C:\PROGRA~1\ANSYSI~1\v222\fluent"\ntbin\clang\bin\clang-cl
      Linker used is "C:\PROGRA~1\ANSYSI~1\v222\fluent"\ntbin\clang\bin\lld-link

      scons: warning: No version of Visual Studio compiler found - C/C++ compilers most likely not set correctly
      File "C:\Users\local_cerunyan\Temp\test.tmp\test_files\dp0\FLU-3\Fluent\libudf\win64\3ddp_node\SConstruct", line 152, in
      Copy("C:\Users\local_cerunyan\Temp\test.tmp\test_files\dp0\FLU-3\Fluent\libudf\win64\3ddp_node\resolve.exe", "C:\PROGRA~1\ANSYSI~1\v222\fluent\ntbin\win64\resolve.exe")
      Copy("C:\Users\local_cerunyan\Temp\test.tmp\test_files\dp0\FLU-3\Fluent\libudf\win64\3ddp_node\condensation.cpp", "C:\Users\local_cerunyan\Temp\test.tmp\test_files\dp0\FLU-3\Fluent\libudf\src\condensation.cpp")
      c_sources ['condensation.cpp', 'udf_names.c']
      c_sources_ ['condensation.cpp']
      In file included from condensation.cpp:6:
      In file included from C:\PROGRA~1\ANSYSI~1\v222\fluent\fluent22.2.0\src\udf\udf.h:24:
      In file included from C:\PROGRA~1\ANSYSI~1\v222\fluent\fluent22.2.0\src\storage\mem.h:329:
      In file included from C:\PROGRA~1\ANSYSI~1\v222\fluent\fluent22.2.0\src\storage/threads.h:226:
      C:\PROGRA~1\ANSYSI~1\v222\fluent\fluent22.2.0\src\bc\profile.h(220,51): warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
      FLUENT_EXPORT void Compute_Min_Max_Profile_Fields(register Input_Profile *, const char *, real *, real *);
      ^~~~~~~~~
      1 warning generated."

      I've tried to install Visual Studio again and all of the plugins, but I've read that I shouldn't need to do this as ANSYS has its own compiler built-in. I've tried this one two different computers and get the same result. Please help! Thank you.

    • DrAmine
      Ansys Employee

      Create the C file and try with the built-in compiler (Select that explicelty to enforce Fluent to just try that). I remember I compiled the condensation template provided in the customization manual several time with the Built-In compiler. Please assess the copied input as there might be issue when copying then pasting the input into the Editor.

    • Chris Runyan
      Subscriber

      I've successfully compiled the code but now am not seeing any condensation on the droplets. I set the water vapor content of the air to .8 to force condensation. I've also set the function hooks up from the UDF to add a source term to the discrete phase, the adjust box in the function hooks tab, and set the condenshumidity law as the first law and hooked the UDF function to the DPM switching. Still I don't see any mass growth on the droplets and it appears that the UDM isn't storing any data (values are zero at all node locations). I'm wondering if the code isn't finding my water material because its not named 'h2o' (h2o is the 'chemical name' and not the species name). I tried to change the || or statement to accept 'water-vapor' as well, since that's the name of my water-vapor material in my air, but it still doesn't work.

    • DrAmine
      Ansys Employee

      The UDF is using the index of h2o_index to get to the gasesous component.

    • DrAmine
      Ansys Employee

      The species name used in the UDF is just the chemical component name.

    • Rob
      Ansys Employee

      The species used in the UDF will be a "number", if vapour is first in the species list in the mixture it'll be zero. 

    • Chris Runyan
      Subscriber

       

      After some debugging it appears the UDF is stopping at this if statement on line 40:
      if ((MATERIAL_TYPE(m) == MATERIAL_MIXTURE) && (FLUID_THREAD_P(t))) meaning the statement isn’t true. It seems like it’s not recognizing the material as a material mixture, but I’m using a mixture (called mixture-template) of h2o and nitrogen in my cell zone conditions and boundary conditions, which Fluent seems to classify as a mixture. I’m suspecting it has something to do with my Multiphase definitions… I have one phase which is called ‘airphase’ that is the ‘mixture-template’ with nitrogen and water-vapor and one phase called ‘waterliquidphase’ that is only liquid water. Am I declaring my materials incorreclty? The droplets material are set to multiphase water-liquid and all volume fraction is liquid water. I chose this instead of droplet injection because when I choose droplets it crashes due to high velocities (courant number exceeds 250).

       

    • Rob
      Ansys Employee

      The carrier phase will be mixture-template (I assume) and handle the gas phase. The droplets are likely to be water-liquid material? 

      The high courant number may mean something is changing too quickly. If you check the results as it's diverging how does the vapour fraction in the gas phase look?

Viewing 7 reply threads
  • You must be logged in to reply to this topic.