-
-
September 9, 2024 at 12:54 pmwarhammer975Subscriber
Hello everybody!
I'm trying to simulate air movement in 2D. There is an external fixed cylinder and an internal rotating one, as well as two channels (top and bottom) for pumping air. The geometry, shaft speed and mass flow of air that enters through the shaft are known. The question is whether it is possible to simultaneously “apply” the Rotating wall and Mass-Flow-Inlet conditions to the inner cylinder (modeled so that air flows evenly, as if from the shaft (inner cylinder))? Or are there any other ways to solve the problem?
Thank you, I will be glad for any help! -
September 9, 2024 at 1:29 pmFedericoAnsys Employee
Hello,
simple answer is no, you cannot have a boundary simultaneously a wall and an inlet. What exactly are you looking to model here? You want the mass-flow to come in tangentially from the inner cylinder?
-
September 9, 2024 at 1:47 pmwarhammer975Subscriber
Hello!
Yes, I want the mass flow to be evenly distributed across the entire surface of the inner cylinder (this cylinder must rotate at a given speed) into the gap between the cylinders.
There was an idea to pump this mass flow into the first wall cells near the inner cylinder using UDF, but so far I have not been able to do this, I need more experience in this matter.
-
-
September 10, 2024 at 8:56 amRobForum Moderator
You also need to ask in one thread. https://innovationspace.ansys.com/forum/forums/topic/udf-for-mass-flow-inlet/
Hence my suggestion of a source term. But you may also need to add momentum if you need to account for the rotation speed in the mass coming into the domain.
-
September 10, 2024 at 12:59 pmwarhammer975Subscriber
I tried to write a function to determine the wall cells of the inner cylinder (id=5) for pumping air into them, but so far Fluent refuses to understand this mass flow...
#include "udf.h"DEFINE_EXECUTE_AT_END(find_first_near_wall_cells){Domain *domain;Thread *wall_thread;face_t f;cell_t c;Thread *adjacent_thread;real cell_dist;domain = Get_Domain(1);wall_thread = Lookup_Thread(domain, 5);begin_f_loop(f, wall_thread){c = F_C0(f, wall_thread);adjacent_thread = THREAD_T0(wall_thread);cell_dist = C_WALL_DIST(c, adjacent_thread);if (cell_dist < 0.001){Message("Found adjacent cell to wall at face: %d\n", c);}}end_f_loop(f, wall_thread)}DEFINE_ADJUST(adjust_mass_source, domain){Thread *t;cell_t c;real mass_flow = 2;real cell_dist;thread_loop_c(t, domain){begin_c_loop(c, t){cell_dist = C_WALL_DIST(c, t);if (cell_dist < 0.001){C_UDMI(c, t, 0) = mass_flow;}}end_c_loop(c, t)}}
-
-
September 10, 2024 at 1:17 pmRobForum Moderator
How are you adding the mass?
-
September 10, 2024 at 1:40 pmwarhammer975Subscriber
I set the value ( real mass_flow = 2;) and used this cycle to set the mass flow:
begin_c_loop(c, t){cell_dist = C_WALL_DIST(c, t);if (cell_dist < 0.001){C_UDMI(c, t, 0) = mass_flow;}}end_c_loop(c, t)}}
-
-
September 10, 2024 at 3:25 pmRobForum Moderator
That's telling a UDM a value, it's not doing anything to the DEFINE_SOURCE routine.
-
September 10, 2024 at 5:22 pmwarhammer975Subscriber
I also tried to use this function, but the result remained the same:
#include "udf.h"DEFINE_EXECUTE_AT_END(find_first_near_wall_cells){Domain *domain;Thread *wall_thread;face_t f;cell_t c;Thread *adjacent_thread;real cell_dist;/* Получаем домен */domain = Get_Domain(1);wall_thread = Lookup_Thread(domain, 5);begin_f_loop(f, wall_thread){c = F_C0(f, wall_thread);adjacent_thread = THREAD_T0(wall_thread);cell_dist = C_WALL_DIST(c, adjacent_thread);if (cell_dist < 0.001){Message("Found adjacent cell to wall at face: %d\n", c);}}end_f_loop(f, wall_thread)}DEFINE_SOURCE(mass_source, cell, thread, dS, eqn){real source;real mass_flow;real cell_dist;mass_flow = 2;cell_dist = C_WALL_DIST(cell, thread);if (cell_dist < 0.001){source = mass_flow;}else{source = 0.0;}return source;}
-
-
September 11, 2024 at 9:24 amRobForum Moderator
How big is the near wall cell?
-
September 11, 2024 at 12:50 pmwarhammer975Subscriber
3.47e-05
-
-
September 11, 2024 at 2:14 pmRobForum Moderator
That should pick up. I assume you have assigned the UDM memory and added the source to the cell zone?
-
September 11, 2024 at 2:41 pmwarhammer975Subscriber
I used "DEFINE_EXECUTE_AT_END" in Function Hooks and "DEFINE_SOURCE" in Fluid domain --> Source term
-
-
September 11, 2024 at 3:13 pmRobForum Moderator
Hmm, not sure you need the DEFINE_EXECUTE_AT_END, but you will need to assign the wall bits in the SOURCE as not sure what is passed within the code. An easier option may be to split some cells out near the wall & then just add the source into the smaller cell zone.
-
September 11, 2024 at 5:19 pmwarhammer975Subscriber
If it doesn’t bother you, can you tell me in more detail how to do this correctly?
-
-
September 12, 2024 at 3:22 pmRobForum Moderator
If you create a register (under the Adapt functions), you can then split the mesh with the register. The new cell zone can be used for the source.
-
September 13, 2024 at 1:29 pmwarhammer975Subscriber
Thank you very much, this helped me move forward in solving the problem. Can you help me with another question? How can I create a ring region of cells (with certain inner and outer radii) in the same way? I chose the "cylinder" shape in Adapt - Region, which should correspond to a ring for a two-dimensional problem, but I only get a rectangular region of cells
-
-
- You must be logged in to reply to this topic.
- Non-Intersected faces found for matching interface periodic-walls
- Script error Code: 800a000d
- Unburnt Hydrocarbons contour in ANSYS FORTE for sector mesh
- Help: About the expression of turbulent viscosity in Realizable k-e model
- Fluent fails with Intel MPI protocol on 2 nodes
- Cyclone (Stairmand) simulation using RSM
- error udf
- Diesel with Ammonia/Hydrogen blend combustion
- Mass Conservation Issue in Methane Pyrolysis Shock Tube Simulation
- Script Error
-
1281
-
591
-
543
-
524
-
366
© 2024 Copyright ANSYS, Inc. All rights reserved.