-
-
August 21, 2024 at 6:44 pmcsolanovSubscriber
I 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 pmRobForum Moderator
The 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 pmcsolanovSubscriber
the 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.
- 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”
-
1416
-
599
-
591
-
565
-
366
© 2025 Copyright ANSYS, Inc. All rights reserved.