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

Error in Parallel

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 3, 2015, 14:47
Exclamation Error in Parallel
  #1
Senior Member
 
Join Date: Mar 2013
Location: B'lr
Posts: 130
Rep Power: 13
shivakumar is on a distinguished road
After compiling udf in parallel mode, the error appeared in this manner. In fact, I changed the double to single precision as mentioned in another thread, still getting the same error. How to fix this?

Thanks in advance

================================================== ============================

Node 0: Process 9872: Received signal SIGSEGV.

================================================== ============================

================================================== ============================

Node 1: Process 6252: Received signal SIGSEGV.

================================================== ============================

================================================== ============================

Node 2: Process 3308: Received signal SIGSEGV.

================================================== ============================

================================================== ============================

Node 3: Process 2408: Received signal SIGSEGV.

================================================== ============================

================================================== ============================

Node 4: Process 6792: Received signal SIGSEGV.

================================================== ============================

================================================== ============================

Node 5: Process 9236: Received signal SIGSEGV.

================================================== ============================

================================================== ============================

Node 6: Process 3832: Received signal SIGSEGV.

================================================== ============================

================================================== ============================

Node 7: Process 9096: Received signal SIGSEGV.

================================================== ============================
MPI Application rank 0 exited before MPI_Finalize() with status 2
The fl process could not be started.
shivakumar is offline   Reply With Quote

Old   May 3, 2015, 19:09
Default
  #2
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
Here's an answer about what the SIGSEGV errors represent. If you still can't make sense of your error, perhaps post your UDF code so that we can read it.
`e` is offline   Reply With Quote

Old   May 4, 2015, 01:02
Default
  #3
Senior Member
 
Join Date: Mar 2013
Location: B'lr
Posts: 130
Rep Power: 13
shivakumar is on a distinguished road
Thanks for the link. The error was due to memory allocation. In fact, after allocating the memory also the same error is displaying.
I am working on supersonic flow over a cylinder with sharp edged spike placed at front. from the below code, I am trying to visualize the pattern of shock wave and viscous effects in front of the cylinder. Here is the code. I am attaching the equation as well and the equation in attached file is for 1D flow, my case is 2D. Can you help me?

Code:
#include "udf.h"
#include "mem.h"
#include "sg.h"
#include "math.h"

#define M_infi 1.2
#define a 340.26

DEFINE_ADJUST(sensors,d)
{
	#if PARALLEL
	
	Thread *t;
	cell_t c;
	
	real f_shock, f_viscous;
	real first_term, second_term;
	
	real f_spurious;
	
	f_spurious=0;
	
	d=Get_Domain(1);
	
	thread_loop_c(t,d)
	{
		begin_c_loop(c,t)
		{
			first_term = ( - a / NV_MAG(C_P_G(c,t))) * ( (C_R(c,t) * C_U_G(c,t)[0]) + (C_U(c,t) * C_R_G(c,t)[0]) + (C_R(c,t) * C_V_G(c,t)[1]) + (C_V(c,t) * C_R_G(c,t)[1]) );
			
			second_term =  ( ( (C_U(c,t) * C_P_G(c,t)[0]) * (C_V(c,t) * C_P_G(c,t)[1]) ) * M_infi ) / 
							
						( ( sqrt( (C_U(c,t) * C_U(c,t)) + (C_V(c,t) * C_V(c,t)) ) ) * (NV_MAG(C_P_G(c,t))) ); 
			
			f_shock = first_term + second_term;
			
			f_viscous = (C_MU_L(c,t)+C_MU_T(c,t)) / C_MU_L(c,t);
			
			if(f_shock>=1)
			{
				C_UDMI(c,t,0)=f_shock;
			}
			
			if(f_viscous>1.1)
			{
				C_UDMI(c,t,1)=f_viscous;
			}
			
			if((f_shock<1) && (f_viscous<=1.1))
			{
				C_UDMI(c,t,2)=f_spurious;
			}
		}
		end_c_loop(c,t)
	}
	#endif
}
Thanks in advance
Attached Images
File Type: jpg Capture.JPG (13.8 KB, 43 views)
File Type: jpg Capture2.JPG (18.7 KB, 32 views)
shivakumar is offline   Reply With Quote

Old   May 4, 2015, 02:26
Default
  #4
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
You've used three UDM spaces with the IDs 0, 1 and 2. Have you enabled three UDM slots?
`e` is offline   Reply With Quote

Old   May 4, 2015, 03:06
Default
  #5
Senior Member
 
Join Date: Mar 2013
Location: B'lr
Posts: 130
Rep Power: 13
shivakumar is on a distinguished road
Quote:
Originally Posted by `e` View Post
You've used three UDM spaces with the IDs 0, 1 and 2. Have you enabled three UDM slots?
Yup. I did.
shivakumar is offline   Reply With Quote

Old   May 4, 2015, 03:06
Default
  #6
Senior Member
 
Join Date: Mar 2013
Location: B'lr
Posts: 130
Rep Power: 13
shivakumar is on a distinguished road
and still the error is same.
shivakumar is offline   Reply With Quote

Old   May 4, 2015, 04:28
Default
  #7
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
You use the pressure gradient, which might be removed from memory by Fluent.

Did you set "solve/set/expert", as mentioned in the Fluent manual section "3.2.3.7. Gradient (G) and Reconstruction Gradient (RG) Vector Macros"?
pakk is offline   Reply With Quote

