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

DEFINE_ON_DEMAND not compiled. Thread wrong?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 5, 2020, 21:57
Default DEFINE_ON_DEMAND not compiled. Thread wrong?
  #1
Member
 
Deutschland
Join Date: Jun 2020
Location: https://t.me/pump_upp
Posts: 43
Rep Power: 5
schwaral is on a distinguished road
Send a message via ICQ to schwaral Send a message via AIM to schwaral Send a message via Yahoo to schwaral
Hi all,

Can someone explain me what I messed up? I think I missunderstood something fundamental here. It compails without error. The UDF works without the loops. Also using only the inner loop is not working. Without the DEFINE_ONDEMAND all other UDFs in the file compiled work fine. When it runs I get this error:

Error: received a fatal signal (Segmentation fault).

Error: received a fatal signal (Segmentation fault).
Error Object: #f

DEFINE_ON_DEMAND(find_othercell)
{
Domain *d= Get_Domain(22);
int ID = 12;
Thread* f =Lookup_Thread(d, ID); // is pointer to thread
face_t f; //face_t is an integer data type that identifies a particular face within a face thread.
int n_faces; //number of faces

thread_loop_f(f, d)
{
begin_f_loop(f, t)
{
n_faces = n_faces + 1;
//C_CENTROID(air_c_centroid, c_cell, t_mark);
}
end_f_loop(f, t)
}
Message0("n_faces: %i \n", n_faces);
}

I think maybe the ID is wrong. I have a conformal mesh and there are multiple domains. 22 refers to one domain of my porous domain, that is connceted to other domains. ID 12 refers to the Intrior that represents the face between the domain(22) and domain(24). I tried 22 and 24 and both gives me same error. I think the "interior face" with ID 12 belongs to both of the domains but this is not possible?! If you can trust CFD-Post the name of 12 suggest, that it belongs to the domain 22

Last edited by schwaral; November 6, 2020 at 00:10.
schwaral is offline   Reply With Quote

Old   November 6, 2020, 05:15
Default
  #2
Member
 
Deutschland
Join Date: Jun 2020
Location: https://t.me/pump_upp
Posts: 43
Rep Power: 5
schwaral is on a distinguished road
Send a message via ICQ to schwaral Send a message via AIM to schwaral Send a message via Yahoo to schwaral
for example this is not working as well. I really do not understand why this error happens. All I can read in the internet, is that mostly a variable is not initialized or the UDM is not set or the UDF is not compiled correclty. But for me all this is not the case
schwaral is offline   Reply With Quote

Old   November 6, 2020, 05:26
Default what could be another reason for error?
  #3
Member
 
Deutschland
Join Date: Jun 2020
Location: https://t.me/pump_upp
Posts: 43
Rep Power: 5
schwaral is on a distinguished road
Send a message via ICQ to schwaral Send a message via AIM to schwaral Send a message via Yahoo to schwaral
for example this is not working as well.


DEFINE_ON_DEMAND(findothercell)
{
Domain *d= Get_Domain(24);
int ID = 32;
Thread* tf;
face_t f;
tf =Lookup_Thread(d, ID);

begin_f_loop(f, tf)
{
printf("n_faces\n");
}
end_f_loop(f, tf)
}




I really do not understand why this error happens. All I can read in the internet, is that mostly a variable is not initialized or the UDM is not set or the UDF is not compiled correclty. But for me all this is not the case
schwaral is offline   Reply With Quote

Old   November 6, 2020, 06:29
Default
  #4
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
It can mean that domain 24 does not exist, or that cell zone 32 does not exist.

And my first guess would be domain 24... Why did you put 24 there? Where does this number come from?
pakk is offline   Reply With Quote

Old   November 6, 2020, 07:06
Default
  #5
Member
 
Deutschland
Join Date: Jun 2020
Location: https://t.me/pump_upp
Posts: 43
Rep Power: 5
schwaral is on a distinguished road
Send a message via ICQ to schwaral Send a message via AIM to schwaral Send a message via Yahoo to schwaral
Quote:
Originally Posted by pakk View Post
It can mean that domain 24 does not exist, or that cell zone 32 does not exist.

