|
[Sponsors] |
C_T(c,t) problem while compiling (OK interpreted) |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 27, 2014, 11:35 |
C_T(c,t) problem while compiling (OK interpreted)
|
#1 |
Member
Join Date: Oct 2011
Location: Thessaloniki, Greece
Posts: 75
Rep Power: 15 |
Hello
I am writting an UDF in order to define the viscosity of my fluid Code:
#include "udf.h" real visc; DEFINE_PROPERTY(gas_viscosity,c,t) { real temp = C_T(c,t); visc = function of temp; return visc; } However, when I am compiling the UDF, I am getting, while doing the initialization, the followin error: Code:
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. Error Object: #f So that's might explain the error message. The questions are: 1/ Why C_T(c,t) is giving 0? 2/ Why while interpreting, this is working? Does anyone has some idea about this problem? I've seen a similar post on the forum, but without answer on how to solve this. http://www.cfd-online.com/Forums/flu...violation.html Thanks for any help |
|
January 28, 2014, 04:58 |
|
#3 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
One more remark, that has nothing to do with your current problem, but might otherwise cause problems later on: define your variables local, not global:
Code:
#include "udf.h" DEFINE_PROPERTY(gas_viscosity,c,t) { real visc; real temp = NNULLP(THREAD_STORAGE(t, SV_T)) ? C_T(c,t) : 300 ; visc = function of temp; return visc; } |
|
February 4, 2014, 07:10 |
|
#4 |
Member
Join Date: Oct 2011
Location: Thessaloniki, Greece
Posts: 75
Rep Power: 15 |
Thank you a lot for your answers.
I came to solve my problem, which was I was not compiling my udf with the proper header... a bit silly mistake Thanks again anyway |
|
February 4, 2014, 07:29 |
|
#5 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
It is good that you solved the problem.
But now I am curious: what was the wrong header that you used? Here, you show that you used #include "udf.h", which is I think what it should be. Or are you referring to a different kind of header? I ask it because your answer might help somebody else in the future who has the same problem. |
|
February 4, 2014, 07:48 |
|
#6 |
Member
Join Date: Oct 2011
Location: Thessaloniki, Greece
Posts: 75
Rep Power: 15 |
Hello Pakk
I was referring to another kind of header. (Maybe I am not using the proper terminology) While compiling, you have to refer to the proper library 'fl1400.lib' At first, my compilation was referring to the library found in the folder '../fluent14.0.0/win64/3ddp' while I was not in a double precision When I pointed the '../fluent14.0.0/win64/3d' , everything work well. I don't know if it sounds clear, if not just ask and I'll try to be more precise. |
|
February 4, 2014, 08:16 |
|
#7 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
I think I understand what you mean now. I think you add it in the box called 'header file', but I could be wrong about that.
One thing: in the 'Compiled UDFs' box I never use anything in the 'Header Files' box, I only add 'Source Files'. And udfs compile without problem. (And I would expect that the files you add in 'Header Files' should end in ".h", not in ".lib".) I would think that in a proper installation, Fluent should find the file 'fl1400.lib' automatically. It might mean that some setting in your computer is not what it should be. If it is not a problem for you that you have to add this filename manually every time, it is of course ok. |
|
Tags |
compiled udf, c_t, interpreted udf, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
A Problem of Fluent Interpreted UDF: parse error | knight | Fluent UDF and Scheme Programming | 25 | August 16, 2018 11:26 |
problem with compiling the source code | michel1988 | OpenFOAM Installation | 1 | April 17, 2013 18:19 |
Compiling OpenFoam from git : problem with ld | mborgraeve | OpenFOAM Installation | 33 | November 19, 2012 19:08 |
Compiling problem, sofc module | karim.s.ansari | Fluent UDF and Scheme Programming | 0 | June 19, 2012 13:33 |
[swak4Foam] Problem with compiling funkySetFields | Victor | OpenFOAM Community Contributions | 4 | July 19, 2011 17:34 |