Tagged: design-point, expressions, fluent, journal-file, profile, udf
-
-
January 3, 2023 at 5:31 pm
sidjou
SubscriberHi Everyone,
I want to automate the simulation of a plate moving normal to a fixed plate. I have one of these two parameters to vary from one calculation to another : the static distance between the 2 plates and the moving signal (amplitude, frequency). I'm wondering which method i have to use between the journal files and the design point.
I have seen that using a motion profile requires me to create a case file for each combination that i want to investigate before defining the journal files. Since I have more than 100 combinations = 100+ cases files to generate, I want to avoid the use of the journal files if possible. Does the motion User-Defined Function enable the use of the design point instead of the journal files?
I'm also investigating the use of expression at the boundary condition to define the motion of the plate. Does it possible to define the plate movement using fluent expressions and avoid motion udf/profil? If yes, does it allow to use a design points to change the amplitude, frequency from one calculation to another? Do you have any idea of how i can simplify this automation?
p.s.: I have already run my model with a motion profile.
Thanks in advance for your insights!
-
January 4, 2023 at 3:46 pm
DrAmine
Ansys EmployeeWith motion profile UDF you are referring to DEFINE_CG_MOTION? In the UDF part you can access Input paramters and so if you can paramterize the input into the UDF you have already that part which you can steer without the need to write 100 of files and to use journal file for that. Regarding the other parameter: distance between the plates: Is it a parameter from the pre-processing? Are you using Fluent Workbench
-
January 5, 2023 at 2:52 am
sidjou
SubscriberI am using Fluent Workbench. I'm not familiar with the definition of the motion of mesh zones with UDF. For my initial runs, i used a .PROF file to define the motion of the plate. Can you recommend me ressources that i can explore to parameterize the input and write the UDF, please? Does it need the use of the designpoints or how does the automation work with your parameterization and UDF idea?
In my pre-processing step, i define (manually) the distance between the plates in my model and run the mesh before updating that to fluent. But i want also to include the plates distance in my automation.
-
-
January 5, 2023 at 2:51 am
sidjou
Subscriber -
January 5, 2023 at 9:25 am
DrAmine
Ansys EmployeeCan the motion be paramterized?
The distance parameter is straightforward and you need just to label that distance as parameter.
-
January 5, 2023 at 12:49 pm
sidjou
SubscriberI don't understand your question "can the motion be parameterized?" I need to parameterize the input amplitude and frequency to change the plate motion from one calculation to another.
To label the distance as parameter, I have to do that in UDF or in which tools?
Please, any ressources that could be useful will be appreciated.
-
-
January 5, 2023 at 1:42 pm
DrAmine
Ansys EmployeeYou understand my question: so if the motion has amplitude and frequency to be parameterized then you can provide these two as input paratmers in Fluent. On the UDF side you can access these two paramters to write your own DEFINE_CG_MOTION.
You do not need to use UDF for the distance: that is a parameter which you will set in SpaceClaim or DesignModeler.
Did you go though the standard Fluent tutorials?
How to access Input Parameters defined in Ansys Fluent in a user defined function: Check the Customization Manual of Ansys Fluent.
-
January 5, 2023 at 2:18 pm
sidjou
SubscriberThanks, i will go through the manual.
For the automation part, do i need a specific tool to run each combination?:
plate Distance | Amplitude | Frequency
D1 A1 F1D2 A2 F2
-
-
January 5, 2023 at 2:35 pm
DrAmine
Ansys EmployeeNo you just deploy the Workbench and create Design Points. You can then update all design points and rely there on Remote Solve Manager if you want to transfer to a queue or something or run locally.
-
January 9, 2023 at 2:57 pm
sidjou
SubscriberA scheme procedure is it mandatory when using input parameters with define_CG_motion, please?
-
-
January 9, 2023 at 4:59 pm
DrAmine
Ansys EmployeeNo you just tell Fluent that you want to use the Input Parameter in UDF and then you can access that as mentioned in the Customization Manual.
-
January 9, 2023 at 7:02 pm
sidjou
SubscriberI'm not able to load the udf.library when using an input parameter. I report the compile console script at the end.
Error: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64).\n\nLe fichier sp�cifi� est introuvable.
\n\nC:\Users\...\TRIAL UDF\Trial UDF input_files\dp0\FLU-1\Fluent\libudf\win64\3ddp_host\libudf.dll
Error Object: #f
I have registered the frequency as the input parameter in fluent. My UDF like :#include "udf.h"/*#define freq 100.0*/#define freq RP_Get_Input_Parameter(“real-1”)#define angular_freq 2.0*M_PI*freq#define amp 0.5DEFINE_CG_MOTION(plate, dt, cg_vel, cg_omega, time, dtime){real disp;disp = amp*angular_freq*cos(angular_freq*time); /*displacement speed*/cg_vel [0] = 0.0;cg_vel [1] = 0.0;cg_vel [2] = disp;cg_omega [0] = 0.0;cg_omega [1] = 0.0;cg_omega [2] = 0.0;}Compiled console script:Copied C:\Users\...\TRIAL UDF\UDF\platetest_input.c to libudf\src
(system "copy "C:\PROGRA~1\ANSYSI~1\v212\fluent"\fluent21.2.0\src\udf\sconstruct.udf "libudf\win64\3ddp_host\SConstruct" ")
1 fichier(s) copi?(s).
(system "copy "C:\PROGRA~1\ANSYSI~1\v212\fluent"\fluent21.2.0\src\udf\scons_default.bat "libudf\win64\3ddp_host\scons_test.bat" ")
1 fichier(s) copi?(s).
Creating user_nt.udf file for 3ddp_host ...
(system "copy "C:\PROGRA~1\ANSYSI~1\v212\fluent"\fluent21.2.0\src\udf\makefile_nt.udf "libudf\win64\3ddp_host\makefile" ")
1 fichier(s) copi?(s).
(chdir "libudf")(chdir "win64\3ddp_host")
C:\Users\...\TRIAL UDF\Trial UDF input_files\dp0\FLU-1\Fluent\libudf\win64\3ddp_host>rem
C:\Users\...\TRIAL UDF\Trial UDF input_files\dp0\FLU-1\Fluent\libudf\win64\3ddp_host>rem Copyright 1987-2021 ANSYS, Inc. All Rights Reserved.
C:\Users\...\TRIAL UDF\Trial UDF input_files\dp0\FLU-1\Fluent\libudf\win64\3ddp_host>rem
'cl.exe' n'est pas reconnu en tant que commande interne
ou externe, un programme ex?cutable ou un fichier de commandes.
'clang-cl' n'est pas reconnu en tant que commande interne
ou externe, un programme ex?cutable ou un fichier de commandes.
scons: Reading SConscript files ...
scons: warning: No version of Visual Studio compiler found - C/C++ compilers most likely not set correctly
File "C:\Users\...\TRIAL UDF\Trial UDF input_files\dp0\FLU-1\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\...\TRIAL UDF\Trial UDF input_files\dp0\FLU-1\Fluent\libudf\win64\3ddp_host\SConstruct", line 18, in
Compiler used is "C:\PROGRA~1\ANSYSI~1\v212\fluent"\ntbin\clang\bin\clang-cl
Linker used is "C:\PROGRA~1\ANSYSI~1\v212\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\...\TRIAL UDF\Trial UDF input_files\dp0\FLU-1\Fluent\libudf\win64\3ddp_host\SConstruct", line 148, in
Copy("C:\Users\...\TRIAL UDF\Trial UDF input_files\dp0\FLU-1\Fluent\libudf\win64\3ddp_host\resolve.exe", "C:\PROGRA~1\ANSYSI~1\v212\fluent\ntbin\win64\resolve.exe")
Copy("C:\Users\...\TRIAL UDF\Trial UDF input_files\dp0\FLU-1\Fluent\libudf\win64\3ddp_host\platetest_input.c", "C:\Users\...\TRIAL UDF\Trial UDF input_files\dp0\FLU-1\Fluent\libudf\src\platetest_input.c")
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 324: character maps to
: File "C:\Users\...\TRIAL UDF\Trial UDF input_files\dp0\FLU-1\Fluent\libudf\win64\3ddp_host\SConstruct", line 172:
generate_udf_source(t,s,env)
File "C:\Users\...\TRIAL UDF\Trial UDF input_files\dp0\FLU-1\Fluent\libudf\win64\3ddp_host\SConstruct", line 87:
for line in f:
File "C:\PROGRA~1\ANSYSI~1\v212\fluent/../commonfiles/CPython/3_7/winx64/Release/python\lib\encodings\cp1252.py", line 23:
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
(system "copy "C:\PROGRA~1\ANSYSI~1\v212\fluent"\fluent21.2.0\src\udf\sconstruct.udf "libudf\win64\3ddp_node\SConstruct" ")
1 fichier(s) copi?(s).
(system "copy "C:\PROGRA~1\ANSYSI~1\v212\fluent"\fluent21.2.0\src\udf\scons_default.bat "libudf\win64\3ddp_node\scons_test.bat" ")
1 fichier(s) copi?(s).
Creating user_nt.udf file for 3ddp_node ...
(system "copy "C:\PROGRA~1\ANSYSI~1\v212\fluent"\fluent21.2.0\src\udf\makefile_nt.udf "libudf\win64\3ddp_node\makefile" ")
1 fichier(s) copi?(s).
(chdir "libudf")(chdir "win64\3ddp_node")
C:\Users\...\TRIAL UDF\Trial UDF input_files\dp0\FLU-1\Fluent\libudf\win64\3ddp_node>rem
C:\Users\...\TRIAL UDF\Trial UDF input_files\dp0\FLU-1\Fluent\libudf\win64\3ddp_node>rem Copyright 1987-2021 ANSYS, Inc. All Rights Reserved.
C:\Users\...\TRIAL UDF\Trial UDF input_files\dp0\FLU-1\Fluent\libudf\win64\3ddp_node>rem
'cl.exe' n'est pas reconnu en tant que commande interne
ou externe, un programme ex?cutable ou un fichier de commandes.
'clang-cl' n'est pas reconnu en tant que commande interne
ou externe, un programme ex?cutable ou un fichier de commandes.
scons: Reading SConscript files ...
scons: warning: No version of Visual Studio compiler found - C/C++ compilers most likely not set correctly
File "C:\Users\...\TRIAL UDF\Trial UDF input_files\dp0\FLU-1\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\...\TRIAL UDF\Trial UDF input_files\dp0\FLU-1\Fluent\libudf\win64\3ddp_node\SConstruct", line 18, in
Compiler used is "C:\PROGRA~1\ANSYSI~1\v212\fluent"\ntbin\clang\bin\clang-cl
Linker used is "C:\PROGRA~1\ANSYSI~1\v212\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\...\TRIAL UDF\Trial UDF input_files\dp0\FLU-1\Fluent\libudf\win64\3ddp_node\SConstruct", line 148, in
Copy("C:\Users\...\TRIAL UDF\Trial UDF input_files\dp0\FLU-1\Fluent\libudf\win64\3ddp_node\resolve.exe", "C:\PROGRA~1\ANSYSI~1\v212\fluent\ntbin\win64\resolve.exe")
Copy("C:\Users\...\TRIAL UDF\Trial UDF input_files\dp0\FLU-1\Fluent\libudf\win64\3ddp_node\platetest_input.c", "C:\Users\...\TRIAL UDF\Trial UDF input_files\dp0\FLU-1\Fluent\libudf\src\platetest_input.c")
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 324: character maps to
: File "C:\Users\...\TRIAL UDF\Trial UDF input_files\dp0\FLU-1\Fluent\libudf\win64\3ddp_node\SConstruct", line 172:
generate_udf_source(t,s,env)
File "C:\Users\...\TRIAL UDF\Trial UDF input_files\dp0\FLU-1\Fluent\libudf\win64\3ddp_node\SConstruct", line 87:
for line in f:
File "C:\PROGRA~1\ANSYSI~1\v212\fluent/../commonfiles/CPython/3_7/winx64/Release/python\lib\encodings\cp1252.py", line 23:
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
Done.
-
-
January 10, 2023 at 9:55 am
DrAmine
Ansys EmployeePlease try first to compile outside of the Workbench and if possible with a more recent Fluent version. (also avoid having spaces in directory names, file names etc..)
-
January 10, 2023 at 10:00 am
DrAmine
Ansys EmployeeNo issues compling your UDF in 22R2 Standalone Ansys Fluent.
-
January 11, 2023 at 3:07 pm
sidjou
SubscriberI have upgraded my fluent version but i still have the same issue.Which version of Visual Studio do you have? Because i notice in the console lines that VS could be the cause of the issue, even though i already have it install.
‘cl.exe’ n’est pas reconnu en tant que commande interne
ou externe, un programme ex?cutable ou un fichier de commandes.
‘clang-cl’ n’est pas reconnu en tant que commande interne
ou externe, un programme ex?cutable ou un fichier de commandes.
scons: warning: No version of Visual Studio compiler found – C/C++ compilers most likely not set correctly
Some people already faced this issue but there is no clear workaround.
-
-
January 11, 2023 at 3:11 pm
DrAmine
Ansys EmployeeI did not experience any issues using the built-in compiler in 22R2. Select that built-in compiler explicelty and try again.
-
January 11, 2023 at 3:29 pm
sidjou
SubscriberThe same issue when using built-in compiler in 22R2.
(system "copy "C:\PROGRA~1\ANSYSI~1\v222\fluent"\fluent22.2.0\src\udf\sconstruct.udf "libudf\win64\3ddp_node\SConstruct" ")
1 fichier(s) copi?(s).
(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 fichier(s) copi?(s).
(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:\...\FLUENT\TRIALUDFINPUT\TrialUDFinput_files\dp0\FLU-1\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:\...\FLUENT\TRIALUDFINPUT\TrialUDFinput_files\dp0\FLU-1\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:\...\FLUENT\TRIALUDFINPUT\TrialUDFinput_files\dp0\FLU-1\Fluent\libudf\win64\3ddp_node\SConstruct", line 152, in
Copy("C:\...\FLUENT\TRIALUDFINPUT\TrialUDFinput_files\dp0\FLU-1\Fluent\libudf\win64\3ddp_node\resolve.exe", "C:\PROGRA~1\ANSYSI~1\v222\fluent\ntbin\win64\resolve.exe")
Copy("C:\...\FLUENT\TRIALUDFINPUT\TrialUDFinput_files\dp0\FLU-1\Fluent\libudf\win64\3ddp_node\platetestinput.c", "C:\...\FLUENT\TRIALUDFINPUT\TrialUDFinput_files\dp0\FLU-1\Fluent\libudf\src\platetestinput.c")
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 324: character maps to
: File "C:\...\FLUENT\TRIALUDFINPUT\TrialUDFinput_files\dp0\FLU-1\Fluent\libudf\win64\3ddp_node\SConstruct", line 176:
generate_udf_source(t,s,env)
File "C:\...\FLUENT\TRIALUDFINPUT\TrialUDFinput_files\dp0\FLU-1\Fluent\libudf\win64\3ddp_node\SConstruct", line 87:
for line in f:
File "C:\PROGRA~1\ANSYSI~1\v222\fluent/../commonfiles/CPython/3_7/winx64/Release/python\lib\encodings\cp1252.py", line 23:
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
Done.
When I click on LOAD
m...: Opening library "C:\...\FLUENT\TRIALUDFINPUT\TrialUDFinput_files\dp0\FLU-1\Fluent\libudf"...
ERROR: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64).
Le fichier sp�cifi� est introuvable.
C:\\...\\FLUENT\\TRIALUDFINPUT\\TrialUDFinput_files\\dp0\\FLU-1\\Fluent\\libudf\\win64\\3ddp_host\\libudf.dll
Done.
-
January 11, 2023 at 3:41 pm
DrAmine
Ansys EmployeeLet me check internally: same UDF on my side using Built-in compiler did work. Perhaps worth checking the format of the UDF.
-
-
-
January 11, 2023 at 3:48 pm
DrAmine
Ansys EmployeeYou can attach the file you are trying to compile here to check its format or it is related to that at all.
-
January 11, 2023 at 4:07 pm
sidjou
SubscriberI am only able to attach an image not a file. So i copy paste my code from Notepad++
#include "udf.h"
#define freq RP_Get_Input_Parameter(“real-1”)
#define angular_freq 2.0*M_PI*freq
#define amp 0.5DEFINE_CG_MOTION(plate, dt, cg_vel, cg_omega, time, dtime)
{
real disp;
disp = amp*angular_freq*cos(angular_freq*time); /*displacement speed*/cg_vel [0] = 0.0;
cg_vel [1] = 0.0;
cg_vel [2] = disp;
cg_omega [0] = 0.0;
cg_omega [1] = 0.0;
cg_omega [2] = 0.0;
}
Thanks for your help!
-
-
January 11, 2023 at 4:20 pm
DrAmine
Ansys EmployeeThat content I can compile as mentioned. Please verify that it has UTF-8 format. if it is case then a more in-depth check of your system / machine might be required.
-
January 11, 2023 at 4:23 pm
DrAmine
Ansys EmployeePass me your university mail adress to share with the version working for me.
-
January 11, 2023 at 4:26 pm
-
January 12, 2023 at 12:51 pm
sidjou
Subscriber
-
-
January 12, 2023 at 3:17 pm
DrAmine
Ansys EmployeeI sent a message.
-
January 13, 2023 at 12:51 pm
sidjou
SubscriberThank you Dr Amine! It is working now.
I have an another question, please. Is it possible to define an input parameter in fluent wich depend of a geometry parameter? For example, i want to define an input parameter amplitude which will be function of the distance between the 2 plate set in the geometry model.-
January 13, 2023 at 2:25 pm
DrAmine
Ansys EmployeeCan you please tell me which setting did help on your side? (That button under Region Settings)?
-
January 13, 2023 at 3:39 pm
-
January 13, 2023 at 2:46 pm
DrAmine
Ansys EmployeeYou can create an Input paramter derived from another parameter in the WB. Best to frist create an input parameter in Ansys Fluent. Then in the WB you say it is for example equal to Input Paramter 1. Now in Fluent with that input you can do whatever you want (you can use it to create inside expression etc..). Please test first in a dummy example if this works for you and your UDF.
-
-
-
January 16, 2023 at 1:42 pm
sidjou
Subscriber-
January 16, 2023 at 2:21 pm
DrAmine
Ansys EmployeeI think you cannot define any input paramters directly for these fields but you can derive the required input via Expression and everytime you are asked to give a value (in TUI for example) you let Ansys Fluent return the value of an Expression (Or RP variable etc..).
-
-
- 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
- The solver failed with a non-zero exit code of : 2
- Difference between K-epsilon and K-omega Turbulence Model
- Time Step Size and Courant Number
- Mesh Interfaces in ANSYS FLUENT
- error in cfd post
-
2706
-
2146
-
1357
-
1144
-
462
© 2023 Copyright ANSYS, Inc. All rights reserved.