|January 17, 2011, 10:40||
Change cell zone index/thread during simulation
Join Date: Mar 2010
Posts: 34Rep Power: 7
I am modelling a shrinking porous zone within a fluid zone. The porous zone will be shrinking as the simulation proceeds. The porosity change is both time and space dependent and will change from 0 to 1 during the simulation. Cells nearest the fluid-porous interface will reach 1 the quickest.
Basically, when the porosity in a cell reaches 1 I want to change the cell zone index to that of the fluid zone. This will effectively cause the porous zone to shrink. I realise I could just change the momentum sinks to 0 which would basically do the same thing but this approach is necessary as I want to be able to distinguish between the porous and fluid threads in order to implement a reaction on the surface of the porous zone. I have tried the following but it hasn't worked:
static int porous_zone_ID = 6; /*points to the porous thread*/
static int fluid_zone_ID = 5; /*points to the fluid thread*/
Thread *tp; /*pointer to porous zone thread*/
Thread *tf; /*pointer to fluid zone thread*/
tp = Lookup_Thread(domain, porous_zone_ID);
tf = Lookup_Thread(domain, fluid_zone_ID);
begin_c_loop_int (c, tp)
if (C_UDMI(c,tp,0) = 1.0) /*the porosity in each cell has been stored in UDM 0 from a different UDF*/
zone_ID = THREAD_ID(tf); /*should change the cell zone to that of the fluid zone*/
/*Note: the macro above is the opposite to the lookup thread macro*/
I have also tried hardcoding the zone_ID (i.e. zone_ID = 5), but this hasn't worked either. It appears that the zone_ID macro doesn't change the index in the solver but can only call it.
Has anyone got any ideas? It'd be much appreciated.
|Thread||Thread Starter||Forum||Replies||Last Post|
|Fluent3DMeshToFoam||simvun||OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ...||48||May 14, 2012 05:20|
|Segmentation Fault in fluent3DMeshToFoam||cwang5||OpenFOAM Bugs||23||April 13, 2011 15:37|
|Trimmed cell and embedded refinement mesh conversion issues||michele||OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ...||2||July 15, 2005 04:15|
|Phase Change Simulation||JoHn@||Main CFD Forum||0||December 19, 2003 19:30|
|How to put a cell in a different zone||Bikash||Main CFD Forum||0||October 24, 2003 12:49|