|
[Sponsors] |
![]() |
![]() |
#1 |
New Member
Anuja Vijayan
Join Date: Mar 2017
Location: Thiruvananthapuram
Posts: 23
Rep Power: 10 ![]() |
Hello friends,
I have written the following UDF for changing the vapour density based on mixture domain temperature. I am using a mixture model for simulating two phase flow. While interpretation, it shows line 51: parse error line 52: parse error line 53: undeclared variable rho DEFINE_PROPERTY(Vapour_density,c,t) { Thread *tp; tp = THREAD_SUPER_THREAD(t); /*line 51*/ real T = C_T(c,tp); /*line 52*/ real rho; /*line 53*/ rho = (0.00329*exp(0.19039*T) - 0.05762)*1000000.0; return p_v; } I cannot find any mistake in it. Is it because I have interpreted instead of compilation (it is not likely to be so)? Any help is greatly appreciated. |
|
![]() |
![]() |
![]() |
![]() |
#2 | |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 35 ![]() ![]() |
Quote:
Code:
DEFINE_PROPERTY(Vapour_density,c,t) { Thread *tp; real T = C_T(c,tp); /*line 52*/ real rho; /*line 53*/ tp = THREAD_SUPER_THREAD(t); /*line 51*/ rho = (0.00329*exp(0.19039*T) - 0.05762)*1000000.0; return p_v; } |
||
![]() |
![]() |
![]() |
![]() |
#3 | |
New Member
Anuja Vijayan
Join Date: Mar 2017
Location: Thiruvananthapuram
Posts: 23
Rep Power: 10 ![]() |
Hi Alexanderz,
Quote:
Actually, I think there is no point in changing the density in incompressible formulation (Initially I had similar UDF for vapour pressure and density). I decided to keep it constant for the simulation. So I incorporated the suggested changes in the macro for vapour pressure as follows. DEFINE_PROPERTY(Vapour_pressure,c,t) { Thread *tp; real T = C_T(c,tp); /*line 52*/ real p_v; /*line 53*/ tp = THREAD_SUPER_THREAD(t); /*line 51*/ p_v = (0.00202*exp(T/4.78878) - 0.04038)*1000000.0; return p_v; } One more point is that I do not know whether DEFINE_PROPERTY(Vapour_pressure,c,t) is internally invoked by Fluent the same way as it does for a property as density or viscosity. Or is there a macro specifically for vapour pressure? I could not find one. Anyway, I am running my simulation with the modifications. I will post the result once it is complete. |
||
![]() |
![]() |
![]() |
![]() |
#4 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 35 ![]() ![]() |
Hello!
I do not have experience in multiphase flows simulation. However, I believe that you should choose your UDF functions as a density material property of vapour. Best regards |
|
![]() |
![]() |
![]() |
![]() |
#5 | |
New Member
Anuja Vijayan
Join Date: Mar 2017
Location: Thiruvananthapuram
Posts: 23
Rep Power: 10 ![]() |
Hi AlexanderZ,
Quote:
Fatal error" I will try your second suggestion. I am not quite sure how it is implemented. I will check the manual and then get back to you. |
||
![]() |
![]() |
![]() |
Tags |
parse error, thread_super_thread |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[OpenFOAM] an error in Calculator's equation | immortality | ParaView | 12 | June 29, 2021 00:10 |
error compiling modified applications | yvyan | OpenFOAM Programming & Development | 21 | March 1, 2016 04:53 |
Undeclared Identifier Errof UDF | SteveGoat | Fluent UDF and Scheme Programming | 7 | October 15, 2014 07:11 |
Compile problem | ivanyao | OpenFOAM Running, Solving & CFD | 1 | October 12, 2012 09:31 |
How to install CGNS under windows xp? | lzgwhy | Main CFD Forum | 1 | January 11, 2011 18:44 |