Trevor M Cickovski | 9 Jun 2006 17:19
Picon
Favicon

Question about Implicit Diffusion


Hi,
I am trying to run your implicit diffusion solver on a 2D 500x500 mesh.  
However, I would like to repeatedly run this solver to evolve the same 
mesh, without losing previous values.  So for example:

mesh = Grid2D(dx = 0.000002, nx=500, ny=500)
var = CellVariable(name="solution variable", mesh=mesh, value=0)

if __name__ == '__main__':
   i = 0
   while (i < steps):
      # <do something to var>
      ImplicitDiffusionTerm(coeff = 1).solve(var, dt=2)
      # <do something else to var>
      i = i + 1

However, I can't currently do this because whenever I call the solve() 
method, it resets 'var' to all zeros.  Is there anyway I can stop this 
from happening?  Appreciate it!

Best,
Trevor

--

-- 
-------------------------------------------------------
This is your time, this is your dance
Live every moment, leave nothing to chance.
Swim in the sea, drink of the deep
Embrace the mystery of all you can be.
(Continue reading)

Jonathan Guyer | 9 Jun 2006 19:44
Favicon

Re: Question about Implicit Diffusion


On Jun 9, 2006, at 11:19 AM, Trevor M Cickovski wrote:

>
> Hi,
> I am trying to run your implicit diffusion solver on a 2D 500x500  
> mesh.  However, I would like to repeatedly run this solver to  
> evolve the same mesh, without losing previous values.  So for example:
>
> mesh = Grid2D(dx = 0.000002, nx=500, ny=500)
> var = CellVariable(name="solution variable", mesh=mesh, value=0)
>
> if __name__ == '__main__':
>   i = 0
>   while (i < steps):
>      # <do something to var>
>      ImplicitDiffusionTerm(coeff = 1).solve(var, dt=2)
>      # <do something else to var>
>      i = i + 1
>
> However, I can't currently do this because whenever I call the solve 
> () method, it resets 'var' to all zeros.  Is there anyway I can  
> stop this from happening?  Appreciate it!

We probably need to know a bit more about what's involved in <do  
something to var> and <do something else to var>, but I think I can  
guess what's happening to you. If I'm right, then we discuss this  
situation near the beginning of Example 9.1, phase.simple.  The  
source term of the phase equation isn't important here; it's the  
behavior of trying to solve a steady-state diffusion term that causes  
(Continue reading)


Gmane