Ansys Learning Forum › Forums › Discuss Simulation › Fluids › Remove parcels at defined cell zone › Reply To: Remove parcels at defined cell zone
July 28, 2021 at 7:14 pm
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)
}
}
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)
}
}