|
[Sponsors] |
October 3, 2021, 02:39 |
Multiphase Udf code for looping a wall face
|
#1 |
Member
xingangzheng
Join Date: Jul 2009
Posts: 40
Rep Power: 17 |
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) } } } |
|
October 3, 2021, 03:26 |
|
#2 | |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Quote:
__________________
"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". |
||
October 3, 2021, 09:17 |
|
#3 |
Member
xingangzheng
Join Date: Jul 2009
Posts: 40
Rep Power: 17 |
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 |
|
October 3, 2021, 16:28 |
|
#4 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
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". |
|
October 3, 2021, 22:14 |
|
#5 |
Member
xingangzheng
Join Date: Jul 2009
Posts: 40
Rep Power: 17 |
||
|
|
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 |