TAGGED: initialization, udf-fluent
-
-
February 28, 2022 at 5:46 am
Dilini
SubscriberHello,
I've got a simple UDF that contains the initial temperature values in my domain changing with depth. I have used a scalar and assigned the temperature values in it. Below is a part of my code.
DEFINE_INIT(temp_profile1, domain)
{
  cell_t c;
  Thread* t;
  cell_t c0;
  Thread* t0;
  real xc[ND_ND];
  real z;
  thread_loop_c(t, domain)
  {
    begin_c_loop_all(c, t)
    {
      C_CENTROID(xc, c, t);
      z = xc[2];
      if (0 <= z && z <= 7.5)
        C_UDSI(c, t, 3) = 295.00;
      else if (7.5 < z && z <= 12)
        C_UDSI(c, t, 3) = 295.00 - 0.05 * (z - 7.5);
 else
        C_UDSI(c, t, 3) = 294.775;
    }
    end_c_loop_all(c, t)
  }
}
After I initialize, I expect a temperature value of 295 at top, and a change in the region 7.5-12 m, and a constant 294.775 after that, However, when I view it I get the following.
February 28, 2022 at 4:44 pmRob
Forum ModeratorWhat size is the model? UDFs use SI so z is in metres.
February 28, 2022 at 5:44 pmDilini
Subscriberz is going from 0 to 55 meters. x is going from 0 to 150,000 m. In the contour plot I have used a scaling factor of 0.001 for x.
March 1, 2022 at 1:15 pmRob
Forum ModeratorCan you change the scale and plot with node values off? Just realised that 294.775 rounds to 2.95e2 ie the plot is correct but you've not got sufficient digits on the plot to show it.
Viewing 3 reply threads- The topic ‘Temperature initialization issue’ is closed to new replies.
Ansys Innovation SpaceTrending discussionsTop Contributors-
2788
-
965
-
851
-
599
-
591
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.
-