Ansys Assistant will be unavailable on the Learning Forum starting January 30. An upgraded version is coming soon. We apologize for any inconvenience and appreciate your patience. Stay tuned for updates.

Ansys Learning Forum Forums Discuss Simulation Fluids Remove parcels at defined cell zone Reply To: Remove parcels at defined cell zone

Holzmann
Subscriber
Hey everybody, I found the solution:
However, the only non-dynamic thing is that I have the cell-zone-id hard-coded. Is there a way to set it via TUI ?

DEFINE_DPM_SCALAR_UPDATE(parcelRemoval, c, t, initialize, tp)
{
if (initialize)
{
// Fluid domain
Domain *domain = Get_Domain(1);

// Cell zone id
int Cell_Zone_ID = 598;

cell_t cCZ;
Thread *tCZ = Lookup_Thread(domain, Cell_Zone_ID);

// Looping over all cells of the cell zone
begin_c_loop(cCZ, tCZ)
{
// Check if cCZ == c -> parcel inside
if (cCZ == c)
{
MARK_TP(tp, P_FL_REMOVED);
}
}
end_c_loop(cCZ, tCZ)
}
}

[bingo_chatbox]