Hi Dariusz, The way to handle this is as follows. Say you have an
internal boundary condition that says

   D \frac{\partial \phi}{\partial z} = \lambda  at z = h

then you create a mask at the boundary, say 1 on the boundary and 0 elsewhere


    X, Y, Z = mesh.getFaceCenters()
   mask = FaceVariable(mesh=mesh, value=False)
   mask[Z==h] = True

Say the equation is "TransientTerm() == DiffusionTerm(D)"  then do this instead

   eqn = TransientTerm() == DiffusionTerm(D * ~mask) + (lambda * mask
* (0,1)).getDivergence()

That should apply an internal boundary along the z faces at height h.
Something like this is what you need. Cheers.

2010/5/17 Dariusz Kędzierski <[email protected]>:
>
> Thanks for fast reply,
>
> Do you have more examples of this procedure? Except point 5.5.3 from the
> manual? It would be great to have more examples.
>
> Thank you in advance.
>
> Respectfully,
> Dariusz Kedzierski
>
>>
>> Hi Dariusz, Thanks for your interest in FiPy. I would say that, in
>> general, one can incorporate these boundary conditions either as
>> changes in coefficient across material boundaries or as source terms
>> localized to cells close to the boundaries or a combination of the
>> two. You must deal with it in this way as FiPy doesn't have explicit
>> internal boundary conditions. Hope this helps.
>>
>> 2010/5/17 Dariusz Kędzierski<[email protected]>:
>>>
>>> Dear fipy users and developers,
>>>
>>> I'm beginning my adventure with computer modelling in FiPy (which is a
>>> great
>>> software), and I have some questions considering a modelling of the
>>> superlattice.
>>>
>>> I have a paraelectric/ferroelectric (PE/FE) superlattice, consist of
>>> ferroelectric and paraelectric layers. The aim of the simulation is to
>>> calculate the polarization and electrostatic potential distribution
>>> versus
>>> temperature.
>>>
>>> Because I have different sets of equations for P and \phi in PE and FE
>>> I've
>>> decided to make two meshes, one with FE layer and second with PE layer.
>>>
>>> The problem I have is to incorporate boundary conditions. I have a
>>> boundary
>>> conditions in a form (at the interface between FE and PE layers) {latex}:
>>> \begin{eqnarray}
>>>    \frac{\partial \phi^f}{\partial z} - \epsilon_p \frac{\partial
>>> \phi^p}{\partial z}&  =&  4 \pi P, \label{pefe1}\\
>>>    \phi^f&  =&  \phi^p, \label{pefe2}\\
>>>    \frac{\partial P}{\partial z}&  =&  \lambda P \label{pefe3}
>>> \end{eqnarray}
>>>
>>> The question I would like to ask is: how to incorporate those conditions
>>> and
>>> join these two meshes together.
>>>
>>> Any help would be greatly appreciated.
>>>
>>> Respectfully yours,
>>> Dariusz Kedzierski
>>>
>>>
>>
>>
>>
>
>
>



-- 
Daniel Wheeler


Reply via email to