Vous êtes sur la page 1sur 119

The Stefan Problem

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???

•The formulation of the


Stefan Problem is a
foundation on which
more complex models
can be built.
First (cont’d)
• 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 ),
m S L

and Thermal conductivities( kS , k L ).


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 (cont’d)
• Thermophysical properties are
different for each phase
– Conductivities ( k L  kS )
– Specific heats ( c
L  cS )

• Density remains constant


L  S  
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

-Heat conduction equation (one space


dimension):  cTt  (kTx ) x
-well-posed
-Heat equation: T   T
t xx
where   k
c
The Two-Phase Stefan Problem
• A slab, 0  x  l , initially solid at
temperature Tinit  Tm , is melted by
imposing a hot temperature TL  Tm at the
face x  0 and keeping the back face, x  l
insulated (all parameters constant).
Let’s Find a Solution

• The solution of the


Stefan Problem is T(x,t)
and X(t)!!!!
Mathematical Model
Tt   LTxx 0  X (t ), t  0
• PDE for
Tt   S Txx X (t )  x, t  0

• 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 .

– The “alphas” are different for each phase. All


parameters constant.
Mathematical Model
Tt   LTxx 0  X (t ), t  0
• Heat Equations for
Tt   S Txx X (t )  x, t  0

• Interface(t>0) T ( X (t ), t )  Tm
– Stefan condtion:  LX '(t )  kLTx ( X (t ) , t )  kSTx ( X (t ) , t )
 

• Initial Condition X (0)  0


T ( x,0)  Tinit  Tm , x  0
• Boundary Condition
T (0, t )  TL  Tm , t  0
lim T ( x, t )  TS
x 
Two-Phase Neumann Solution
• We derive the Neumann Solution

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 

• Temperature in the solid region at t>0:


x  X (t )
x
erfc( )
2 St
T ( x, t )  TS  (Tm  TS )
erfc(  L /  S )
• Neumann similarity solution of the 2-phase
Stefan Problem for the interface

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

– Stefan Numbers and parameter “v”:


St L 
cL (TL  Tm )
StS 
cS (Tm  TS ) L
v
L L S
Newton!!!
• Newton's method is an algorithm that finds
the root of a given function.
-Where F(x) = 0.

• The fastest way to approximate a root.


What now???
• We can use the Newton algorithm to
solve the transcendental equation for
the Stefan problem

• We do this in order to find a unique


root lambda and therefore a unique
similarity solution for each St L  0, StS  0, v  0
Newton Algorithm
1. Guess x0
2. Take a Newton Step xn 1  xn  x
where x   f ( x)
f ( x)

3. Terminate if
-(Want TOL to be very small so
f ( x )  TOL convergence should be noticed)

x  TOL *10 -Stuck. Better guess


Approximate the Root for Newton
• For the 2-phase problem there is a
good approximation which can be x0 in
the Newton program.

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

Done. Root is x=5.207862e-001, with Fx=1.068988e-009, Iterations is n=4

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

-5,10,15 from top to bottom


Exact Histories for Water
Exact Profiles for Salt

-notice sharp turn at the melt temperature


Exact Profiles for Water
Enthalpy Method for
Stefan 2-Phase Problem
Formulation/ Discretization of
Stefan 2-Phase Problem
• Discretize Control Mesh
• Discretize Heat Balance
• Discretize Fluxes
• Discretize Boundary Conditions
Partition Control Volumes:

Subdivide the regions into M intervals, or


control volumes: V1 ,V2 ,...,VM with each
Subregion V j associate a node x j .
Volume of V j : V j  A  x j , j  1,..., M
Create the control mesh:

x j  x  l / M
x1/ 2  0,
x j 1/ 2  ( j  1)x, j  1,..., M ,
xM 1/ 2  Mx  l.
tn  nt (discretize time steps)
Discretize Heat Balance
Et  q x  0 (Heat Balance Equation)
T
E  
Tref
c (T ) dT c[T  Tref ]

where Tref  reference temperatu re


E  e
Integrating heat balance eq’n over control
volume V j and over time interval [tn , tn  tn ]
Continue…
t n1
  x j 1 / 2
 t n1 x j 1 / 2

 A  E ( x, t )dx dt    A  q x ( x, t )dxdt


t  x j 1 / 2 
tn   tn x j 1 / 2

Dividing out the A and integrating the


derivatives yields:
x j 1 / 2 t n1

 E( x, t )dx   [q( x j 1/ 2 , t )  q( x j 1/ 2 , t )]dt


t t n1
t t n
x j 1 / 2 tn
Assuming E is uniform and V j is small:
x j 1 / 2

 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 n1

  [q( x j 1/ 2 , t )  q( x j 1/ 2 , t )]dt


