CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

Two different UDfs in the same study

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 27, 2018, 10:18
Default Two different UDfs in the same study
  #1
New Member
 
Pedro Jesus Sanchez
Join Date: Aug 2018
Posts: 27
Rep Power: 7
p52sarup is on a distinguished road
Is it possible to use two different UDFs in the same study?

I want using a UDF to inlet and other UDF in outlet.

If possible, they could tell me what procedure to follow?

thank
p52sarup is offline   Reply With Quote

Old   August 27, 2018, 10:52
Default
  #2
Member
 
Refik
Join Date: Dec 2014
Location: Turkey
Posts: 53
Rep Power: 11
rewol is on a distinguished road
It is possible. Just place two UDF codes inside a single file and compile.
rewol is offline   Reply With Quote

Old   August 27, 2018, 11:01
Default
  #3
New Member
 
Pedro Jesus Sanchez
Join Date: Aug 2018
Posts: 27
Rep Power: 7
p52sarup is on a distinguished road
Is this way? two define_profile?

#include "udf.h"

DEFINE_PROFILE(unsteady_pressure, thread, position)
{
face_t f;
real t = CURRENT_TIME;

begin_f_loop(f, thread)
{
F_PROFILE(f, thread, position)= 103300 + 500*t;
}
end_f_loop(f, thread)
}



DEFINE_PROFILE(tm_pout2, t, nv)
{
face_t f ;

real flow_time = RP_Get_Real("flow-time");

if (flow_time < 5 )
{
printf("Time = %f sec. \n",flow_time);
printf("Targeted mass-flow rate set at 0.01 kg/s \n");

begin_f_loop(f,t)
{
F_PROFILE(f,t,nv) = 0.01 ;
}
end_f_loop(f,t)
}
else
{
printf("Time = %f sec. \n",flow_time);
printf("Targeted mass-flow rate set at 0.5 kg/s \n") ;


begin_f_loop(f,t)
{
F_PROFILE(f,t,nv) = 0.5 ;
}
end_f_loop(f,t)
}


UDF/compiled/sources files/add..... and push build

finally push LOAD

is this correct?

i have a problem:

Opening library "C:\Users\p52sa\Desktop\Ansys\prueba1_files\dp0\FL U-9\Fluent\libudf"...RPC RCX_SC_SET_ERR_MSG failed: RPC: Can't encode arguments

Warning: C:/Users/p52sa/Desktop/Ansys/prueba1_files/dp0/flujo variable a los 5 seg.c(10): unknown escape: "\ ".
Warning: C:/Users/p52sa/Desktop/Ansys/prueba1_files/dp0/flujo variable a los 5 seg.c(11): unknown escape: "\ ".

Error at host: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64).

The system can not find the specified file.

C:\Users\p52sa\Desktop\Ansys\prueba1_files\dp0\FLU-9\Fluent\libudf\win64\3ddp_host\libudf.dll

Error at Node 0: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64).

The system can not find the specified file.

Warning: C:/Users/p52sa/AppData/Local/Temp/flujo variable a los 5 seg.c.10932.1.c(10): unknown escape: "\ ".
Warning: C:/Users/p52sa/AppData/Local/Temp/flujo variable a los 5 seg.c.10932.1.c(11): unknown escape: "\ ".

C:\Users\p52sa\Desktop\Ansys\prueba1_files\dp0\FLU-9\Fluent\libudf\win64\3ddp_node\libudf.dll
Error at Node 1: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64).

The system can not find the specified file.

C:\Users\p52sa\Desktop\Ansys\prueba1_files\dp0\FLU-9\Fluent\libudf\win64\3ddp_node\libudf.dll

Error: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64).\n\nEl sistema no puede encontrar el archivo especificado.
\n\nC:\Users\p52sa\Desktop\Ansys\prueba1_files\dp0 \FLU-9\Fluent\libudf\win64\3ddp_host\libudf.dll
Error Object: #f
p52sarup is offline   Reply With Quote

Old   August 27, 2018, 11:10
Default
  #4
Member
 
Refik
Join Date: Dec 2014
Location: Turkey
Posts: 53
Rep Power: 11
rewol is on a distinguished road
I did not check your coding but yes, that is the logic. Although you have to choose them once you open the interface.

As for your problem, you have a problem regarding the compilation for which the solution is provided in other sections in detail, you should check it. When i have to use UDF, i always start fluent from command prompt and compile, not from the workbench file. You should have visual studio installed on your PC with cross platform extension, i think.

Good luck.
rewol is offline   Reply With Quote

Old   August 27, 2018, 12:38
Default
  #5
New Member
 
Pedro Jesus Sanchez
Join Date: Aug 2018
Posts: 27
Rep Power: 7
p52sarup is on a distinguished road
Ok thank.

I am using interpreted in this moment.

What is the difference?
p52sarup is offline   Reply With Quote

Old   August 27, 2018, 21:08
Default
  #6
Senior Member
 
Join Date: Aug 2011
Posts: 421
Blog Entries: 1
Rep Power: 21
blackmask will become famous soon enough
Please do not use any space in your directory/file naming. Sometimes it leads to annoying errors. Not all functions are available in interpreted UDF, some are only available for compiled UDF. If you do not encounter any error interpreting your UDF source file, it will be fine to use it.
blackmask is offline   Reply With Quote

Old   August 28, 2018, 03:14
Default
  #7
New Member
 
Pedro Jesus Sanchez
Join Date: Aug 2018
Posts: 27
Rep Power: 7
p52sarup is on a distinguished road
At first, when I interpret, ansys does not show any error. The problem is that the system, when push "build", does not create the libudf.dll file. As I said ... it is possible that by not having visual studio problems arise. although I think it should not matter since in the end it's just a .c file.
I dont know, I suprime the space but the problem continúe.
Thank
p52sarup is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[ICEM] Mesh Independence study Carlos Modesto ANSYS Meshing & Geometry 4 July 7, 2017 06:57
grid study, important question hamid1 FLUENT 1 August 4, 2013 00:14
[ANSYS Meshing] grid study, important questions hamid1 ANSYS Meshing & Geometry 2 February 10, 2012 13:28
Unsteady and Flux UDFs for UDSs tom FLUENT 0 February 13, 2009 10:27
Experimental Repository for UDFs, Journal Files and Scheme Scripts Jonas Larsson FLUENT 0 March 5, 2000 15:36


All times are GMT -4. The time now is 01:24.