Friday, September 27, 2013
Python Software Foundation  SfePy : GSoC 2013 : The Begining!
Monday, September 16, 2013
Python Software Foundation  SfePy : GSoC 2013 : The Final Lap
Thursday, September 12, 2013
Python Software Foundation  SfePy : GSoC 2013 : Week 12 & 13
Hi Pythonistas,
PS: I will get a bit informal in today's report. Do forgive me for that.
Past 14 days have given me the best coding experience of my lifetime. After doing rigorous research I had formalized my problem statement earlier and started working on it. I realised the true intricacies in my problem when I started searching for methods by which phase change simulations are implemented. I had to change my earlier timeline and jump to my project problem directly. This field is a relatively new field and the algorithms have been developed surrounding the legacy SIMPLE algorithm by Patankar. From Brent, A.D., Voller, V.R. and Reid, K.J.(1988) to Chakraborty, P R and Dutta, P (2011), people have developed the enthalpy update scheme for accounting phase change keeping Patankar's algorithm as the base. I was familiar with SIMPLE algorithm earlier so I have developed a phase change solver for SfePy using SemiImplicit Method for Pressure Linked Equations (Revised) or SIMPLER algorithm which is much more robust than SIMPLE algorithm.
The solver code is located here.
Download test problem file here.
Run python brent_test.py
You will get an output dir containing the vtk files which can be viewed using
./postproc.py <file>.vtk
Sample:
The entire group can be loaded in Paraview and you can get the animation.
The code has been validated for the melting gallium experiment performed by Gau and Viskanta(1986) & Brent et al.(1988).
You can see that the code is following the trend and the difference is due to the slight change in thermophysical properties of Gallium taken in the code which might be different while performing the experiments.
Do leave your views in the comments below.
Regards,
Ankit
PS: I will get a bit informal in today's report. Do forgive me for that.
Past 14 days have given me the best coding experience of my lifetime. After doing rigorous research I had formalized my problem statement earlier and started working on it. I realised the true intricacies in my problem when I started searching for methods by which phase change simulations are implemented. I had to change my earlier timeline and jump to my project problem directly. This field is a relatively new field and the algorithms have been developed surrounding the legacy SIMPLE algorithm by Patankar. From Brent, A.D., Voller, V.R. and Reid, K.J.(1988) to Chakraborty, P R and Dutta, P (2011), people have developed the enthalpy update scheme for accounting phase change keeping Patankar's algorithm as the base. I was familiar with SIMPLE algorithm earlier so I have developed a phase change solver for SfePy using SemiImplicit Method for Pressure Linked Equations (Revised) or SIMPLER algorithm which is much more robust than SIMPLE algorithm.
The solver code is located here.
Download test problem file here.
Run python brent_test.py
You will get an output dir containing the vtk files which can be viewed using
./postproc.py <file>.vtk
Sample:
The entire group can be loaded in Paraview and you can get the animation.
The code has been validated for the melting gallium experiment performed by Gau and Viskanta(1986) & Brent et al.(1988).
You can see that the code is following the trend and the difference is due to the slight change in thermophysical properties of Gallium taken in the code which might be different while performing the experiments.
Do leave your views in the comments below.
Regards,
Ankit
Phase Change Solver  SfePy GSoC 2013
Tuesday, September 3, 2013
Python Software Foundation  SfePy : GSoC 2013 : Week 10 & 11
The ﬁnal problem accounting convectiondiﬀusion along with phase change has been deﬁned below along with the governing equations and validation case studies.
Problem
Heat transfer in the processing of materials involving solidliquid phase transformations (melting and solidiﬁcation) is commonplace in such ﬁelds as metallurgy, crystal growth from melts and solutions, puriﬁcation of materials, and solidiﬁcation of metals. The associated density gradients in a gravitational ﬁeld can induce natural convection ﬂows. Convection in the liquid phase inﬂuences the process in two diﬀerent ways, one of which is beneﬁcial and the other of which can be detrimental. During melting convection increases the overall transport rate and, hence, the growth rate of the new phase, which is desirable. On the other hand, during solidiﬁcation convection decreases the growth of the new phase and also seems to aﬀect the morphology of the solidliquid interface adversely. The nature of the solid is largely determined by what occurs in the vicinity of the solidliquid interface. The heat release (absorption), density change, and other processes that take place in the vicinity of the transformation front result in nonuniformities along the front that cause its shape to change. The resulting density gradients in the liquid generate buoyancydriven convection that can aﬀect the transport of heat, constituent chemicals, and the growth rate.
The physical domain considered is shown in the ﬁgure. The vertical side walls of the enclosure are maintained at uniform temperatures, while the connecting horizontal walls are adiabatic. The govering equations are written for the entire domain assuming constant thermophysical properties, Boussinesq approximation, laminar, incompressible, and Newtonian twodimensional ﬂow. The solidliquid interface motion due to volume change upon melting or solidiﬁcation is neglected through the assumption {\rho}_{s}={\rho}_{l}.
Nomenclature
\rho