tn

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

• Impose exact temperature at back face.


• The left boundary flux at x=0:
n
T1  T0
n
1 / 2x1
n
q
1/ 2  , with R1/ 2 
R1/ 2 k1
• The right boundary flux at x=l:
q n
M 1 / 2 0
Liquid Fraction & “Mushy”
• Ej  0  V j is Solid

• 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 , E0 (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

Set Resistance and Fluxes from Initial


Temperature and Enthalpy
Update Enthalpies E nj 1 at t n 1
Update Temperature
Update Liquid Fraction
Flux and Resistance Drive Heat
Flows
T T
n n
j 1

n j
q j 1/ 2 with
R j 1/ 2

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!

Want a scheme based on a piecewise


differentiable energy vs. temperature
curve.
To achieve piecewise
differentiability…

Impose a mushy zone of predetermined


length ε:

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

Two points: (Tm,0),


(Tm+epsilon,rho*L)
Obtain equation of
line E in terms of T
Solve for T in terms
of E
Liquid Fraction in Terms of ε

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

How good is the mushy scheme?


Which is better, mushy or Stefan?
Recap: Glauber’s salt
ρ  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 
Recap: Comparing Exact to
Numeric Solution
• Requirements/Precautions:
– Input data for the explicitly solvable case
– Impose exact temperature at back face
• Error Analysis:
– L-norm: err = max{ |Fapprox – Fexact| }
• Compare solution via three things:
1.Melt front X(t)
2.Temperature T(x,t) history at fixed x
3.Temperature T(x,t) profile at fixed t
How good is mushy2p?
1. Melt front X(t) location
2. Temperature T(x,t) history at fixed x
3. Temperature T(x,t) profile at fixed t
Melt Front X(t)
M = 32,  = 1/32 = .03125 = x, tmax = 50 hrs.

Max error  9.24 mm


Melt Front X(t), M = 128,
 = 1/128 = .0078125 = x, tmax = 50 hrs.

Max error  1.66 mm


How good is mushy2p?
1. Melt front X(t) location
2. Temperature T(x,t) history at fixed x
3. Temperature T(x,t) profile at fixed t
T(x,t) history at x  0.484 m
M = 32,  = 1/32 = .03125 = x, tmax = 50 hrs.

Max error  7.55×10-2 °C


T(x,t) history at x  0.496 m, M = 128,
 = 1/128 = .0078125 = x, tmax = 50 hrs.

Max error  1.91×10-2 °C


How good is mushy2p?
1. Melt front X(t) location
2. Temperature T(x,t) history at fixed x
3. Temperature T(x,t) profile at fixed t
T(x,t) profile at t = tmax = 50 hrs
M = 32,  = 1/32 = .03125 = x

Max error  1.39 °C


T(x,t) profile at t = tmax = 50 hrs
M = 128,  = 1/32 = .03125 = x

Max error  0.639 °C


Max errors for numeric schemes at various numbers of
nodes: Temperature T(x,t) profile at t = 50 hrs.
M stefan2p Mushy2p ( = 1/M)
32 1.39721734740785 1.39111290103978
40 0.65724954768591 0.65923220965860
60 0.29444363002193 0.29550235005397
64 0.83534465188910 0.82963045129535
80 0.14473018624196 0.14560810548880
120 0.22392243999277 0.22044558071511
128 0.64645276473467 0.63885783836963
160 0.40088509319875 0.39523873217349
240 0.19702938327533 0.19715111147884
256 0.12053866446253 0.11876976279872
Max errors for numeric schemes at various numbers of
nodes: Temperature T(x,t) profile at t = 50 hrs.
M stefan2p Mushy2p ( = 1/M)
32 1.39721734740785 1.39111290103978
40 0.65724954768591 0.65923220965860
60 0.29444363002193 0.29550235005397
64 0.83534465188910 0.82963045129535
80 0.14473018624196 0.14560810548880
120 0.22392243999277 0.22044558071511
128 0.64645276473467 0.63885783836963
160 0.40088509319875 0.39523873217349
240 0.19702938327533 0.19715111147884
256 0.12053866446253 0.11876976279872
So which is better?
• Stefan2p • Mushy2p
– Represents physical – Artificially-imposed
reality mushy zone
– Jump in heat flux – Energy E(T) is
– Small error, depending continuous
on number of nodes – Smaller error,
depending on  (with
same nodes)
Is mushy2p a better scheme?
• Is it more efficient?
• What’s the optimal ?
• Is the error different enough to be
significant?
• Can we justify using a scheme that doesn’t
seem to reflect reality?

Vous aimerez peut-être aussi