CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Fluent UDF and Scheme Programming

THREAD_SUPER_THREAD macro gives parse error

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   August 25, 2017, 00:59
Default THREAD_SUPER_THREAD macro gives parse error
  #1
New Member
 
Anuja Vijayan
Join Date: Mar 2017
Location: Thiruvananthapuram
Posts: 15
Rep Power: 2
anuarun is on a distinguished road
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.
anuarun is offline   Reply With Quote

Old   August 28, 2017, 01:13
Default
  #2
Member
 
Alexander
Join Date: Apr 2013
Posts: 75
Rep Power: 6
AlexanderZ is on a distinguished road
Quote:
Originally Posted by anuarun View Post
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.
Try this one:

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;
}
Best regards
AlexanderZ is offline   Reply With Quote

Old   August 28, 2017, 08:00
Default
  #3
New Member
 
Anuja Vijayan
Join Date: Mar 2017
Location: Thiruvananthapuram
Posts: 15
Rep Power: 2
anuarun is on a distinguished road
Hi Alexanderz,
Quote:
Originally Posted by AlexanderZ View Post
Try this one:

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;
}
Best regards
Thank you for your suggestion. I have tried this. It is getting interpreted without any problem.
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.
anuarun is offline   Reply With Quote

Old   August 28, 2017, 20:51
Default
  #4
Member
 
Alexander
Join Date: Apr 2013
Posts: 75
Rep Power: 6
AlexanderZ is on a distinguished road
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
AlexanderZ is offline   Reply With Quote

Old   August 29, 2017, 09:14
Default
  #5
New Member
 
Anuja Vijayan
Join Date: Mar 2017
Location: Thiruvananthapuram
Posts: 15
Rep Power: 2
anuarun is on a distinguished road
Hi AlexanderZ,
Quote:
Originally Posted by AlexanderZ View Post
Try this one:

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;
}
Best regards
This one is giving error, "Received signal SIGSEGV.
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.
anuarun is offline   Reply With Quote

Reply

Tags
parse error, thread_super_thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
error compiling modified applications yvyan OpenFOAM Programming & Development 21 March 1, 2016 05:53
Undeclared Identifier Errof UDF SteveGoat Fluent UDF and Scheme Programming 7 October 15, 2014 07:11
an error in Calculator's equation immortality OpenFOAM Paraview & paraFoam 11 September 3, 2013 16:18
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 19:44


All times are GMT -4. The time now is 01:03.