2phase Stefan Problem
2phase Stefan Problem
2phase Stefan Problem
and the
Exact Solution for the Two Phase
Stefan Problem
DT Project
First (contd)
Note:
The phase changing process is governed
by the conservation of energy.
The unknowns are the temperature field
and the location of the Interface.
Involves a phase change material(PCM)
with constant density( ), latent heat( L),
melt temperature(T ), Specific heats( c , c ),
and Thermal conductivities( k S , k L ).
m
Physical Assumptions
Conduction only
Constant latent heat (L)
Fixed melting temperature( Tm) which is
according to the phase change material
(PCM)
Interface thickness is 0 and it is a sharp front;
it separates the phases
Assumptions (contd)
Thermophysical properties are
different for each phase
Conductivities ( k
Specific heats ( c
kS
cS
)
)
Other Assumptions
Nucleation and supercooling are assumed
to be not present
Surface tension and curvature is
insignificant
Only Conduction
Conduction of Heat
Temperature
Heat(enthalphy)
Heat Flux
Characterizes phases
Heat Equation
Mathematical Model
PDE
Tt LTxx
Tt S Txx
for
0 X (t ), t 0
X (t ) x, t 0
Interface(t>0) T ( X (t ), t ) Tm
LX '(t ) kLTx ( X (t ) , t ) kSTx ( X (t ) , t )
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 semiinfinite.
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 .
The alphas are different for each phase. All
parameters constant.
Mathematical Model
Heat Equations
Tt LTxx
Interface(t>0)
T ( X (t ), t ) Tm
Tt S Txx
for
0 X (t ), t 0
X (t ) x, t 0
Boundary Condition
T (0, t ) TL Tm , t 0
lim T ( x, t ) TS
x
X (t ) 2 Lt
Temperature
Temperature in the liquid region at t>0:
0 x X (t )
x
erf (
T ( x, t ) TL (TL Tm )
2 Lt
erf
x
2 St
erfc( L / S )
X (t ) 2 Lt
Transcendental Equation
There is a different Transcendental Equations that
incorporates the TWO Stefan numbers (one for
each phase).
Trans. Equation:
StS
St L
2
2 2
exp( )erf ( ) v exp( v erfc (v )
Stefan Numbers and parameter v:
St L
cL (TL Tm )
L
StS
cS (Tm TS )
L
L
S
Newton!!!
Newton's method is an algorithm that finds
the root of a given function.
-Where F(x) = 0.
What now???
We can use the Newton algorithm to
solve the transcendental equation for
the Stefan problem
0, v 0
Newton Algorithm
1. Guess x0
2. Take a Newton Step
where x f ( x)
xn 1 xn x
f ( x)
3. Terminate if
f ( x) TOL
x TOL *10
Approximation of Lambda:
St
1
S
2 v
St S
2 St L
v
LAMBDA=
5.207861719133929e-001
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);
Formulation/ Discretization of
Stefan 2-Phase Problem
c
(
T
)
dT
c
[
T
T
]
ref
Tref
Continue
t n1
tn
x j 1 / 2
x j 1 / 2
t n1
A E ( x, t )dx dt A qx ( x, t )dxdt
t x j1 / 2
tn
x j 1 / 2
E ( x, t )dx
x j 1 / 2
t t n1
t t n
t n1
[q( x j 1/ 2 , t ) q( x j 1/ 2 , t )]dt
tn
E ( x, t )dx E ( x , t )x
j
x j 1 / 2
Discretized Enthalpy
From Last Slide:
[ E ( x j , t n 1 ) E ( x j , tn )]x j
t n1
[q( x j 1/ 2 , t ) q( x j 1/ 2 , t )]dt
tn
Or
E
n 1
j
t n n
n
E
[q j 1/ 2 q j 1/ 2 ], j 1,..., M
x j
n
j
Discretize Fluxes
T
q kTx k
x
Approximate q discretely:
Fouriers Law:
q j 1/ 2 k j 1/ 2
T j T j 1
x j x j 1
, j 2,...,M
T T0 (t n ), n 0,1,2,...
n
0
T1 T0
1 / 2x1
, with R1/ 2
R1/ 2
k1
n
M 1 / 2
Ej 0
E j L
0 E j L
V j is Solid
Vj
is liquid
Vj
Liquid Fraction:
is mushy
Ej
Solve for T:
E
E0
(solid)
Tm c ,
S
T Tm ,
0 E L (interface)
E L
Tm
, E L (liquid)
cL
n
j 1/ 2
T T
n
j
n
j 1
R j 1/ 2
with
(1 )x
R
2k L
2k S
n 1
j
t n n
n
E
[q j 1/ 2 q j 1/ 2 ], j 1,..., M
x j
n
j
E
n
,
Ej 0
(solid)
Tm
cS
n
n
T j Tm ,
0 E j L (interface)
n
T E j L , E n L (liquid)
j
m
cL
n
j
j
n
n
j , if 0 E j L (mushy)
L
n
1,
if L E j
(liquid)
n
j
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:
T(xout,time) error:
Profile Error at t m ax :
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 Ms.
Mushy2p:
An Alternative to the
Enthalpy Scheme
Sherry Linn
To achieve piecewise
differentiability
Impose a mushy zone of predetermined
length :
Solid : T Tm
Mushy : Tm T Tm
Liquid : T Tm
Introducing mushy2p
Explicit scheme
Independent from Stefan2p
Differs from Stefan 2p (PDE function)
Imposed mushy zone affects
- Temperature
- Liquid fraction
Temperature
E nj
n
T
if
E
m
j 0.0 (liquid)
S
c p
n
n
n
if 0.0 E j L (mushy)
T j Tm E j
L
E nj L
n
Tm
if
E
j L (solid)
L
c p
if T
n
j
Tm (solid)
if Tm T Tm (mushy)
n
j
if Tm T (liquid)
n
j
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)
Error Analysis:
L-norm: err = max{ |Fapprox Fexact| }
stefan2p
32
40
60
64
80
120
128
160
240
256
1.39721734740785
0.65724954768591
0.29444363002193
0.83534465188910
0.14473018624196
0.22392243999277
0.64645276473467
0.40088509319875
0.19702938327533
0.12053866446253
Mushy2p ( = 1/M)
1.39111290103978
0.65923220965860
0.29550235005397
0.82963045129535
0.14560810548880
0.22044558071511
0.63885783836963
0.39523873217349
0.19715111147884
0.11876976279872
stefan2p
32
40
60
64
80
120
128
160
240
256
1.39721734740785
0.65724954768591
0.29444363002193
0.83534465188910
0.14473018624196
0.22392243999277
0.64645276473467
0.40088509319875
0.19702938327533
0.12053866446253
Mushy2p ( = 1/M)
1.39111290103978
0.65923220965860
0.29550235005397
0.82963045129535
0.14560810548880
0.22044558071511
0.63885783836963
0.39523873217349
0.19715111147884
0.11876976279872
So which is better?
Stefan2p
Represents physical
reality
Jump in heat flux
Small error, depending
on number of nodes
Mushy2p
Artificially-imposed
mushy zone
Energy E(T) is
continuous
Smaller error,
depending on (with
same nodes)