|
[Sponsors] |
November 13, 2013, 23:38 |
Define- mass
|
#1 |
Member
mehdimoradi
Join Date: Jun 2013
Posts: 53
Rep Power: 13 |
Hello;
Recently I have been used below UDF(that exist in UDF manual) for definition of mass transfer in eulerian fram. udf interpreted and hooked successfully but when initializing appear followed error: Why??? /* UDF to define a simple mass transfer based on Saturation
Temperature. The "from" phase is the gas and the "to" phase is the liquid phase */ #include "udf.h" DEFINE_MASS_TRANSFER(liq_gas_source,cell,thread,fr om_index,from_species_index, to_index, to_species_index) { real m_lg; real T_SAT = 373.15; Thread *gas = THREAD_SUB_THREAD(thread, from_index); Thread *liq = THREAD_SUB_THREAD(thread, to_index); m_lg = 0.; if (C_T(cell, liq) >= T_SAT) { m_lg = -0.1*C_VOF(cell,liq)*C_R(cell,liq)* fabs(C_T(cell,liq)-T_SAT)/T_SAT; } if ((m_lg == 0. ) && (C_T(cell, gas) <= T_SAT)) { m_lg = 0.1*C_VOF(cell,gas)*C_R(cell,gas)* fabs(T_SAT-C_T(cell,gas))/T_SAT; } return (m_lg); } Error:Error: FLUENT received fatal signal (ACCESS_VIOLATION) 1. Note exact events leading to error. 2. Save case/data under new name. 3. Exit program and restart to continue. 4. Report error to your distributor. Last edited by mehdimoradi.; November 17, 2013 at 08:56. |
|
November 18, 2013, 05:21 |
|
#2 |
Member
Mohsen
Join Date: Jul 2012
Posts: 49
Rep Power: 14 |
Hi mehdi,
Compile your UDF after some iterate and then use it. |
|
November 18, 2013, 05:45 |
|
#3 |
Member
mehdimoradi
Join Date: Jun 2013
Posts: 53
Rep Power: 13 |
||
November 18, 2013, 07:11 |
|
#4 |
Member
Mohsen
Join Date: Jul 2012
Posts: 49
Rep Power: 14 |
When you don't have any udf, you can run your case without mass source, then you should compile your UDF after some iteration or one time step and solve your problem with mass source. If the fluent don't start the iteration, you have another problem, for example in your boundary condition or initial condition.
|
|
November 18, 2013, 12:27 |
|
#5 |
Member
mehdimoradi
Join Date: Jun 2013
Posts: 53
Rep Power: 13 |
Hi;
Thanks for your complete answer. It may be through interpreting of UDF. because i cannot compile it. Please help me about compilation precedure of a udf. in udf manual sayed about MS visual studio software for compiling of udfs. nonetheless it donot work. what sugestions do you have? thanks |
|
November 18, 2013, 13:43 |
|
#6 |
Member
Mohsen
Join Date: Jul 2012
Posts: 49
Rep Power: 14 |
If you use the Fluent on Windows, at first you should install visual studio for compiling a UDF because it needs the c++ compiler. You'll need another small software that I cannot remember its name, but don't worry, you can find a lot of information about it on this forum and web. You cannot interpret this UDF and you have to compile it.
|
|
November 18, 2013, 14:34 |
|
#7 |
Member
mehdimoradi
Join Date: Jun 2013
Posts: 53
Rep Power: 13 |
Thanks alot ag.Mohsen.
|
|
November 19, 2013, 13:05 |
|
#8 | |
Member
mehdimoradi
Join Date: Jun 2013
Posts: 53
Rep Power: 13 |
Quote:
After reading forum and web, i can not compile udf. it results "error: the udf library you are trying to load(libudf) is not compiled for 2ddp on current platform(ntx86). the system cannot find the file specified." Can you help me to solve this troublous problem? OS is win7 (32bit). thanks |
||
November 19, 2013, 13:38 |
|
#9 |
Member
Mohsen
Join Date: Jul 2012
Posts: 49
Rep Power: 14 |
Did you install every requirements? Please read this link:
http://www.cfd-online.com/Forums/flu...mpiled-2d.html |
|
November 20, 2013, 12:17 |
|
#10 |
Member
mehdimoradi
Join Date: Jun 2013
Posts: 53
Rep Power: 13 |
Hello;
Thanks for your reply. I read all the forums about my problem. But none of them did not help me. I did below stages: 1- Install MS visual studio 2012, SDK , framework. 2- Set environment variables as existed in fluent forums. 3- Open fluent from SDK prompt and or Visual studio prompt. 4- In fluent: file/read/case… and then define/user defined/functions/compiled/add source files/build. It is copied successfully. 5- In building appear the below error: The UDF library you are trying to load (libudf) is not compiled for 2ddp on the curent platform (ntx86). The system cannot find the file specified. C:\program files\ANSYS Inc\v140\fluent tbin tx86\libudf\ntx86\2ddp\libudf.dll this is exactly that error is appeared. Although in my system tbin file is not existed rather ntbin is in sub root. I don’t know why fluent has applied tbin instead of ntib. It is also about tx86(rather ntx86) . Is someone who can help me?? Last edited by mehdimoradi.; November 20, 2013 at 13:45. |
|
November 20, 2013, 14:28 |
|
#11 |
Member
Mohsen
Join Date: Jul 2012
Posts: 49
Rep Power: 14 |
Is your UDF in the same place with your case file?
Last edited by smhosseini; November 20, 2013 at 16:34. |
|
November 20, 2013, 14:54 |
|
#12 |
Member
mehdimoradi
Join Date: Jun 2013
Posts: 53
Rep Power: 13 |
||
November 20, 2013, 16:38 |
|
#13 |
Member
Mohsen
Join Date: Jul 2012
Posts: 49
Rep Power: 14 |
Your UDF must be in the same folder with your case.
I'm sorry, what I said you about Nmake was not correct. |
|
November 21, 2013, 02:07 |
|
#14 |
Member
mehdimoradi
Join Date: Jun 2013
Posts: 53
Rep Power: 13 |
Thak you Mohsen;
these two files are in the same folder. |
|
November 21, 2013, 02:26 |
|
#15 |
Member
Mohsen
Join Date: Jul 2012
Posts: 49
Rep Power: 14 |
Did you start fluent from visual studio command prompt?
|
|
November 21, 2013, 03:51 |
|
#16 |
Member
mehdimoradi
Join Date: Jun 2013
Posts: 53
Rep Power: 13 |
yes
i started fluent from VS command prompt 2012. |
|
November 21, 2013, 11:30 |
|
#17 | ||
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
I see that Fluent looks for
Quote:
Quote:
This has nothing to do with your udf... My best guess is that it has something to do with the installation of fluent. You use a system with dos-based directories (using "\" to separate directory levels), while Fluent thinks you are using a unix-based system (using "/" to separate directory levels). The best thing you can do is contact whoever installed Fluent on your computer. I have no experience in installing Fluent, so my guess may be wrong. |
|||
November 21, 2013, 15:12 |
|
#18 | |
Member
mehdimoradi
Join Date: Jun 2013
Posts: 53
Rep Power: 13 |
Quote:
no user defined function have been loaded whereas udf loaded completely in compiling step!!!!!!!! Can you solve this problem? |
||
November 21, 2013, 15:28 |
|
#19 |
Member
mehdimoradi
Join Date: Jun 2013
Posts: 53
Rep Power: 13 |
Excues me another question; Cannot interpret this udf anyway?
|
|
November 22, 2013, 04:20 |
|
#20 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
If I try to compile your code, I see
Code:
test.c ..\..\src\test.c(5) : error C2146: syntax error : missing ')' before identifier 'om_index' ..\..\src\test.c(5) : error C2061: syntax error : identifier 'om_index' ..\..\src\test.c(5) : error C2059: syntax error : ';' ..\..\src\test.c(5) : error C2059: syntax error : ',' ..\..\src\test.c(5) : error C2059: syntax error : ')' Done. Code:
Error: .\test.c: line 5: parse error. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
mass flow inlet and pressure outlet with target mass flow rate | Zigainer | FLUENT | 13 | October 26, 2018 06:58 |
using define mass transfer udf for cavitation | Komon | Fluent UDF and Scheme Programming | 14 | June 21, 2016 03:50 |
Robin B.C. | Yu | FLUENT | 3 | May 27, 2012 05:19 |
UDF problem | libia87 | Fluent UDF and Scheme Programming | 1 | May 4, 2012 22:49 |
DEFINE MASS TRANSFER | Maciej | FLUENT | 0 | November 27, 2005 21:33 |