August 17, 2018 at 11:05 pmfuad87Subscriber
I have written this code for the "flux" term of my UDS. I have copied it from the UDF manual and edited a bit, since I am working in multiphase. This code has some issue with the line of "if (BOUNDARY_FACE_THREAD_P(t))". I checked without this line, it is interpreted without any error. But when I am using this line it is giving parse error.
real rho, flux;
cell_t c0, c1 = -1;
Thread *t0, *t1 = NULL;
c0 = F_C0(f,t);
t0 = THREAD_T0(t);
if (NNULLP(THREAD_STORAGE(t,SV_DENSITY)) &&ULLP(THREAD_STORAGE(t,SV_VOF)))
rho = F_VOF(f,t)*F_R(f,t);
rho = C_VOF(c0,t0)*C_R(c0,t0);
flux = F_FLUX(f,t) / rho;
c1 = F_C1(f,t);
t1 = THREAD_T1(t);
rho = (C_VOF(c0,t0)*C_R(c0,t0)+C_VOF(c1,t1)*C_R(c1,t1))/2.0;
flux = F_FLUX(f,t) / rho;
August 18, 2018 at 6:23 amDrAmineAnsys Employee
Can you compile?
August 18, 2018 at 6:31 amfuad87Subscriber
it doesn't compile instead gives parse error for line "if(BOUNDARY_FACE_THREAD_P(t))"
August 18, 2018 at 6:40 amDrAmineAnsys Employee
You said you interpreted that is why I asked if you can compile instead of interpetreting
August 18, 2018 at 6:42 amfuad87SubscriberIt can’t be “compiled” as well as “interpreted”
August 18, 2018 at 6:46 amfuad87SubscriberActually the example given for DEFINE_UDS_FLUX is faulty itself. I fixed 4-5 errors, now it seems even the BOUNDARY_FACE_THREAD is also corrupted in “threads.h”
August 18, 2018 at 6:57 amDrAmineAnsys Employee
That is why I wanted to know. I can compile the UDF and use it. To be safe for usage I recommend to check if the UDS has been defined for the mixture or for the phase. This would affect the threads you want to check.
August 20, 2018 at 6:04 pmfuad87Subscriber
It might be the reason. Since I am working in multiphase flow, my UDS is hooked at one of the phases. I think BOUNDARY_FACE_THREAD_P(t) can't access thread in phase, it might be allowed in mixture phase. Thats why I used,
ID = THREAD_ID(t)
to get index of the thread and used if condition for face thread and internal thread. Now its working. Thanks.
August 20, 2018 at 7:36 pmDrAmineAnsys Employee
Or to check via THREAD_SUPER_THREAD to check the mixture thread
- You must be logged in to reply to this topic.
Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- Suppress Fluent to open with GUI while performing in journal file
- Floating point exception in Fluent
- What are the differences between CFX and Fluent?
- Heat transfer coefficient
- Getting graph and tabular data from result in workbench mechanical
- The solver failed with a non-zero exit code of : 2
- Difference between K-epsilon and K-omega Turbulence Model
- Time Step Size and Courant Number
- Mesh Interfaces in ANSYS FLUENT
- error in cfd post
© 2023 Copyright ANSYS, Inc. All rights reserved.