-
-
January 26, 2024 at 10:46 amAlbertoSubscriber
Hi community, I would ask a question about density distribution with UDF file.
I'm trying to simulate the falling descent of a solid body in air with overset mesh and 6-dof solver. Everithing is well setted up and if i use a constant value for the solid density in fluent no problems occurs.
 I would like to consider a body with different density distribution, for example rho = 40 if the cell thickness is below a threshold and rho =430 if it is above. I've write the following UDF and fluent allow to compile and assign to the material density, but when i look at the density contours in CFD post the value on the solid body is uniform and equal to 1.225 (air density). How can I check the real density of the solid ?Â
UDF:
#include "udf.h"
DEFINE_PROPERTY(density, c, t)
{
  real ro;
  real x[ND_ND];
  real thickness;
  int isWallObject;
  Domain* domain;  /* Ottieni il dominio */
  domain = Get_Domain(1);  /* Verifica se la faccia è associata alla name selection "wall-object" */
  isWallObject = (C_FACE_THREAD(c, t) == Lookup_Thread(domain, "wall-object")) ? 1 : 0;  if (isWallObject)
  {
    C_CENTROID(x, c, t);
    thickness = C_VOLUME(c, t) / C_FACE_AREA(c, t);    if (thickness < 0.000353)
      ro = 40;
    else
      ro = 430;
  }
  else
  {
    ro = 1.225;
  }  return ro;
}Â
Many thanks
-
January 29, 2024 at 12:16 pmRobForum Moderator
If you're setting a material property why do you need to also set that property to 1.225 kg/m3? I can understand some compression effect on a wall, so 40 or 430, but not the reason for the second IF.Â
-
January 29, 2024 at 1:42 pmAlbertoSubscriber
This is becouse if the cell is not in "wall-object", then set the fluid density which is 1.225. I can also remove that but the results dont change.
-
-
January 29, 2024 at 1:51 pmRobForum Moderator
OK, but you're setting a material property. For a solid (or wall) that's the solid material type, default is aluminium. So if the solid zone is of a certain thickness there's no need for the gas property.Â
-
January 29, 2024 at 1:54 pmAlbertoSubscriber
Ok, but i don't have the aluminium as material, i've load this udf file and fluent accept it as material property. I want density = 40 when i'm moving over the object surface where the cell are susbatially 2D, then i want 430 when their 3D. This is the way I'm trying to set material properties. Does it work?
-
January 29, 2024 at 6:30 pmAlbertoSubscriber
in SpaceClaim i’ve set HDPE, then in Fluent aluminium
-
-
January 29, 2024 at 2:19 pmRobForum Moderator
The wall must be a solid material, and the flowing volumes are fluid. So, the UDF will hook to the solid material and then the solid is assigned to the wall.Â
-
January 29, 2024 at 2:37 pmAlbertoSubscriber
Sure, this is what my UDF does, right? But i have two different density values for the same object.Â
-
-
January 29, 2024 at 3:22 pmRobForum Moderator
What material is it attached to?Â
-
January 29, 2024 at 6:36 pmAlbertoSubscriber
in SpaceClaim i’ve set HDPE, then in Fluent aluminium
-
-
January 30, 2024 at 10:26 amRobForum Moderator
Â
OK, and you attached the UDF to the aluminium? Is the region you're setting a wall or a solid zone? A wall doesn't see the neighbouring cell volume unless you tell it to: there's a bit in the UDF manual on adjacent face/cell/node syntax.
Â
-
January 30, 2024 at 10:49 amAlbertoSubscriber
It is a solid zone, obtained through a boolean subtraction where the tool is the solid and the target the fluid volume.
Yes it is attached to the aluminium material as user-defined input
-
January 30, 2024 at 11:41 amRobForum Moderator
And the solid zone isn't a wall. You may need to loop over the cells and adjacent wall thread (or the other way round) to get the thickness for your material definition.Â
-
- The topic ‘Variable density for solid object’ is closed to new replies.
- Non-Intersected faces found for matching interface periodic-walls
- Unburnt Hydrocarbons contour in ANSYS FORTE for sector mesh
- Help: About the expression of turbulent viscosity in Realizable k-e model
- Cyclone (Stairmand) simulation using RSM
- error udf
- Diesel with Ammonia/Hydrogen blend combustion
- Fluent fails with Intel MPI protocol on 2 nodes
- Mass Conservation Issue in Methane Pyrolysis Shock Tube Simulation
- Script error Code: 800a000d
- Encountering Error in Heterogeneous Surface Reaction
-
1191
-
513
-
488
-
225
-
209
© 2024 Copyright ANSYS, Inc. All rights reserved.