Old   May 4, 2015, 05:29
Exclamation
  #8
Senior Member
 
Join Date: Mar 2013
Location: B'lr
Posts: 130
Rep Power: 13
shivakumar is on a distinguished road
I did that one also but still the error is same.

solve/set/expert
use alternate formulation for wall temperatures? [yes] yes
Keep temporary solver memory from being freed? [yes] yes
Allow selection of all applicable discretization schemes? [yes] yes
Explicit underrelaxation value: [0.75] 0.75

>
iter continuity x-velocity y-velocity energy k omega Cl-1-cylinder Cd-1-cylinder time/iter
Library "C:\xxx\ansys15\libudf\win64\2ddp_node\libudf. dll" opened
================================================== ============================

Node 0: Process 5284: Received signal SIGSEGV.

================================================== ============================

================================================== ============================

Node 1: Process 6200: Received signal SIGSEGV.

================================================== ============================

================================================== ============================

Node 2: Process 6284: Received signal SIGSEGV.

================================================== ============================

================================================== ============================

Node 3: Process 8388: Received signal SIGSEGV.

================================================== ============================

================================================== ============================

Node 4: Process 5924: Received signal SIGSEGV.

================================================== ============================

================================================== ============================

Node 5: Process 7144: Received signal SIGSEGV.

================================================== ============================

================================================== ============================

Node 6: Process 2692: Received signal SIGSEGV.

================================================== ============================

================================================== ============================

Node 7: Process 7544: Received signal SIGSEGV.

================================================== ============================
MPI Application rank 0 exited before MPI_Finalize() with status 2
The fl process could not be started.


shivakumar is offline   Reply With Quote

Old   May 4, 2015, 05:32
Default
  #9
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Then I guess you need to really debug it in the hard way.
Add messages like "Code ran to here", to find out when your code gives errors.
pakk is offline   Reply With Quote

Old   May 4, 2015, 09:48
Default
  #10
Senior Member
 
Join Date: Mar 2013
Location: B'lr
Posts: 130
Rep Power: 13
shivakumar is on a distinguished road
Thank you

Ok.. May be.... I resolved that equation properly. Let me check it once again. I have a doubt in the above code, To find out the du/dx, this macro is correct right? C_U_G(c,t)... I used the same macro earlier but it had yielded compilation error "real[2] .....". After that I added C_U_G(c,t)[0] and did not yield any error. I feel like this may be the problem.
shivakumar is offline   Reply With Quote

Old   May 4, 2015, 10:04
Default
  #11
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Quote:
Originally Posted by shivakumar View Post
Thank you

Ok.. May be.... I resolved that equation properly. Let me check it once again. I have a doubt in the above code, To find out the du/dx, this macro is correct right? C_U_G(c,t)... I used the same macro earlier but it had yielded compilation error "real[2] .....". After that I added C_U_G(c,t)[0] and did not yield any error. I feel like this may be the problem.
I am sorry, but I don't understand what you mean here. But you seem to be confused on C_U_G(c,t), so I can say something about that.

C_U_G(c,t) is the gradient of the x-component of the velocity.This is a vector, so it has three components. The three components are dux/dx=C_U_G(c,t)[0], dux/dy=C_U_G(c,t)[1] and dux/dz=C_U_G(c,t)[2].

I don't know if that is the same as your "du/dx", because I don't know exactly what that is. I am not stupid, so of course I can see it is some derivative of some velocity, but the notation is exact enough to see if this is a scalar, a tensor or a vector. (Does it have 1 component, 3 or 9?)
pakk is offline   Reply With Quote

Old   May 4, 2015, 10:36
Default
  #12
Senior Member
 
Join Date: Mar 2013
Location: B'lr
Posts: 130
Rep Power: 13
shivakumar is on a distinguished road
I have just debugged the code and there is a problem in the first_term (code) statement.

In the first term of RHS of eqn, there is term

(du/dx * rho) + (d(rho)/dx * u)

The resultant term is the vector in this case because du/dx and d(rho)/dx are velocity gradient vector and density gradient vector respectively.

Now can you explain this?
shivakumar is offline   Reply With Quote

Old   May 4, 2015, 10:39
Default
  #13
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
It seems to me that you have already explained that it is a vector. I don't understand what it is you would like me to explain.
pakk is offline   Reply With Quote

Old   May 6, 2015, 07:05
Smile
  #14
Senior Member
 
Join Date: Mar 2013
Location: B'lr
Posts: 130
Rep Power: 13
shivakumar is on a distinguished road
Thank you for the help. I deduced the whole equation into simple format and now fluent is working fine..

shiv
shivakumar is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error running simpleFoam in parallel Yuby OpenFOAM Running, Solving & CFD 14 October 7, 2021 05:38
problem during mpi in server: expected Scalar, found on line 0 the word 'nan' muth OpenFOAM Running, Solving & CFD 3 August 27, 2018 05:18
simpleFoam parallel AndrewMortimer OpenFOAM Running, Solving & CFD 12 August 7, 2015 19:45
simpleFoam in parallel issue plucas OpenFOAM Running, Solving & CFD 3 July 17, 2013 12:30
parallel Grief: BoundaryFields ok in single CPU but NOT in Parallel JR22 OpenFOAM Running, Solving & CFD 2 April 19, 2013 17:49


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