Density

kg/m{}^{3}

\mu

Viscosity

Pa.s

{c}_{p}

Speciﬁc heat capacity

J/kg.K

k

Thermal conductivity

W/m.K

\beta

Thermal expansion coeﬃcient

1/K

L

Latent heat of fusion

J/kg

H

Enthalpy

J/kg

f

Volume fraction
 
T

Temperature

{}^{\circ}C

t

Time

s

\overrightarrow{u}

Velocity

m/s

p

Pressure

Pa

S

Source term

m/s{}^{2}

Subscript
l

Liquid

s

Solid

ref

Reference

eff

Eﬀective

hot

Hot

cold

Cold

int

Initial

melt

Melting

Governing Equations
The continuum relations:
{g}_{l}+{g}_{s}=1
{f}_{l}+{f}_{s}=1
{f}_{l}=\frac{{g}_{l}{\rho}_{l}}{\rho}
{f}_{s}=\frac{{g}_{s}{\rho}_{s}}{\rho}
\rho ={g}_{l}{\rho}_{l}+{g}_{s}{\rho}_{s}
\overrightarrow{u}={f}_{l}{\overrightarrow{u}}_{l}+{f}_{s}{\overrightarrow{u}}_{s}
{k}_{e}ff={g}_{l}{k}_{l}+{g}_{s}{k}_{s}
{c}_{p}={f}_{l}{c}_{{p}_{l}}+{f}_{s}{c}_{{p}_{s}}
1. Continuity
\nabla \cdot \left(\overrightarrow{u}\right)=0
2. Momentum
\rho "["\frac{\partial \overrightarrow{u}}{\partial t}+\overrightarrow{u}\cdot \nabla \overrightarrow{u}"]"=\nabla p+\mu {\nabla}^{2}\overrightarrow{u}+\rho \overrightarrow{g}\beta \left(T{T}_{ref}\right)+B\overrightarrow{u}
Now the key lies in modelling the source term. The coeﬃcient B which should tend to 0 as the liquid volume fraction {g}_{l} approaches unity, and should become a large negative number to anhilate the motion in the ﬂuid region at {g}_{l}=0. Whereas these asymtotic conditions can be satisﬁed by several functions, we adopt the suggestion of Brent et al. :
B=\frac{C{\left(1{g}_{l}\right)}^{2}}{\left({g}_{l}^{3}+b\right)}
where
C=1.6\times 1{0}^{6}
b=0.001
2. Energy
Writing a general equation for conservation of thermal energy for all the zones in the domain is facilitated by focusing on an element undergoing phase change. Below are the energy equation of solid and liquid phases under the thermal equilibrium condition {T}_{l}={T}_{s}=T:
Solid
\frac{\partial \left({\rho}_{s}{g}_{s}{H}_{s}\right)}{\partial t}+\nabla \cdot \left({\rho}_{s}{g}_{s}\overrightarrow{{u}_{s}}{H}_{s}\right)=\nabla \cdot \left({g}_{s}{k}_{s}\nabla T\right)+{S}_{s}
Liquid
\frac{\partial \left({\rho}_{l}{g}_{l}{H}_{l}\right)}{\partial t}+\nabla \cdot \left({\rho}_{l}{g}_{l}\overrightarrow{{u}_{l}}{H}_{l}\right)=\nabla \cdot \left({g}_{l}{k}_{l}\nabla T\right)+{S}_{l}
where {S}_{s}
and {S}_{l}
are the interphase energy terms, having the same magnitude but being opposite in
sign.
A single governing enthalpy equation results:
A single governing enthalpy equation results:
\frac{\partial \left(\rho {H}_{m}\right)}{\partial t}+\nabla \cdot \rho \left({f}_{s}\overrightarrow{{u}_{s}}{H}_{s}+{f}_{l}\overrightarrow{{u}_{l}}{H}_{l}\right)=\nabla \cdot \left({k}_{eff}\nabla T\right)
where
{H}_{m}={f}_{s}{H}_{s}+{f}_{l}{H}_{l}={H}_{s}+{f}_{l}\left({H}_{l}{H}_{s}\right)
The latent heat content of the element is due to the fraction of liquid converted
to, or from, the corresponding quantity of solid. Hence we write
\Delta H={f}_{l}\left({H}_{l}{H}_{s}\right)={f}_{l}L
{H}_{m}={H}_{s}+{f}_{l}L
{H}_{s}={c}_{p}T
{H}_{l}={H}_{s}+L
where L is the latent heat of fusion.
The zones where T{T}_{melt}, the entire element is in the liquid state and {f}_{l}=1.
The zones where T{T}_{melt}, the entire element is in the liquid state and {f}_{l}=0.
It is the elements undergoing phase change at T={T}_{melt}, where {f}_{l} varies between 0 and 1. Substituting {H}_{m} and {H}_{l} in equation we get
The zones where T{T}_{melt}, the entire element is in the liquid state and {f}_{l}=1.
The zones where T{T}_{melt}, the entire element is in the liquid state and {f}_{l}=0.
It is the elements undergoing phase change at T={T}_{melt}, where {f}_{l} varies between 0 and 1. Substituting {H}_{m} and {H}_{l} in equation we get
\frac{\partial \left(\rho H\right)}{\partial t}+\nabla \cdot \left(\rho \overrightarrow{u}H\right)=\nabla \cdot \left(\frac{{k}_{eff}}{{c}_{p}}\nabla H\right){S}_{e}
where
\overrightarrow{u}={f}_{l}\overrightarrow{{u}_{l}}
{S}_{e}=\frac{\partial \left(\rho \Delta H\right)}{\partial t}=\rho L\frac{\partial \left({f}_{l}\right)}{\partial t}
Initial Conditions
{f}_{l}=0 everywhere
T={T}_{int} everywhere
\overrightarrow{u}=0 everywhere.
Boundary Conditions
{f}_{l}=1 Left wall
{f}_{l}=0 Right wall
{f}_{l}\left[i\right]\left[j\right]={f}_{l}\left[i1\right]\left[j\right] Top
{f}_{l}\left[0\right]\left[j\right]={f}_{l}\left[1\right]\left[j\right] Bottom
T={T}_{hot} Left wall
T={T}_{cold} Right wall
\overrightarrow{u}=0 Walls
Validation Cases
Melting Gallium : Gau and Viskanta
Melting Gallium : Brent et al.
Melting Calcium chloride : Zivkovic and Fujii
References
 Zivkovic, B., Fujii, I., 2001. “An Analysis of Isothermal Phase Change of Phase Change Material within Rectangular and Cylindrical Containers”. Solar Energy, 70, pp. 5161.
 Brent, A.D., Voller, V.R., Reid, K.J., 1988. “Enthalpyporosity Technique for Modeling Convectiondiﬀusion Phase Change: Application to the Melting of a Pure Metal”. Numerical Heat Transfer, 13(3), pp. 297318.
 Gau, C., Viskanta, R., 1986. “Melting and Solidiﬁcation of a Pure Metal on a Vertical Wall”. Journal of Heat Transfer, 108(1), pp. 174181.
 Rajeev, K., Das, S., 2010. “A Numerical Study for Inward Solidiﬁcation of a Liquid Contained in Cylindrical and Spherical Vessel”. Thermal Science, 14(2), pp. 365372.
 Vreeman, C. J., Krane, M. J. M., Incropera, F. P. , 2000. “The Eﬀect of FreeFloating Dendrites and Convection on Macrosegregation in Direct Chill Cast Aluminum Alloys. Part 1: Model Development”. Int. J. Heat Mass Transfer, 43, pp. 677686.
 Flemings, M. C., 1974. Solidiﬁcation Processing. McGrawHill, New York.
 Kumar, A., Walker, M. J., Sundarraj, S., Dutta, P., 2011. “Grain Floatation During Equiaxed Solidiﬁcation of an AlCu Alloy in a SideCooled Cavity: Part IINumerical Studies”. Metallurgical and Materials Transactions, 42(B), pp. 783799.
 Voller, V.R., 2006. Handbook of Numerical Heat Transfer, 2nd ed.. Wiley, New York, NY, pp. 593622.
Reactions: 
Subscribe to:
Posts (Atom)