And my first guess would be domain 24... Why did you put 24 there? Where does this number come from?
It is what I read in the fluent setup tree under cell-zone-conditions. I thought the number there is the number of the domain?
Attached Images
File Type: png zellzones.PNG (8.9 KB, 4 views)
schwaral is offline   Reply With Quote

Old   November 6, 2020, 13:46
Default
  #6
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
Quote:
Originally Posted by schwaral View Post
It is what I read in the fluent setup tree under cell-zone-conditions. I thought the number there is the number of the domain?
No, you misunderstood the help. GET_DOMAIN refers to the phase. Normally it is 1, if you have a mixture then higher values refer to the other mixture components.

The number 24 that you saw is the THREAD_ID of the interior, you don't need that here.

Summary : just use GET_DOMAIN(1).
pakk is offline   Reply With Quote

Old   November 7, 2020, 08:06
Default
  #7
Member
 
Deutschland
Join Date: Jun 2020
Location: https://t.me/pump_upp
Posts: 43
Rep Power: 5
schwaral is on a distinguished road
Send a message via ICQ to schwaral Send a message via AIM to schwaral Send a message via Yahoo to schwaral
aaah okay thanks! that makes sense now
schwaral is offline   Reply With Quote

Old   November 8, 2020, 02:45
Default
  #8
Member
 
Deutschland
Join Date: Jun 2020
Location: https://t.me/pump_upp
Posts: 43
Rep Power: 5
schwaral is on a distinguished road
Send a message via ICQ to schwaral Send a message via AIM to schwaral Send a message via Yahoo to schwaral
I have another question regarding the internal walls. When I use c0=F_C0(f,ft) and loop over all faces of internal wall, Fluent finds all the cells on the left side of the internal wall. When I use c1=F_C1(f,ft) fluent finds all the nodes right of the internal wall.

I thougth that c1 should be the cell thread even further away from the boundary (2nd cell row next to boundary).

Do you have an idea how to find the 2nd row of cells next to internal wall?
I want to find the first two cells on the right side of internal wall. So somehow the c0 has to be on the other side (right) of the wall and c1 should be on the right side as well.
Code:
	begin_f_loop(f, tf)
	{
		/* c0 and t0 identify the adjacent cell */
		c0 = F_C0(f, tf);
		c1 = F_C1(f, tf);
		t0 = THREAD_T0(tf);
		t1 = THREAD_T1(tf);			

			C_UDMI(c0, t0, 0) = 1.0;
			C_UDMI(c1, t1, 1) = 2.0;
	
	}
	end_f_loop(f, tf)
PS: The way I tried it now is to use normal face vector from c0 to c1 and since I know the distance to my 2nd cell row I can do a simple sum of normalvector*distance+ c1=new point in 2nd cell row. However I am am unable to find a soution to find the Cell Centroid by only knowing the coordinates in a cell.
If I use interpolation for reading solution data, do I need to know the cell centroid or will Fluent automatically detect the cell centroid, when I give x,y,z of a cell?

Last edited by schwaral; November 10, 2020 at 17:01.
schwaral 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
[snappyHexMesh] SHM Layer Addition Phase dickcruz OpenFOAM Meshing & Mesh Conversion 4 November 1, 2018 07:05
[mesh manipulation] Importing Multiple Meshes thomasnwalshiii OpenFOAM Meshing & Mesh Conversion 18 December 19, 2015 18:57
[OpenFOAM.org] OF2.3.1 + OS13.2 - Trying to use the dummy Pstream library aylalisa OpenFOAM Installation 23 June 15, 2015 14:49
SigFpe when running ANY application in parallel Pj. OpenFOAM Running, Solving & CFD 3 April 23, 2015 14:53
Compressor Simulation using rhoPimpleDyMFoam Jetfire OpenFOAM Running, Solving & CFD 107 December 9, 2014 13:38


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