-
-
August 29, 2024 at 3:37 pmcsolanovSubscriber
Hello,Â
I'm running a udf to calculate heat flux values along 4 boundary faces in a 2d solid domain. this is the udf
#include "udf.h"#include "sg.h"ÂDEFINE_EXECUTE_AT_END(Direct){  int i, ID, zone[4] = { 4, 5, 6, 7};  double ds, A_by_es, flux, DTX, DTY, Area;  double H_flux[3], A[ND_ND], es[ND_ND], dr0[ND_ND];  face_t f;  cell_t c0;  Thread* t0, * t;  Domain* d = Get_Domain(1);  FILE* fp;  fp = fopen("Data.txt", "a"); // Use append mode  if (fp == NULL) {    Message("Error opening file!\n");    return;  }  for (i = 0; i < 4; i++) { // Loop over all zones    flux = 0.0;    DTX = 0.0;    DTY = 0.0;    Area = 0.0;    ID = zone[i];    t = Lookup_Thread(d, ID);    begin_f_loop(f, t)    {      BOUNDARY_FACE_GEOMETRY(f, t, A, ds, es, A_by_es, dr0);      Area += NV_MAG(A);      c0 = F_C0(f, t);      t0 = THREAD_T0(t);      DTX += C_T_RG(c0, t0)[0] * es[0] * NV_MAG(A);      DTY += C_T_RG(c0, t0)[1] * es[1] * NV_MAG(A);      flux += (C_T_RG(c0, t0)[0] * es[0] + C_T_RG(c0, t0)[1] * es[1]) * NV_MAG(A);    }    end_f_loop(f, t)    DTX /= Area;    DTY /= Area;    flux /= Area;    H_flux[i] = (32 * flux);    fprintf(fp, "Wall %d:\t DTX=%f\t DTY=%f\t heat flux=%f\n", ID, DTX, DTY, H_flux[i]);    Message("Wall %d:\t DTX=%f\t DTY=%f\t heat flux=%f\n", ID, DTX, DTY, H_flux[i]);  }  fclose(fp);}Âit builds and compiled correctly, after running the calculation I get this error=  BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
= Â RANK 0 PID 41404 RUNNING AT "xxxx"
= Â EXIT STATUS: -1 (ffffffff)ÂI think is because I'm running fluent in parallel and this code is not parallelized. I have read the udf manual but is not clear to me how to parallelized the code. Should I use PRINCIPAL_FACE_P macros of the condition #if RP_NODE, RP_HOST?ÂÂAny advice is welcome. Thank you. -
September 9, 2024 at 11:11 amRobForum Moderator
All I can do is refer you to the UDF manual. The error isn't necessarily due to the parallel setup, as that generally just returns an incorrect value for the sums as Fluent sees the partition boundary cells two or more times. Try on one node and see what happens.Â
-
Viewing 1 reply thread
- You must be logged in to reply to this topic.
Ansys Innovation Space
Trending discussions
- Non-Intersected faces found for matching interface periodic-walls
- Unburnt Hydrocarbons contour in ANSYS FORTE for sector mesh
- Fluent fails with Intel MPI protocol on 2 nodes
- Help: About the expression of turbulent viscosity in Realizable k-e model
- Cyclone (Stairmand) simulation using RSM
- error udf
- Mass Conservation Issue in Methane Pyrolysis Shock Tube Simulation
- Script Error
- Facing trouble regarding setting up boundary conditions for SOEC Modeling
- UDF, Fluent: Access count of iterations for “Steady Statistics”
Top Contributors
-
1416
-
599
-
591
-
565
-
366
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.