You're over-complicating things trying to have three different temperatures. 
There's one temperature in three different domains, with different material 
properties in each domain. FiPy (and physics) takes care of matching fluxes for 
you at the internal boundaries.


The changes I made are at 
https://gist.github.com/guyer/d86ee6f085e9832df781286099a73800/revisions

The primary changes I made:

- I defined three domains, `air`, `wall`, and `PCM`, and then defined `T`, 
`rho`, `Cp`, and `k` to have different values in those different domains.

- sweeps are for getting better convergence of non-linear equations. 
Your equations are linear and from your usage you want time steps, not sweeps.
See: 
https://www.ctcms.nist.gov/fipy/documentation/FAQ.html#iterations-timesteps-and-sweeps-oh-my

- Internal boundary conditions need to be defined very differently (see: 
https://www.ctcms.nist.gov/fipy/documentation/USAGE.html#applying-internal-boundary-conditions)
Importantly, you don't need internal boundary conditions. 

- All field variables and coefficients should be floats, not integers.


Note: Your wall thickness `tw = 0.001` is smaller than your grid spacing `dx = 
0.061 / 50 = 0.00122`, your your numerics will be terrible. Increase your wall 
thickness or decrease your grid size.

> On Apr 8, 2019, at 2:44 PM, Daniel DeSantis <desan...@gmail.com> wrote:
> 
> Hello,
> 
> I am trying to model heat diffusion through a wall using FiPy. Essentially, 
> hot air on one side of the wall would heat the wall, and the wall would 
> subsequently heat a phase change material on the other side (See picture 
> below). The eventual goal would be to have the phase change material 
> properties change as the heat increases. I am having a few issues with 
> setting boundary conditions however. 
> 
> The goal of the model would be to have the heat flux at the wall be equal to 
> the heat flux of the fluid on each respective side. Further, the heat flux of 
> one of the fluids (a phase change material) would be 0 at the side not in 
> contact with the wall. (I've included a copy of my FiPy code as is, and a 
> series of equations and boundary conditions below).
> 
> Right now, the temperature for the air and wall are staying constant, while 
> the phase change material temperature drops. I think how I've defined the 
> boundary conditions are to blame, but I'm not sure what I'm doing wrong. Any 
> help here would be greatly appreciated.
> 
> Thank you,
> 
> -- 
> Daniel DeSantis
> 
> <image.png>
> <image.png>
> <image.png>
> <image.png>
> 
> <PCM_thermal_v0-SendOut.py>_______________________________________________
> fipy mailing list
> fipy@nist.gov
> http://www.ctcms.nist.gov/fipy
>  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]


_______________________________________________
fipy mailing list
fipy@nist.gov
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]

Reply via email to