TAGGED: fluent-uds-udf, udf, udferror
-
-
July 20, 2023 at 8:41 am
Zery Triputra
SubscriberHi everyone, I'm having trouble initializing my model.
My fluent crash when i try to initialize my model.
I use UDS and UDF, my simulation is 2D, single phase. \
I aim to get the simulation results in the form of the distribution of Dissolved Oxygen in the pond.
Is there anyone can check my UDF is wrong or not ?My UDF :
#include "udf.h"
DEFINE_PROFILE(inlet_velocity, thread, position)
{
real x[ND_ND];
real vel = 0.32; // Kecepatan masukan inlet (m/s)face_t f;
begin_f_loop(f, thread)
{
F_CENTROID(x, f, thread);
F_PROFILE(f, thread, position) = vel;
}
end_f_loop(f, thread)
}
#define Cs 0.0085 // dissolved oksigen concentration saturated (kg/m^3)
#define C_initial 0.003 // l C (kg/m^3)
#define a 22.34 // coefficient source item (1/s)DEFINE_SOURCE(mass_source, c, t, dS, eqn)
{
real S, C;
real time = CURRENT_TIME;// Calculation of value S (mass source item) based on the one degree reaction model
S = a * (Cs - C_initial);// deficit value S
S *= exp(-0.1 * time); // Nilai penurunan dapat disesuaikan// update value C
C = C_initial + (Cs - C_initial) * (1 - exp(-a * time));// stop iteration when C is maximum ( saturated)
if (C >= Cs) {
C = Cs;
S = 0.0;
}// Assign value C to UDS (User Defined Scalar)
C_UDSI(c, t, 0) = C;dS[eqn] = 0.0; //
return S;
} -
July 20, 2023 at 1:44 pm
Rob
Ansys EmployeeHow many scalars did you tell Fluent you were using? Check the lines
// deficit value S
S *= exp(-0.1 * time); // Nilai penurunan dapat disesuaikan -
July 20, 2023 at 11:32 pm
Zery Triputra
Subscriberi use 2 scalars in this simulation
-
July 21, 2023 at 8:40 am
Rob
Ansys EmployeeAnd did you assign memory for that in User Defined tab?
If you did. Turn off the source terms, run a few iterations/one time step and try again. If any of those data calls don't have a value you may have a problem. Also, using 1-3 letter variables can cause problems if they're also used in Fluent somewhere else, hence I often use real/integer over DEFINE for coefficients.
-
- 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.
- Floating point exception in Fluent
- What are the differences between CFX and Fluent?
- Heat transfer coefficient
- Difference between K-epsilon and K-omega Turbulence Model
- Getting graph and tabular data from result in workbench mechanical
- The solver failed with a non-zero exit code of : 2
- Suppress Fluent to open with GUI while performing in journal file
- Mesh Interfaces in ANSYS FLUENT
- Time Step Size and Courant Number
- error: Received signal SIGSEGV
-
7592
-
4440
-
2953
-
1427
-
1322
© 2023 Copyright ANSYS, Inc. All rights reserved.