-
-
February 13, 2025 at 10:08 pm
Prakash Singh
SubscriberHow to get area weighted avg outlet temp at a specific time using udf?
-
February 14, 2025 at 7:40 am
Nilay Pedram
Forum ModeratorHello,
Please refer to this discussion - how to calculate avg temp at outlet? -
February 14, 2025 at 12:29 pm
Prakash Singh
SubscriberThank you.
-
February 16, 2025 at 9:28 am
Prakash Singh
SubscriberHow can I patch the fluid domain using UDF? I want to patch the fluid domain with T= 300 K at t= 0 sec, and T= stored outlet temperature at t=2.1 sec. I have already written a UDF to store the outlet temp.
where t varies as follows:
real t = CURRENT_TIME;for(;;){if(t<=4.2)break;t=t-4.2;}Thank you. -
February 17, 2025 at 9:47 am
SRP
Ansys EmployeeHi,
Since you've already written a UDF to store the outlet temperature, you'll need to include a conditional statement within your UDF to check the current simulation time and apply the desired temperature accordingly.
DEFINE_ADJUST macro can be used to make adjustments at every time step based on the current simulation time.
-
February 17, 2025 at 12:44 pm
Prakash Singh
SubscriberDEFINE_EXECUTE_AT_END(patch_temperature)
{
Domain *d = Get_Domain(1);
Thread *t;
cell_t c;
double t = CURRENT_TIME;// Adjusting current_time to within 4.2s periodic cycle
for(;;)
{
if(t<=4.2)
break;
t=t-4.2;}
// Patching at t = 2.1 sec using stored outlet temperature
if (fabs(current_time - 2.1) < 1e-3)
{
Message("Using stored outlet temperature: %f K\n", stored_temp);thread_loop_c(t, d)
{
if (FLUID_THREAD_P(t))
{
begin_c_loop(c, t)
{
C_T(c, t) = stored_temp; // Use dynamically stored outlet temperature
}
end_c_loop(c, t)
}
}
Message("Temperature patched to %f K at t = 2.1 sec\n", stored_temp);
}I am attempting this method. However, the issue is that I am not achieving the same outcome as I achieved by manual patching. Kindly see the attached image.
What am I doing wrong?
Thank you for taking your time to read my issue.
-
February 17, 2025 at 12:48 pm
Prakash Singh
Subscriber*Note:
// Adjusting current_time to within 4.2s periodic cycle
for(;;)
{
if(t<=4.2)
break;
t=t-4.2;}//
please read 't' as 'current_time' in the above code.
-
- You must be logged in to reply to this topic.
- air flow in and out of computer case
- Varying Bond model parameters to mimic soil particle cohesion/stiction
- Eroded Mass due to Erosion of Soil Particles by Fluids
- Centrifugal Fan Analysis for Determination of Characteristic Curve
- Guidance needed for Conjugate Heat Transfer Analysis for a 3s3p Li-ion Battery
- I am doing a corona simulation. But particles are not spreading.
- Issue to compile a UDF in ANSYS Fluent
- JACOBI Convergence Issue in ANSYS AQWA
- affinity not set
- Resuming SAG Mill Simulation with New Particle Batch in Rocky
-
3892
-
1414
-
1241
-
1118
-
1015
© 2025 Copyright ANSYS, Inc. All rights reserved.