Académique Documents
Professionnel Documents
Culture Documents
and the
Exact Solution for the Two Phase
Stefan Problem
DT Project
First Things First
• We desire to formulate Two-Phase Stefan
Model of Melting and Freezing
– Non linear model
– “Moving Boundary Problem”
• Contains an unknown which is the region to be
solved…..
Why Stefan Problem???
• Interface(t>0) T ( X (t ), t ) Tm
LX '(t ) kLTx ( X (t ) , t ) kSTx ( X (t ) , t )
• Initial Condition X (0) 0
T ( x,0) Tinit Tm ,0 x l
• Boundary Condition
T (0, t ) TL Tm , t 0
k S Tx (l , t ) 0
Be Exact!
• In order to explicitly solve the Two-Phase
Problem we need to assume the slab is semi-
infinite.
• Physical Problem:
– We want to melt a semi-infinite slab, 0 x ,
initially solid at a temperature TS Tm , by imposing
temperature TL Tm , on the face x 0 .
• Interface(t>0) T ( X (t ), t ) Tm
– Stefan condtion: LX '(t ) kLTx ( X (t ) , t ) kSTx ( X (t ) , t )
x
– We use the similarity variable, t ,and seek the
solution for both T ( x, t ) FL ( ) for the liquid and
T ( x, t ) FS ( ) for the solid.
– Seek a solution for X(t) in the form:
X (t ) 2 Lt
Temperature
• Temperature in the liquid region at t>0:
0 x X (t )
x
erf ( )
2 Lt
T ( x, t ) TL (TL Tm )
erf
X (t ) 2 Lt
Transcendental Equation
• There is a different Transcendental Equations that
incorporates the TWO Stefan numbers (one for
each phase).
– Trans. Equation:
St L St S
exp( )erf ( ) v exp( v erfc(v )
2 2 2
3. Terminate if
-(Want TOL to be very small so
f ( x ) TOL convergence should be noticed)
Approximation of Lambda:
1 StS
2
St
S 2 St L
2 v v
Glauber’s Salt Input Values
-Tm = 32;
-CpL = 3.31;
-CpS = 1.76;
-kL = .59e-3;
-kS = 2.16e-3;
-rho = 1460;
-Lat = 251.21;
-Tinit = 25;
-Tbdy = 90;
Water Input Values
- Tm = 0;
- CpL = 4.1868;
- CpS = .5;
- kL = .5664e-3;
- kS = 2.16e-3;
- rho = 1;
- Lat = 333.4;
Glauber’s salt Example
maximum number of iterations to be performed,20
tolerance for the residual,1.0e-7
Iterations is 1
xn = 5.170729e-001
fx = -2.740474e-001
Iterations is 2
xn = 5.207715e-001
fx = 1.747621e-002
Iterations is 3
xn = 5.207862e-001
fx = 6.881053e-005
LAMBDA=
• 5.207861719133929e-001
Plot Lambda vs Stefan
For small Stefan numbers from 0:5 and M=51
Portion of Exact Solution Code
• function lambda = neumann2p(CpL, CpS, kL, kS, rho, Tm, Lat, Tbdy,Tinit)
•
• format long e
• %----------------------Input values---------------------------------------
• CpL = input('Enter specific heat: ');
• CpS = input('Enter specific heat of solid: ');
• kL = input('Enter thermal conductivity of liquid: ');
• kS = input('Enter themal conductivity of solid: ');
• rho = input('Enter density which is constant: ');
• Tm = input('Enter the melting temperature of substance: ');
• Lat = input('Enter Latent heat: ');
• TL = input('Enter temperature at x=0: ');
• dat2p;
• %--------------------------Constants to derive-----------------------------
• alphaL = kL/(rho*CpL);
• alphaS = kS/ (rho *CpS);
• dT = Tbdy - Tm;
• dTa = Tm - Tinit;
• v = sqrt(alphaL./alphaS);
StS = (CpS*dTa)/ Lat;
• StL = (CpL*dT)/Lat;
• %----------------------------Newton-----------------------------------
•
• x0 = 0.5 * (-StS/ (v*sqrt(pi)) + sqrt(2*StL + (StS/(v*sqrt(pi)))^2));
• lambda = transnewton2p(x0,20,1.0e-7,StS,StL,v);
• function Xt = XofT(lambda,alphaL,t)
• Xt = 2*lambda*sqrt(alphaL*t);
•
•
• function TofXTL = TofXTL(lambda,alphaL,Tbdy,dT,x,t)
• TofXTL = Tbdy-dT*(erf(x./(2*sqrt(alphaL*t)))./erf(lambda));
•
• function TofXTS = TofXTS(lambda,alphaS,Tinit,dTa,x,t,v)
• TofXTS = Tinit +dTa*(erfc(x./(2*sqrt(alphaS*t)))./erfc(lambda*v))
Exact Front for Glauber’s Salt
Exact Front for Water
Exact Histories for Salt
x j x l / M
x1/ 2 0,
x j 1/ 2 ( j 1)x, j 1,..., M ,
xM 1/ 2 Mx l.
tn nt (discretize time steps)
Discretize Heat Balance
Et q x 0 (Heat Balance Equation)
T
E
Tref
c (T ) dT c[T Tref ]
E( x, t )dx E( x , t )x
x j 1 / 2
j j
Discretized Enthalpy
From Last Slide:
[ E ( x j , t n 1 ) E ( x j , t n )]x j
t n1
Or
n 1 tn n
E E n
[q j 1/ 2 q j 1/ 2 ], j 1,..., M
n
x j
j j
Discretize Fluxes
Fourier’s Law: T
q kTx k
x
Approximate q discretely:
T j T j 1
q j 1/ 2 k j 1/ 2 , j 2,..., M
x j x j 1
Discretize Boundary Conditions
• Imposing Temperature from left:
T T0 (t n ), n 0,1,2,...
0
n
• E j L Vj is liquid
• 0 E j L Vj is “mushy”
Ej
Liquid Fraction: j
L
Energy & Temperature Relation
cS [T Tm ], T Tm (solid)
E
cL [T Tm ] L, T Tm (liquid)
Solve for T:
E
Tm c , E0 (solid)
S
T Tm , 0 E L (interface )
E L
Tm , E L (liquid)
cL
Energy vs. Temperature Graph
with Enthalpy Scheme:
Explicit Time Scheme
Initial Temperature Known:
T j0 Tinit ( x j ), j 1,2,..., M
Initial Enthalpy E j , j 1,2,..., M
0
x
(1 )x
R
2k L 2k S
Update Enthalpy at Next Time
Step
(The Discretized Enthalpy)
n 1 tn n
E E n
[q j 1/ 2 q j 1/ 2 ], j 1,..., M
n
x j
j j
Update Temperature at Next
Time Step:
E n
Tm Ej 0
j n
, (solid)
cS
T j Tm ,
n
0 E j L (interface )
n
T E j L , E n L (liquid)
n
m cL
j
Update Liquid Fractions/Phases:
0, if E 0 (solid)
n
j
n
Ej
j , if 0 E j L (mushy)
n n
L
1, if L E j
n
(liquid)
Glauber’s Salt Example
ρ 1460kg/m3 (density)
Tm 32o C (melt temp erature)
TS 25o C (initial temperatu re)
TL 90o C ( imposing temperatu re)
L 251.21kJ/kg(latent heat)
cL 3.31kJ/kgoC (specific heat for liquid)
cS 1.76kJ/kgoC (specific heat for solid)
k L 0.59 10 3 kJ/msoC (conductiv ity for liquid)
k S 2.16 10 3 kJ/msoC conductivi ty for solid
Matlab Code Subroutines
• Call INPUT: a data file contains all the
data needed for computing.
• Call MESH: a function sets up control
volume, the node and the face vectors.
• Call START: a function initialize
temperature, enthalpy and liquid fraction
at each control volume.
Continue…
• Call FLUX: a function finds the fluxes
for each control volume at current time.
• Call PDE: a function updates temperature,
enthalpy and liquid fraction at next time
step.
• Call OUTPUT: a function outputs needed
and computed parameters.
• Call COMPARE: a function compares the
exact and numerical solutions.
Defining Errors
• Front error at time:
errorX max errorX , front X exact
• T(xout,time) error:
errorTXout max errorTXout , T (iout ) Texiout
• History Error at X out :
errorTXout max errorTXout , T (i) Texacthisti
• Profile Error at t max :
errorTtmax max errorTtmax , T (i ) Texactprofi
Neumann Exact vs. Numerical
(Fronts, Histories and
Profiles) Plots for Varied M
Values
Exact Front vs. Num. Front at M=32
Exact Front vs. Num. Front at M=60
Exact Front vs. Num. Front at M=80
Exact Front vs. Num. Front at M=120
Exact Front vs. Num. Front at M=160
Exact Front vs. Num. Front at M=256
Exact Hist vs. Num.Hist at M=32
Exact Hist vs. Num. Hist at M=60
Exact Hist vs. Num. Hist at M=80
Exact Hist vs. Num. Hist at M=120
Exact Hist vs. Num. Hist at M=160
Exact Hist vs. Num. Hist at M=256
Exact Profile vs. Num. Profile at M=32
Exact Profile vs. Num. Profile at M=60
Exact Profile vs. Num. Profile at M=80
Exact Profile vs. Num.Profile at M=120
Exact Profile vs. Num. Profile at M=160
Exact Profile vs. Num. Profile at M=256
Summary on Plots
• The numerical solution is getting closer
to closer to the exact solution as the
number of nodes M gets bigger and
bigger.
• The numerical solution profile plots are
closer to the exact solution plots even for
smaller M’s.
Stefan2p Errors (Front,
History and Profile) vs. M
Plots at t max 50hrs
Melt Front Error vs. M
Melt Front Error vs. M
Tem-History Error vs. M
Tem-Profile Error vs. M
Tem-Profile Error vs. M
Summary on the Plots
• As the number of nodes M increases, the
errors for Stefan2p Front, History and
Profile plots appear decreasing trends.
• These decreasing trends are even more so
for M equals binary numbers, i.e., 32, 64,
128, 256 and etc.
Mushy2p:
An Alternative to the
Enthalpy Scheme
Sherry Linn
E vs. T graph with enthalpy scheme
Why a new scheme?
Enthalpy scheme’s energy vs.
temperature curve not differentiable at
T = Tm!
Solid : T Tm
Mushy : Tm T Tm
Liquid : T Tm
E vs. T graph with enthalpy scheme (solid) and
mushy scheme (dashed)
Introducing mushy2p
Explicit scheme
Independent from Stefan2p
Differs from Stefan 2p (PDE function)
Imposed mushy zone affects
- Temperature
- Liquid fraction
Temperature
E nj
m
T if E j 0.0 (liquid)
n
c p S
n
T j Tm E j
n
if 0.0 E j L (mushy)
n
L
E nj L
Tm if E j L (solid)
n
c p
L
Deriving Temperature at Mushy Phase
0, if T j
n
Tm (solid)
n
T j Tm
j
n
, if Tm T Tm ε (mushy)
n
j
1, if Tm ε T jn (liquid)
Melt Front Error vs. Epsilon at M = 64
Temp History Error vs. Epsilon at x
= .49 m, M = 64
Temp Profile Error vs. Epsilon at t
= 50hrs, M = 64
Melt Front Error vs. Epsilon at
M = 128
Temp History Error vs. Epsilon at x
= .49 m, M = 128
Temp Profile Error vs. Epsilon at t
= 50hrs, M = 64
An Optimal Epsilon
Error decreases as epsilon increases
Is there a larger epsilon that causes error to
increase?
An optimal epsilon (topic for further research)
Mushy vs. Enthalpy