Etienne Rivard | 18 Jul 12:57

Front-fixing method for moving boundary problem


Hi Jonathan and Daniel,

Jonathan, although I'm starting a new thread here, I first want to thank 
you for your once again very complete answer on the use of operator 
variables to get access to additional functions. I'm not 100\% sure yet 
whether I'll need to use one of those. Nevertheless, I found your answer 
extremely useful, it helped me a lot to understand more of the mechanics 
of FiPy.

Now, I'd like to have your thoughts on another aspect of my problem 
which is basically a Stefan problem or a free or moving boundary 
problem, whatever you like to call it. I want to use a front-fixing 
method to alleviate the moving boundary difficulty. Basically, I do a 
coordinate transformation to get a non-dimensional space coordinate, 
which allows me to use regular boundary conditions. However, this 
results in an additional ODE that needs to be solved along with the PDEs.

Here is an example, not the problem I want to solve, but the idea is the 
same:

\[
\frac{\partial^2 u}{\partial \xi ^2} = s^2 \frac{\partial u}{\partial t}
- s \xi \frac{ds}{dt}\frac{\partial u}{\partial \xi}
\]

where $\xi$ is the non-dimensional space coordinate, $s = s(t)$ and
\[
-\frac{1}{s} \left. \frac{\partial u}{\partial \xi}\right|_{\xi = 1}
= \frac{ds}{dt}
(Continue reading)

Jonathan Guyer | 18 Jul 18:30

Re: Front-fixing method for moving boundary problem


On Jul 18, 2008, at 6:59 AM, Etienne Rivard wrote:

> Jonathan, although I'm starting a new thread here, I first want to  
> thank you for your once again very complete answer on the use of  
> operator variables to get access to additional functions. I'm not  
> 100\% sure yet whether I'll need to use one of those. Nevertheless,  
> I found your answer extremely useful, it helped me a lot to  
> understand more of the mechanics of FiPy.

I'm glad it was helpful. Now we just need to figure out how to  
properly document it and make it a bit more transparent for users to  
actually do.

> Now, I'd like to have your thoughts on another aspect of my problem  
> which is basically a Stefan problem or a free or moving boundary  
> problem, whatever you like to call it. I want to use a front-fixing  
> method to alleviate the moving boundary difficulty.

We wrote FiPy for solving phase field and level set problems, because  
we didn't ever want to think about "the moving boundary difficulty"! 8^)

> Here is an example, not the problem I want to solve, but the idea is  
> the same:
>
> \[
> \frac{\partial^2 u}{\partial \xi ^2} = s^2 \frac{\partial u} 
> {\partial t}
> - s \xi \frac{ds}{dt}\frac{\partial u}{\partial \xi}
> \]
(Continue reading)

Etienne Rivard | 20 Jul 13:35

Re: Front-fixing method for moving boundary problem


Jonathan Guyer wrote:
> 
> 
> On Jul 18, 2008, at 6:59 AM, Etienne Rivard wrote:
> 
>> Jonathan, although I'm starting a new thread here, I first want to 
>> thank you for your once again very complete answer on the use of 
>> operator variables to get access to additional functions. I'm not 
>> 100\% sure yet whether I'll need to use one of those. Nevertheless, I 
>> found your answer extremely useful, it helped me a lot to understand 
>> more of the mechanics of FiPy.
> 
> I'm glad it was helpful. Now we just need to figure out how to properly 
> document it and make it a bit more transparent for users to actually do.

I'll trust you on that ;-)

> 
> 
> 
>> Now, I'd like to have your thoughts on another aspect of my problem 
>> which is basically a Stefan problem or a free or moving boundary 
>> problem, whatever you like to call it. I want to use a front-fixing 
>> method to alleviate the moving boundary difficulty.
> 
> We wrote FiPy for solving phase field and level set problems, because we 
> didn't ever want to think about "the moving boundary difficulty"! 8^)

Right. I remember once considering swithcing to another method like the 
(Continue reading)

Jonathan Guyer | 21 Jul 16:17

Re: Front-fixing method for moving boundary problem


On Jul 20, 2008, at 7:35 AM, Etienne Rivard wrote:

> Right. I remember once considering swithcing to another method like  
> the phase field method to solve my problem. But I have to admit I  
> was somewhat demotivated by the apparent complexity of the method.  
> For the moment, I don't think I'll get deeper into that.

chacun à son goût

> Thanks for the offer, I appreciate it but. I have time to work on  
> this and this actually a part of my PhD work so I need to show a  
> deep understanding of everything I use, so I would rather shoot for  
> a more elegant solution.

Understood. When you get it done, if you wanted to contribute said  
elegant solution to FiPy, we'd be delighted.

Etienne Rivard | 22 Sep 08:59

Re: Front-fixing method for moving boundary problem


Hello everyone,

Jonathan, I think I have found a way to do what I want to do. I tested 
it and it works. It probably falls into the "ugly hack" category, but I 
like it because it's really simple and seems to work fine.

So, what I do is I include the line of code where I define the equation 
inside the solution loop along with my self-made and very basic 
Runge-Kutta-Fehlberg ODE solver. Which results in something like:

while res > tolRes:
     grad = (temp.getHarmonicFaceValue()[-1] - 

             temp.getHarmonicFaceValue()[-2]) / dx
     dSdt = intRecRate(elapsed, Snew, grad)
     eq = TransientTerm()
          == ImplicitDiffusionTerm(coeff=K/(c*rho*Snew**2)) \
          - ExponentialConvectionTerm(xi/Snew * dSdt) \
          - temp / Snew * dSdt
     res = eq.sweep(var=temp,
                    boundaryConditions=BCs,
                    dt=dt,
                    solver=solver)
     grad = (temp.getHarmonicFaceValue()[-1]
             - temp.getHarmonicFaceValue()[-2]) / dx
     resODE = RKF45(lambda t, S: intRecRate(t, S, grad), 0, S, dt)

This probably won't beat any records of speed, but I'm not after that 
for the moment.
(Continue reading)

Jonathan Guyer | 22 Sep 17:11

Re: Front-fixing method for moving boundary problem


On Sep 22, 2008, at 2:59 AM, Etienne Rivard wrote:

> Jonathan, I think I have found a way to do what I want to do. I  
> tested it and it works. It probably falls into the "ugly hack"  
> category, but I like it because it's really simple and seems to work  
> fine.

I'll need to go back and refresh myself on what you were trying to do,  
but thanks for sending this in.

> So, what I do is I include the line of code where I define the  
> equation inside the solution loop along with my self-made and very  
> basic Runge-Kutta-Fehlberg ODE solver. Which results in something  
> like:
:
:
> This probably won't beat any records of speed, but I'm not after  
> that for the moment.

Interesting. It won't much (any?) difference in speed, but I'd be  
inclined to write this as:

dSdt = Variable()
eq = TransientTerm() \
         == ImplicitDiffusionTerm(coeff=K/(c*rho*Snew**2)) \
         - ExponentialConvectionTerm(xi/Snew * dSdt) \
         - temp / Snew * dSdt
while res > tolRes:
    grad = (temp.getHarmonicFaceValue()[-1] -
(Continue reading)


Gmane