-
-
August 21, 2024 at 6:44 pm
csolanov
SubscriberI want to get the heat flux values for a p20 steel solid 2d rectangular shape. I want the values for each node in the y-axis written in a .txt file. Whenever I compiled my udf it builds but when loading I get this error.
ERROR: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64).
The system cannot find the file specified.
this is the code:
----------------------------------------------------------------------------------------------------------------------------------------------
#include "udf.h"
#include "stdio.h"Â ÂDEFINE_EXECUTE_AT_END(write_heat_transfer_to_file)
{
  Domain *domain;
  Thread *t;
  cell_t c;
  real thermal_conductivity;
  real temperature;
  real heat_flux;  FILE *file; Â
  char filename[] = "written_heat_transfer_values.txt";  domain = Get_Domain(1);Â
  Â
  file = fopen(filename, "w");
  if (file == NULL)
  {
    Message("Error opening file %s\n", filename);
    return;
  }  Â
  thread_loop_c(t, domain)
  {
   Â
    begin_c_loop(c, t)
    {
     Â
      thermal_conductivity = C_K_L(c, t); Â
      temperature = C_T(c, t); Â      Â
     Â
      heat_flux = thermal_conductivity * temperature; Â     Â
      fprintf(file, "Cell ID: %d, Thermal Conductivity: %g W/m*K, Heat Flux: %g W/m^2\n", c, thermal_conductivity, heat_flux);
    }
    end_c_loop(c, t)
  }  Â
  fclose(file); Â
  Message("Heat fluxvalues written to %s\n", filename);
}
}----------------------------------------------------------------------------------------------------------------------------------------------
-
August 22, 2024 at 12:19 pm
Rob
Forum ModeratorThe error means it's not compiled, so you need to resolve that before loading the library. What error are you seeing when compiling?Â
Are you wanting the data at a single instance, ie the end of a solution or during? I ask as surface reports may be an easier approach.Â
-
August 26, 2024 at 11:58 pm
csolanov
Subscriberthe code run now. There were errors inside the code that's why it was giving me error.Â
-
- You must be logged in to reply to this topic.
- How do I get my hands on Ansys Rocky DEM
- Unburnt Hydrocarbons contour in ANSYS FORTE for sector mesh
- convergence issue for transonic flow
- Facing trouble regarding setting up boundary conditions for SOEC Modeling
- Point exception in erosion calculation
- Script Error Ansys
- Errors with multi-connected bodies using AQWA
- Quantitative results
-
2733
-
959
-
814
-
599
-
591
© 2025 Copyright ANSYS, Inc. All rights reserved.