Define- mass
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. |
Hi mehdi,
Compile your UDF after some iterate and then use it. |
Quote:
Thanks for your reply. But Fram donot run anyway to iterate it. |
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.
|
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 |
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.
|
Thanks alot ag.Mohsen.
|
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 |
Did you install every requirements? Please read this link:
http://www.cfd-online.com/Forums/flu...mpiled-2d.html |
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?? |
Is your UDF in the same place with your case file?
|
Quote:
|
Your UDF must be in the same folder with your case.
I'm sorry, what I said you about Nmake was not correct. |
Thak you Mohsen;
these two files are in the same folder. |
Did you start fluent from visual studio command prompt?
|
yes
i started fluent from VS command prompt 2012. |
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. |
Quote:
no user defined function have been loaded whereas udf loaded completely in compiling step!!!!!!!! Can you solve this problem? |
Excues me another question; Cannot interpret this udf anyway?
|
If I try to compile your code, I see
Code:
test.c Code:
Error: .\test.c: line 5: parse error. |
All times are GMT -4. The time now is 08:08. |