|
[Sponsors] |
February 11, 2016, 06:07 |
mixture level thread
|
#1 |
Senior Member
Join Date: Mar 2014
Posts: 375
Rep Power: 13 |
Hi
Does the mixture level thread contain particle data too? Well, I think not. How can I get the mixture data such as C_VOF into a DEFINE_DPM UDF, I have tried using the Get_Domain and Lookup_Thread macros but they dont seem to work. Cheers |
|
February 11, 2016, 06:23 |
|
#2 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
The DPM macros are generally called for each particle at a particular stage of the solver. The cell where the particle resides in can be accessed with the P_CELL and P_CELL_THREAD macros. For example, in combination with the multiphase subthread macro:
Code:
cell_t c; Thread *t; real volume_fraction; c = P_CELL(p); t = THREAD_SUB_THREAD(P_CELL_THREAD(p),0); volume_fraction = C_VOF(c,t); |
|
February 11, 2016, 07:06 |
|
#3 | |
Senior Member
Join Date: Mar 2014
Posts: 375
Rep Power: 13 |
Hmm
I am trying to run this simple code from one of the posts here. This macro already has the particle cell and thread but I get an access violation (editing: actually it says received a fatal signal (segmentation fault) when i try to use this UDF. Did specify a scalar in the dialog box in Fluent too. Quote:
|
||
February 12, 2016, 00:20 |
|
#4 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
You don't need a scalar variable for using the DEFINE_DPM_SCALAR_UPDATE macro, scalars are for when you're using UDS. Are you sure you have multiple phases (therefore multiple domains)? Try removing each line of code one step at a time to determine which line of code is causing the segmentation fault (Fluent is trying to access something not there).
|
|
February 12, 2016, 02:25 |
|
#5 |
Senior Member
Join Date: Mar 2014
Posts: 375
Rep Power: 13 |
I receive a segmentation error when I want to get the C_VOF. If I try to get the particle properties it runs fine. (I dont know if it runs fine, but it does not crash atleast). using the particle properties and trying to abort the particles as their velocity changes has no affect and the particles are never aborted. But that is a problem for later...
I do have multiple phases and the phase ID for the phase I want to get is 3. So I do change it to 3. But still get the segmentation error. Code:
#include "udf.h" DEFINE_DPM_SCALAR_UPDATE(charge,c,t,initialize,p) { Thread *phase_t = THREAD_SUB_THREAD(t,3); if(C_VOF(c,phase_t)>=0.5) p->stream_index = -1; } |
|
February 12, 2016, 03:39 |
|
#6 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
Do you have a simple case you could share with us so we can reproduce the error? Please upload the Workbench archive rather than the Fluent case and data files.
|
|
February 12, 2016, 06:44 |
|
#7 |
Senior Member
Join Date: Mar 2014
Posts: 375
Rep Power: 13 |
Yes it is a fairly simple case. The idea is to get dust particles trapped by water droplets when they come across one.
I understand you wanted the workbench files but I dont have access to ansys right now (at home and just saw your post), so I am uploading the case and data file only (sorry), but if you will defo need the workbench files I can upload them on Monday (weekend now ). Here is the link to the stored files. The password is: cfdonline The .c file you will find is the udf in the current state in which i left it at end of the day today. (ofcourse still wasn't working). https://cloudstor.aarnet.edu.au/plus...7FTkyZyyIq5bFo Thanks e |
|
February 12, 2016, 18:08 |
|
#8 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
I'm getting the same error, have you managed to use the C_VOF macro in any other case (perhaps with a different macro)?
|
|
February 12, 2016, 22:58 |
|
#9 |
Senior Member
Join Date: Mar 2014
Posts: 375
Rep Power: 13 |
Yes, I did try with the DEFINE_DPM_BODY_FORCE marco as well, same error.
Have you ever done something similar? Using C_VOF in a DPM macro? Also, wondering if it is always this hit and trial thingy with UDF's? Asking since I have been following your posts for quite some time now and consider you an advanced UDF user... |
|
February 15, 2016, 21:29 |
|
#10 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
I've not used the VOF model in Fluent -- does the C_VOF macro work without the DPM enabled? If it's working without the DPM enabled, then double check the thread numbers (using THREAD_SUB_THREAD) are the same with vs without DPM.
Yes, I've found the UDFs (and much of Fluent) to be hit and miss. It's the nature of closed source / commercial software where you don't know how they're calculating and solving the equations (beyond what their guides indicate which aren't exhaustive). |
|
February 15, 2016, 23:16 |
|
#11 | |
Senior Member
Join Date: Mar 2014
Posts: 375
Rep Power: 13 |
OK, so C_VOF is a phase thread, which thread is the particle in?
If it says 't' is the pointer to thethread where the particle is in, what thread level is it? The mixture thread? It is a discrete phase not sure if it will be in the mixture thread. What needs to be done here is get the phase thread from the discrete phase thread, but what thread is the discrete phase in? Or get the phase thread from mixture thread but then it is all inter-connected, how do i get the mixture thread without any subthreads of the mixture thread in the DEFINE macro. Or if I start with Get_Domain and go from there? But somewhere in between starting from the domain I get stuck as well...ARRRGGGGhhh Quote:
Maybe I should start with as the guide does for the DEFINE_ON_DEMAND macro which doesn't pass anything and go on form there doing the same thing in the DPM macro instead? |
||
February 17, 2016, 21:17 |
|
#12 |
Senior Member
Join Date: Mar 2014
Posts: 375
Rep Power: 13 |
Sorted this out now,
used Thread **x and x=THREAD_SUB_THREADS(t) instead of THREAD_SUB_THREAD(t,i), and then when using the macro C_VOF(c,t), use C_VOF(c,x[i]) instead. cheers |
|
July 19, 2016, 07:32 |
|
#13 |
New Member
Fangfang Sun
Join Date: Mar 2016
Posts: 3
Rep Power: 10 |
I also need C_VOF,how did you sort,here i cannot understand clearly.
Could you share with me your udf? Thanks very much. My email is adnan_laghari@hotmail.com. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ANSYS Workbench on "Uncertified" Linux Distros | hsr | CFX | 289 | April 20, 2023 10:23 |
[snappyHexMesh] SHM error: inside mesh not possible | Naresh yathuru | OpenFOAM Meshing & Mesh Conversion | 1 | January 11, 2017 00:58 |
[snappyHexMesh] meshing of very small patches in comparison with the overall geometry | christos | OpenFOAM Meshing & Mesh Conversion | 3 | December 17, 2014 17:55 |
[snappyHexMesh] defining two cellZone in SHM | student666 | OpenFOAM Meshing & Mesh Conversion | 0 | July 15, 2014 09:33 |
mixture mass continuity v.s. volumetric mixture continuity in pressure equation | kaifu | OpenFOAM | 0 | June 9, 2011 09:14 |