-
-
June 20, 2019 at 5:24 pm
roytorc
SubscriberI am trying to access cell temperature using "c->temp" which works in Fluent 17.2. However, using the same thing in Fluent 2019R1 gives me 0 output. Here is the code I'm using. Could anyone advise.
#include "udf.h"
#include "stdio.h"
#include "string.h"
#include "stdlib.h"
#define mesh_size 103456
#define Ad 4e21 /* 1/s */
#define Ed 142000 * 4.18 * 0.95 /* kJ/kmol */
#define R 8.314 /* kJ/kmol.K */
DEFINE_INIT(thermal_age_setup,domain)
{
if(NULLP(user_particle_vars)) Init_User_Particle_Vars();
strcpy(user_particle_vars[0].name, "thermal-age");
strcpy(user_particle_vars[0].label, "Thermal Age");
strcpy(user_particle_vars[1].name, "thermal-age-0");
strcpy(user_particle_vars[1].label, "Thermal Age 0");
}
DEFINE_DPM_SCALAR_UPDATE(thermal_age, cell, thread, initialize, p)
{
cphase_state_t *c = &(p->cphase);
if(initialize)
{
P_USER_REAL(p,0) = 0.0;
P_USER_REAL(p, 1) = Ad * exp(-Ed / R / c->temp);
}
else if (P_POS(p)[0] < 0.175)
{
P_USER_REAL(p,0) = 0.0;
P_USER_REAL(p,1) = Ad * exp(-Ed / R / c->temp);
}
else
{
P_USER_REAL(p,0) = P_USER_REAL(p,0) + P_DT(p) * 0.5 * (P_USER_REAL(p,1) + Ad * exp(-Ed / R / c->temp));
P_USER_REAL(p,1) = Ad * exp(-Ed / R / c->temp);
}
}
-
June 21, 2019 at 5:23 am
DrAmine
Ansys EmployeeCheck the manual. There was a change in the structure so that you need to tell which phase it is. In an example you can find that. Other way is to find the cell where the particle is located. -
June 21, 2019 at 5:28 am
roytorc
SubscriberThank you for your reply. Could you elaborate more on ' you need to tell which phase it is'. Also, is using C_T(P_CELL(p), P_CELL_THREAD(p)) equivalent to c->temp? I have tried that and I don't think it gave me the same result.
I forgot to mentioned that Fluent 17.2 was in linux and Fluent 19R1 is in windows10.
-
June 21, 2019 at 6:14 am
roytorc
SubscriberI modified my code to cphase[0] and I think it work now.
However, I ran my previous code on Fluent17.2 (windows10) and got the MPI error while using the same UDF in Fluent17.2(Linux) had no problem. Could you please advise the reason of this circumstance.
-
June 21, 2019 at 6:17 am
DrAmine
Ansys EmployeeNo I apologize here. Use the latest release and check if it is working.
-
- You must be logged in to reply to this topic.

Boost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.

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.

Ansys Blog
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
-
3670
-
2552
-
1751
-
1226
-
582
© 2023 Copyright ANSYS, Inc. All rights reserved.