TAGGED: ansys-fluent, boundary-conditions, udf, udf-fluent
-
-
March 21, 2022 at 2:04 pm
isaps1860
SubscriberI have written an UDF for Calculating the area of a surface. The UDF works perfect for the surface of an inlet or an outlet, but for an interior surface the values are wrong. A test example for a simple tube gives different results for inlet and interior surfaces although the areas should be identical.
Is there anything additional to consider for the calculations of the areas for interior?
UDF is below:
#include "udf.h"
DEFINE_ADJUST(Face_area1, domain)
{
face_t face;
Thread* thread;
domain = Get_Domain(1);
int zone_id = 35;
thread = Lookup_Thread(domain, zone_id);
real NV_VEC(va); /* for storing area vector */
real Area = 0;
begin_f_loop(face, thread)
{
F_AREA(va, face, thread); /* Obtain the area vector */
Area += NV_MAG(va); /* Obtain area magnitude */
}
end_f_loop(face, thread)
#if RP_NODE
Area = PRF_GRSUM1(Area);
#endif
node_to_host_real_1(Area);
#if RP_HOST
Message("Area of surface1 is %e ", Area);
#endif
}
Best regards
March 21, 2022 at 5:26 pmRob
Forum ModeratorTry summing the modulus of the area. Interiors don't have an aligned surface normal. It's why the Flux Reports don't pick up the interior faces.
March 21, 2022 at 5:40 pmisaps1860
SubscriberThank you for your answer . Makes sense, that with no aligned surface normal there is no logical result.
But I have to ask what do you mean with "summing the modulus of the area"? Don┬┤t really understand that.
March 21, 2022 at 6:18 pmAmine Ben Hadj Ali
Ansys EmployeeLook in the documentation you will see that on interior bcs not all variables are available and that you require other connectivity macro
March 22, 2022 at 10:53 amRob
Forum ModeratorIf the vector is random you may find the x-area to be positive or negative: hence sum the modulus (positive) values.
Viewing 4 reply threads- The topic ‘UDF Area of an interior face’ is closed to new replies.
Ansys Innovation SpaceTrending discussions- 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
Top Contributors-
3862
-
1414
-
1220
-
1118
-
1015
Top Rated Tags© 2025 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.
-