CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

Change cell zone index/thread during simulation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 17, 2011, 10:40
Default Change cell zone index/thread during simulation
  #1
Member
 
Neil Duffy
Join Date: Mar 2010
Posts: 34
Rep Power: 16
neilduffy1024 is on a distinguished road
Hi,

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*/

DEFINE_ADJUST(adjust_thread, domain)
{
cell_t c;
Thread *tp; /*pointer to porous zone thread*/
Thread *tf; /*pointer to fluid zone thread*/
int zone_ID;
real x[ND_ND];

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*/
}
}
end_c_loop_int (c,tp)
}



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.

Thanks,

Neil
neilduffy1024 is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Commercial meshers] Fluent3DMeshToFoam simvun OpenFOAM Meshing & Mesh Conversion 50 January 19, 2020 16:33
Segmentation Fault in fluent3DMeshToFoam cwang5 OpenFOAM Bugs 23 April 13, 2011 16:37
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Meshing & Mesh Conversion 2 July 15, 2005 05: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 13:49


All times are GMT -4. The time now is 00:34.