-
-
April 3, 2023 at 3:20 pm
Chris Runyan
SubscriberHello,
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. -
April 4, 2023 at 7:01 am
DrAmine
Ansys EmployeeCreate 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.
-
April 4, 2023 at 6:29 pm
Chris Runyan
SubscriberI'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.
-
April 5, 2023 at 3:15 pm
DrAmine
Ansys EmployeeThe UDF is using the index of h2o_index to get to the gasesous component.
-
April 5, 2023 at 3:25 pm
DrAmine
Ansys EmployeeThe species name used in the UDF is just the chemical component name.
-
April 6, 2023 at 9:30 am
Rob
Ansys EmployeeThe species used in the UDF will be a "number", if vapour is first in the species list in the mixture it'll be zero.
-
April 6, 2023 at 9:01 pm
Chris Runyan
SubscriberAfter 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). -
April 11, 2023 at 10:33 am
Rob
Ansys EmployeeThe 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?
-
- You must be logged in to reply to this topic.

Boost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.

Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.

Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- Suppress Fluent to open with GUI while performing in journal file
- Floating point exception in Fluent
- What are the differences between CFX and Fluent?
- Heat transfer coefficient
- Getting graph and tabular data from result in workbench mechanical
- Difference between K-epsilon and K-omega Turbulence Model
- The solver failed with a non-zero exit code of : 2
- Time Step Size and Courant Number
- Mesh Interfaces in ANSYS FLUENT
- error: Received signal SIGSEGV
-
5290
-
3299
-
2469
-
1308
-
1016
© 2023 Copyright ANSYS, Inc. All rights reserved.