|
[Sponsors] |
March 9, 2021, 00:52 |
Temperature Gradient UDF file not compiling
|
#1 |
New Member
Join Date: Mar 2021
Posts: 15
Rep Power: 5 |
Hello,
I have a 2D spiral geometry and I am trying to calculate the temperature gradient along the wall. I have written a UDF code to calculate it but it is not getting compiled. Can anyone help me out here ? I am attaching my udf file here. Code:
#include "udf.h" DEFINE_ADJUST(tempgrad,d) { Thread *t; cell_t c; face_t f; thread_loop_c(t,domain) { begin_c_loop(c,t) { C_UDSI(c,t,0)=NV_Mag(C_T_G(c,t)); } end_c_loop(c,t) } } DEFINE_ON_DEMAND(store_gradient) { Domain *domain; cell_t c; Thread *t; domain=Get_Domain(1); thread_loop_c (t,domain) { begin_c_loop (c,t) { C_UDMI(c,t,0) = NV_MAG(C_UDSI_G(c,t,0)); } end_c_loop (c,t) } } Last edited by SugarOnichan; March 10, 2021 at 04:36. |
|
March 9, 2021, 02:34 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
What compiler error do you get?
|
|
March 9, 2021, 04:41 |
|
#3 |
New Member
Join Date: Mar 2021
Posts: 15
Rep Power: 5 |
Error: UDF library "libudf" not available at ...
|
|
March 9, 2021, 15:39 |
|
#4 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
That is not the compile error, but the load error. What do you see after you click "build"?
|
|
March 10, 2021, 00:17 |
|
#5 |
New Member
Join Date: Mar 2021
Posts: 15
Rep Power: 5 |
||
March 10, 2021, 02:55 |
|
#6 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
It's saying there is a problem in line 9. It is saying which word is the problem. Look at that!
|
|
March 10, 2021, 03:03 |
|
#7 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
The error you post, does not correspond to the code you posted.
In the code, you use "domian". The error says "domain". Presumably you fixed that already. But the real problem is that you use a word that Fluent does not know. What is domain/domian? It's the first time you use that word, Fluent does not know what you mean. I, as a human, can guess what you mean: earlier you called it "d". But the compiler can not guess that. Use the same name! |
|
March 10, 2021, 04:36 |
|
#8 |
New Member
Join Date: Mar 2021
Posts: 15
Rep Power: 5 |
Actually it was a typing mistake and I have already corrected it after that it is showing me that error.
|
|
March 10, 2021, 09:28 |
|
#9 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
I think you missed the second part of my post.
|
|
March 10, 2021, 12:42 |
|
#10 |
New Member
Join Date: Mar 2021
Posts: 15
Rep Power: 5 |
Code:
#include "udf.h" DEFINE_ADJUST(tempgrad,d) { Thread *t; cell_t c; face_t f; thread_loop_c(t, d) { begin_c_loop(c,t) { C_UDSI(c,t,0)=NV_Mag(C_T_G(c,t)); } end_c_loop(c,t) } } DEFINE_ON_DEMAND(store_gradient) { Domain *d; cell_t c; Thread *t; thread_loop_c (t,d) { begin_c_loop (c,t) { C_UDMI(c,t,0) = NV_MAG(C_UDSI_G(c,t,0)); } end_c_loop (c,t) } } I am still getting following error message : Error: The UDF library you are trying to load (D:\Spiral\Grid Dependency Test-New Geometry\No Of division - 500\2Dv2\2Dv2_files\dp0\FFF\Fluent\libudf) is not compiled for 2ddp on the current platform (win64).\n\nThe system cannot find the file specified. \n\nD:\Spiral\Grid Dependency Test-New Geometry\No Of division - 500\2Dv2\2Dv2_files\dp0\FFF\Fluent\D:\Spiral\Grid Dependency Test-New Geometry\No Of division - 500\2Dv2\2Dv2_files\dp0\FFF\Fluent\libudf\win64\2d dp\libudf.dll Error Object: #f |
|
March 10, 2021, 13:41 |
|
#11 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
You are still looking at the load error. Don't do that. Look at the compile error. It should be just above this.
__________________
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build". |
|
March 10, 2021, 13:43 |
|
#12 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Problem is now probably in your second function : you never initialize domain.
__________________
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build". |
|
March 11, 2021, 00:08 |
|
#13 |
New Member
Join Date: Mar 2021
Posts: 15
Rep Power: 5 |
Code:
#include "udf.h" DEFINE_ADJUST(tempgrad,d) { Thread *t; cell_t c; face_t f; thread_loop_c(t, d) { begin_c_loop(c,t) { C_UDSI(c,t,0)=NV_Mag(C_T_G(c,t)); } end_c_loop(c,t) } } DEFINE_ON_DEMAND(store_gradient) { d = Get_Domain(1); cell_t c; Thread *t; thread_loop_c (t,d) { begin_c_loop (c,t) { C_UDMI(c,t,0) = NV_MAG(C_UDSI_G(c,t,0)); } end_c_loop (c,t) } } |
|
March 11, 2021, 02:23 |
|
#14 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Maybe you don't know where to look. Your earlier screenshot clearly showed a compile error... Above the load error.
__________________
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build". |
|
March 11, 2021, 02:43 |
|
#15 |
New Member
Join Date: Mar 2021
Posts: 15
Rep Power: 5 |
I am sorry but I am not understanding your point. Can you elaborate a little bit ? Here is the image after I click on the build : https://imgur.com/vdroI1S
And Here is the image after I click on the load : https://imgur.com/lpa3IEs And also "Problem is now probably in your second function : you never initialize domain." Did I solve this problem ? Also can you recommend some resources to learn all of this ? |
|
March 11, 2021, 04:21 |
|
#16 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
The compile error is that nmake is not found.
This indicates a problem with fluent installation/configuration, and has nothing to do with your code. Weird, because in your earlier screenshot it worked. Is this on the same computer? I don't have a good advice to learn this... The manual, Google, and this forum...
__________________
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build". |
|
March 11, 2021, 05:53 |
|
#17 |
New Member
Join Date: Mar 2021
Posts: 15
Rep Power: 5 |
No, it is the same computer but I was looking through google and found that I need to install microsoft visual studio. I am not understanding the difference between compile error and load error. Which error I am getting ? and what is the solution of this ?
|
|
March 11, 2021, 05:59 |
|
#18 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
You are getting both.
Your file did not compile, because your compiler was not found. And because it was not compiled, Fluent could not load it. How to solve that: install Fluent properly. I'm no expert on that. Search for the nmake message on this forum.
__________________
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build". |
|
March 12, 2021, 12:10 |
|
#19 |
Member
Yasser Selima
Join Date: Mar 2009
Location: Canada
Posts: 51
Rep Power: 19 |
Post a screenshot of what you get when compiling, not when loading
|
|
March 12, 2021, 12:12 |
|
#20 |
Member
Yasser Selima
Join Date: Mar 2009
Location: Canada
Posts: 51
Rep Power: 19 |
probably the error is here
thread_loop_c(t,domain) make it thread_loop_c(t,d) |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
OpenFoam "Permission denied" and "command not found" problems. | iyidaniel@yahoo.co.uk | OpenFOAM Running, Solving & CFD | 11 | January 2, 2018 07:47 |
Problem compiling a custom Lagrangian library | brbbhatti | OpenFOAM Programming & Development | 2 | July 7, 2014 12:32 |
[swak4Foam] build problem swak4Foam OF 2.2.0 | mcathela | OpenFOAM Community Contributions | 14 | April 23, 2013 14:59 |
friction forces icoFoam | ofslcm | OpenFOAM | 3 | April 7, 2012 11:57 |
"parabolicVelocity" in OpenFoam 2.1.0 ? | sawyer86 | OpenFOAM Running, Solving & CFD | 21 | February 7, 2012 12:44 |