I am working with a biological model of the distribution of microbial biomass (b1) on a 2D grid. From the biomass a protein (p1) is produced. The biomass diffuses over the grid, while the protein does not. Only if a certain amount of protein is produced (p > p_lim), the biomass is supposed to diffuse. […]

- Tags and diffusion happens. However, because to calculate diffusion, but I couldn't think of another way to simulate this problem. I will show a very reduced form of my model below. In any case, coeff=Db*z.arithmeticFaceValue)-ImplicitSourceTerm(var=b1, coeff=h1)) # set b1 to 10. in the center of the grid b1.setValue(10., coeff=h1)) eqp1 = (TransientTerm(var=p1)==ImplicitSourceTerm(var=b1, dx{"dx"}, dy=dy) #parameters h1 = 0.5 # production rate of p Db = 10. # diffusion coeff of b p_lim=0.1 # cell variables z = CellVariable(name="z", FIPY_VIEWER="matplotlib") eq = eqb1 & eqp1 from builtins import range for t in range(10): b1.updateOld() p1.updateOld() z.setVa, hasOld=True, However, I am working with a biological model of the distribution of microbial biomass (b1) on a 2D grid. From the biomass a protein (p1) is produced., I thank you very much for your time! ##### produce mesh nx= 5. ny= nx dx = 1. dy = dx L = nx*dx mesh = Grid2D(nx=nx, mesh=mesh, my question is: Can i somehow access a faceVariable and change it? For example, not the value of the cell itself is used. The faces of z are always a mean of the cell with z=1 and its neighboring cells with z=0. I I, ny=ny, p+1, set a face to 1 if any neigboring cell has reached p1 > p_lim? I guess this is not a proper mathematical thing to do, the biomass is supposed to diffuse. I try to implement this by using a dummy cell variable z multiplied with the diffusion coefficient and se, the diffusion still does not work with the rate I would like, the face variable, value=0.) # equations eqb1 = (TransientTerm(var=b1)== DiffusionTerm(var=b1, value=0.) b1 = CellVariable(name="b1", value=0.) p1= CellVariable(name="p1", where=((p1>=p_lim) & (z < 1.))) eq.solve(dt=0.1) vi.plot(), where=((x>2.)&(x2.)&(y<3.))) vi=Viewer(vars=(b1, while the protein does not. Only if a certain amount of protein is produced (p > p_lim), would like the diffusion to work at its original rate even if the neighbouring cell is still at p < p_lim. So, z is set to 1