|
[Sponsors] |
fatal error during initialization after udf compilation |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 17, 2020, 10:02 |
|
#21 | |
New Member
Join Date: Jul 2014
Posts: 26
Rep Power: 12 |
Quote:
I will read the UDF manual again to find the right function for the problem. I have seen codes in which Define_Profile modifies heat flux or other boundry conditions in terms of time or geometry, but I did not find any example of defining temperature dependent heat flux with this function. I read somewhere that this function cannot define such a boundry condition. Thanks a lot, |
||
February 17, 2020, 10:11 |
Modify
|
#22 |
Senior Member
|
You can modify the following as per your requirement. I am writing it assuming heat flux is dependent upon a coefficient and temperature difference from a reference temperature.
#include "udf.h" #define sCoeff 0.276 /* This and next can also be defined inside the function */ #define sRefTemp 320.0 DEFINE_PROFILE(tBasedHFlux, th, id) { face_t f; begin_f_loop(f,th) { F_PROFILE(f, th, id) = sCoeff * (F_T(f, th) - sRefTemp) } end_f_loop(f,th) } You can apply it on any wall boundary. Actually, the code does not care. You can apply it on inlet, outlet, wherever you want. Do note that the output is not heat flux but a profile of some values. If applied to heat flux boundary, it behaves like heat flux and if applied to temperature, it behaves like temperature. F_T is the temperature of the boundary where this UDF is applied. Fluent provides this value. All values are in SI.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. Last edited by vinerm; February 17, 2020 at 10:38. Reason: Additional Information |
|
February 17, 2020, 11:40 |
|
#23 | |
New Member
Join Date: Jul 2014
Posts: 26
Rep Power: 12 |
Quote:
I do not know how to thank you for the time taking to respond me. I hope you good fortune in the projects to come. Regards, Last edited by Pacific; February 19, 2020 at 03:06. |
||
February 19, 2020, 03:05 |
|
#24 |
New Member
Join Date: Jul 2014
Posts: 26
Rep Power: 12 |
Hi Vinerm,
I tried your code and faced the same error. http://s7.picofile.com/file/83886695..._VIOLATION.JPG I am trying to find the solution for my errors. I found the below pdf file which I think is very useful. https://drive.google.com/file/d/1pQn...ew?usp=sharing Regards, Last edited by Pacific; February 19, 2020 at 05:09. |
|
February 19, 2020, 04:29 |
Error
|
#25 |
Senior Member
|
Where did you hook the code? Was it at a boundary? You seem to be using Fluent 6.3.26. Do note that you need to initialize the case before hooking the UDF.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
February 19, 2020, 05:08 |
|
#26 |
New Member
Join Date: Jul 2014
Posts: 26
Rep Power: 12 |
Dear Vinerm,
The error was solved. Yes, I'm using Fluent 6.3 on Windows XP. Unfortunately, I do not have access to License Manager of Ansys Workbench and, therefore, I should think about mass transfer mechanism for evaporation and condensation phenomenon. However, now that the Access_Violation error has solved and the case has almost completed, I can go somewhere for running on newer version of Ansys Fluent. Again, thank you very much for the time and effort. Regards, |
|
February 19, 2020, 06:08 |
Good
|
#27 |
Senior Member
|
Nice to know that the issue got resolved. But could you also mention how it got resolved so that it could be helpful to others?
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
February 19, 2020, 07:40 |
|
#28 |
New Member
Join Date: Jul 2014
Posts: 26
Rep Power: 12 |
Thanks,
I think the initialization before interpreting the UDF was the solution. I do not know why this can affect ACCESS_VIOLATION error. I wonder whether the first code I used to run (Define_heat_Flux) can also work if I interpret it after initialization. It does not matter anymore, thogh. And finally, can I ask another question? Is it possible to read the temperature of a wall and insert it into another wall's boundary consition in UDF? In other words, we want to define a boundary conditioon that connects the temperature of two walls. How can we define a coupled boundary condition in a single UDF code? By the way, I should thank you again for all your advice. Hope you good fortunes in the projects to come. Regards, |
|
February 19, 2020, 15:43 |
Coupling
|
#29 |
Senior Member
|
Yes, you can read temperature from one boundary and use it to apply some condition at another. It could be same or after some modifications.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
February 19, 2020, 16:07 |
|
#30 |
New Member
Join Date: Jul 2014
Posts: 26
Rep Power: 12 |
That is great.
Thanks, |
|
February 21, 2020, 15:42 |
|
#31 |
New Member
Join Date: Jul 2014
Posts: 26
Rep Power: 12 |
Another question about UDF and Thermoelectric:
I need to define Joul heating as a heat sourse as per: Q = I^2 * R ; I : electriccurrent , R : electric resistance Based on the Fluent UDF manual, I tried to use Define_Source function and apply it to the thermoelectric zone in my case. Since it is not for a wall or boundary condition, I did not use Define_Profile. Here is the UDF: --------------------------------------------------------------------- #include "udf.h" DEFINE_SOURCE(Joule_heating, cell, thread) { real Joule_h,I,R,V; I=5; R=2; V=0.0006; // The volume of TEC per unit depth [m^3/m] Joule_h = R*I*I/V; // Joule heating [W/m^3/m] return Joule_h; } ------------------------------------------------------------------------ I would appreciate it if anyone could let me know whether or not this is true. It should be noted that the code has been successfully interpreted by Fluent. Regards, |
|
February 21, 2020, 16:05 |
UDF and value
|
#32 |
Senior Member
|
The UDF as such is correct, but not needed. Since the value is not changing, you can apply a constant value within the cell zone.
For applying source terms, only DEFINE_SOURCE is applicable, DEFINE_PROFILE cannot be used. However, DEFINE_PROFILE can be used for profiles on boundary as well as cell zones.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
February 21, 2020, 16:12 |
|
#33 |
New Member
Join Date: Jul 2014
Posts: 26
Rep Power: 12 |
Hi Vinerm,
Thank you very much. The amount of heat source might vary versus temperature in my future studies. So I used Define_Source. For example, resistivity of the thermoelectric material might change with temperature. I think I should use "C_T(cell,thread)" to apply tempreature into the code. Regards, |
|
February 21, 2020, 16:21 |
|
#34 | |
New Member
Join Date: Jul 2014
Posts: 26
Rep Power: 12 |
Quote:
Could anybody please inform me whether or not License Manager of Ansys can make problems for another software's License Manager like Amesim? |
||
February 21, 2020, 16:36 |
Temperature
|
#35 |
Senior Member
|
Yes, you can use C_T(cell, thread) to access temperature of a cell.
Newer license managers from Ansys are not based on FlexLM, so, the changes for conflict with others are less. However, if the port required is same, then it could cause trouble. Ansys uses 1055 and 2325. You can modify these in the license file, reread the license file, and then change these at client machine.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
February 21, 2020, 16:40 |
|
#36 |
New Member
Join Date: Jul 2014
Posts: 26
Rep Power: 12 |
Thanks again,
Amesim uses 5053 as I can recall. I have tried to define environment variable as 5053@localhost. But the problem was not solved. By the way, thank you for the time and effort. |
|
February 21, 2020, 16:42 |
Hostname
|
#37 |
Senior Member
|
Sorry, I have no idea about Amesim, however, localhost may not work with any license manager. License service requires the name of the host machine serving the license.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF compilation error | Szabolcs Varga | Fluent UDF and Scheme Programming | 4 | September 14, 2015 06:27 |
UDF compilation problem -- "undeclared variable" | Henrik Ström | FLUENT | 1 | September 21, 2005 06:25 |
error while compiling the USER Sub routine | CFD user | CFX | 3 | November 25, 2002 16:16 |
UDF initialization | Sam | FLUENT | 1 | May 21, 2002 09:23 |
Compiled UDF / Compilation problem | mikhail | FLUENT | 1 | October 13, 2000 07:12 |