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

Multiphase Udf code for looping a wall face

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 3, 2021, 02:39
Default Multiphase Udf code for looping a wall face
  #1
Member
 
xingangzheng
Join Date: Jul 2009
Posts: 40
Rep Power: 17
ustbdynamic is on a distinguished road
Hello everyone!

During a multiphase flow simulation (air+sand, Eulerian-Eulerian model), I am trying to write an UDF to loop a wall face (its ID is 22). The purpose is to store some values (the secondary phase) of the wall adjacent cell to the UDM.
But after a long attempt, I failed to complete this process. The code is in vain for the wall adjacent cell. Those values that are not in this area are looped and stored instead.

There must be something wrong with my UDF,especially in the looping process.

I have no idea what to do next, so maybe someone here has an idea?

Thank you.

#include "udf.h"
#include "sg.h"
#include "sg_mphase.h"
#include "flow.h"
#include "mem.h"

#define ID 22 //WALL_NUMBER

DEFINE_ADJUST(settingvalue, mixture_domain)
{

Thread *cell_thread;
Thread *tc;
cell_t c;
face_t f;
Thread **pt;
Thread *ti;
Thread *tf;



mixture_domain = Get_Domain(1);


tf= Lookup_Thread(mixture_domain, ID); //getting the wall thread

mp_thread_loop_f(tf, mixture_domain, pt)
{

if (DOMAIN_ID(tf) == 3) // 3 is the secondary phase domain
{

begin_f_loop(f,tf)
{

tc = THREAD_T0(tf); /*adjacent cell thread*/
c = F_C0(f,tf); /*adjacent cell*/

ti = pt[1]; /* 0 pointer for the primary phase, 1 is for the secondary phase*/

C_UDMI(c,ti,0) = - C_R(c, ti)*C_VOF(c,ti)/CURRENT_TIMESTEP ;

}

end_f_loop(f,tf)
}

}

}
ustbdynamic is offline   Reply With Quote

Old   October 3, 2021, 03:26
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Quote:
Those values that are not in this area are looped and stored instead
I'm not sure if I understand this part. Do you mean that your UDF gives results for everything in your domain except the wall that you are interested in?
__________________
"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".
pakk is offline   Reply With Quote

Old   October 3, 2021, 09:17
Default
  #3
Member
 
xingangzheng
Join Date: Jul 2009
Posts: 40
Rep Power: 17
ustbdynamic is on a distinguished road
Dear pakk.
Thank you for responding.

It may or may not be this. The contours in other areas show changes, but I am not sure whether it works well or not for everything except the wall that I am interested in. It is certain that it has no effect on the interested cells.

thank you.
Xingang

Quote:
Originally Posted by pakk View Post
I'm not sure if I understand this part. Do you mean that your UDF gives results for everything in your domain except the wall that you are interested in?
ustbdynamic is offline   Reply With Quote

Old   October 3, 2021, 16:28
Default
  #4
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
C_UDMI(c,ti,0)

Should be

C_UDMI(c,tc,0)

(i think)
__________________
"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".
pakk is offline   Reply With Quote

Old   October 3, 2021, 22:14
Default
  #5
Member
 
xingangzheng
Join Date: Jul 2009
Posts: 40
Rep Power: 17
ustbdynamic is on a distinguished road
Thank you, I will try.

Quote:
Originally Posted by pakk View Post
C_UDMI(c,ti,0)

Should be

C_UDMI(c,tc,0)

(i think)
ustbdynamic 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] Invalid Normals for source face to target face while making AMI? Sorabh OpenFOAM Meshing & Mesh Conversion 1 August 3, 2021 07:35
[blockMesh] Internal walls of zero thickness anger OpenFOAM Meshing & Mesh Conversion 23 February 6, 2020 19:25
[mesh manipulation] Importing Multiple Meshes thomasnwalshiii OpenFOAM Meshing & Mesh Conversion 18 December 19, 2015 19:57
[blockMesh] non-orthogonal faces and incorrect orientation? nennbs OpenFOAM Meshing & Mesh Conversion 7 April 17, 2013 06:42
Please check out my parallelized udf code aleisia Fluent UDF and Scheme Programming 0 June 10, 2011 17:16


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