[FLASH-USERS] Grid_bcApplyToRegionSpecialized
    turcotte 
    turcotte at apollo.ubishops.ca
       
    Thu Aug 20 11:25:30 EDT 2009
    
    
  
Hello all,
I am having problems using Grid_bcApplyToRegionSpecialized for a user
defined BC. 
In the simplest case I am trying to reproduce what is done by 
Grid_applyBCEdge in Grid_bcApplyToRegionSpecialized, while keeping the routine 
as general as possible to change it to a more complicated BC.
For a 2D box in cylindrical coordinates, applying the BC on the x=0 boundary,
I loop thusly:
  applied=.true.
  
  sizeX=regionSize(BC_DIR)
  allocate(xCoord(sizeX))
  sizeY=regionSize(2)
  allocate(yCoord(sizeY))
  call Grid_getCellCoords(IAXIS,blockID,CENTER,.true.,xCoord,sizeX)
  call Grid_getCellCoords(JAXIS,blockID,CENTER,.true.,yCoord,sizeY)
  do j = 1,sizeY
     do i = 1,sizeX
        regionData(i,j,:,VELY_VAR) = value
          ! where value will be a function of xCoord(i) and yCoord(j)
     enddo
  enddo
          
It works partly, but I have some data points, especially at cell boundaries
where the BC does not hold value it should. If I make my BC a function of
xCoord and yCoord then its behaviour worsens, which suggests I am missing 
something in the way the mesh is structured?
I have also tried wrinting the loop as
  do i = 1,guard
    regionData(i,:,:,VELY_VAR) = value
  enddo
which works better but still has some problems for some variables.
Thanks.
Sylvain
    
    
More information about the flash-users
mailing list