Вы находитесь на странице: 1из 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 (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( ),
melt temperature( ), Specific heats( ),
and Thermal conductivities( ).

L
m
T
L S
c c ,
L S
k k ,
Physical Assumptions
Conduction only
Constant latent heat (L)
Fixed melting temperature( ) which is
according to the phase change material
(PCM)
Interface thickness is 0 and it is a sharp front;
it separates the phases
m
T
Assumptions (contd)
Thermophysical properties are
different for each phase
Conductivities ( )
Specific heats ( )

Density remains constant

L S
c c =
L S
k k =
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):
-well-posed
-Heat equation:
where
( )
t x x
cT kT =
t xx
T T o =
k
c
o

=
The Two-Phase Stefan Problem
A slab, , initially solid at
temperature , is melted by
imposing a hot temperature at the
face and keeping the back face,
insulated (all parameters constant).
l x s s 0
m init
T T <
m L
T T >
0 = x
l x =
Lets Find a Solution
The solution of the
Stefan Problem is T(x,t)
and X(t)!!!!
Mathematical Model
PDE for

Interface(t>0)

Initial Condition

Boundary Condition

t L xx
t S xx
T T
T T
o
o
=
=
0 ( ), 0
( ) , 0
X t t
X t x t
< >
< >
( ( ), )
'( ) ( ( ) , ) ( ( ) , )
m
L x S x
T X t t T
LX t k T X t t k T X t t
+
=
= +
l x T T x T
X
m init
s s < =
=
0 , ) 0 , (
0 ) 0 (
0 ) , (
0 , ) , 0 (
=
> > =
t l T k
t T T t T
x S
m L
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, ,
initially solid at a temperature , by imposing
temperature , on the face .

The alphas are different for each phase. All
parameters constant.
0 x s <
S m
T T s
L m
T T >
0 x =
Mathematical Model
Heat Equations for

Interface(t>0)
Stefan condtion:
Initial Condition

Boundary Condition

t L xx
t S xx
T T
T T
o
o
=
=
0 ( ), 0
( ) , 0
X t t
X t x t
< >
< >
( ( ), )
'( ) ( ( ) , ) ( ( ) , )
m
L x S x
T X t t T
LX t k T X t t k T X t t
+
=
= +
0 , ) 0 , (
0 ) 0 (
> < =
=
x T T x T
X
m init
S
x
m L
T t x T
t T T t T
=
> > =

) , ( lim
0 , ) , 0 (
Two-Phase Neumann Solution
We derive the Neumann Solution


We use the similarity variable, ,and seek the
solution for both for the liquid and
for the solid.
Seek a solution for X(t) in the form:



t
x
= ,
( , ) ( )
L
T x t F , =
( , ) ( )
S
T x t F , =
( ) 2
L
X t t o =
Temperature
Temperature in the liquid region at t>0:




Temperature in the solid region at t>0:

0 ( )
( )
2
( , ) ( )
L
L L m
x X t
x
erf
t
T x t T T T
erf
o

< <
=
( )
( )
2
( , ) ( )
( / )
S
S m S
L S
x X t
x
erfc
t
T x t T T T
erfc
o
o o
>
= +
Neumann similarity solution of the 2-phase
Stefan Problem for the interface

( ) 2
L
X t t o =
Transcendental Equation
There is a different Transcendental Equations that
incorporates the TWO Stefan numbers (one for
each phase).
Trans. Equation:



Stefan Numbers and parameter v:
( )
L L m
L
c T T
St
L

=
( )
S m S
S
c T T
St
L

=
L
S
v
o
o
=
t

=
) ( exp( ) ( ) exp(
2 2 2
v erfc v v
St
erf
St
S L
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

0, 0, 0
L S
St St v > > >
Newton Algorithm
1. Guess x0
2. Take a Newton Step
where

3. Terminate if

x x x
n n
A + =
+1
) (
) (
x f
x f
x
'

= A
10 *
) (
TOL x
TOL x f
< A
<
-(Want TOL to be very small so
convergence should be noticed)
-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:

2
1
2
2
S S
L
St St
St
v v

t t
(
| |
(
= + +
|
(
\ .

Glaubers 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;


Glaubers 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 Glaubers 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: with each
Subregion associate a node .
Volume of :
M
V V V ,..., ,
2 1
j
x
M j x A V
j j
,..., 1 , = A = A
j
V
j
V
Create the control mesh:





.
, ,..., 1 , ) 1 (
, 0
/
2 / 1
2 / 1
2 / 1
l x M x
M j x j x
x
M l x x
M
j
j
= A =
= A =
=
= A = A
+

steps) time discretize ( t n t


n
A =
Discretize Heat Balance






Integrating heat balance eqn over control
volume and over time interval
e
T
T T c dT T c E
q E
ref
ref
T
T
x t
ref


=
=
~ =
= +
}
E
re temperatu reference where
] [ ) (
Equation) Balance (Heat 0
j
V
] , [
n n n
t t t A +
Continue

Dividing out the A and integrating the
derivatives yields:


Assuming E is uniform and is small:


dxdt t x q A dt dx t x E A
t
n
n
j
j
j
j
n
n
t
t
x
x
x
x
x
t
t
) , ( ) , (
1
2 / 1
2 / 1
2 / 1
2 / 1
1
} } } }
+
+

+
=
|
|
.
|

\
|
c
c
} }
+
+
+

+
=
=
=
1
1
2 / 1
2 / 1
)] , ( ) , ( [ ) , (
2 / 1 2 / 1
n
n
n
n
j
j
t
t
j j
t t
t t
x
x
dt t x q t x q dx t x E
j
x
x
j
x t x E dx t x E
j
j
A ~
}
+

) , ( ) , (
2 / 1
2 / 1
j
V
Discretized Enthalpy
From Last Slide:




Or

M j q q
x
t
E E
n
j
n
j
j
n
n
j
n
j
,..., 1 ], [
2 / 1 2 / 1
1
=
A
A
+ =
+
+
}
+
+
+
=
A
1
)] , ( ) , ( [
)] , ( ) , ( [
2 / 1 2 / 1
1
n
n
t
t
j j
j n j n j
dt t x q t x q
x t x E t x E
Discretize Fluxes
Fouriers Law:

Approximate q discretely:

x
T
k kT q
x
A
A
~ =
M j
x x
T T
k q
j j
j j
j j
,..., 2 ,
1
1
2 / 1 2 / 1
=


Discretize Boundary Conditions
Imposing Temperature from left:

Impose exact temperature at back face.
The left boundary flux at x=0:

The right boundary flux at x=l:



,... 2 , 1 , 0 ), (
0 0
= = n t T T
n
n
1
1
2 / 1
2 / 1
0 1
2 / 1
2 / 1
with ,
k
x
R
R
T T
q
n n
n
A
=

=
0
2 / 1
=
+
n
M
q
Liquid Fraction & Mushy
is Solid

is liquid

is mushy

Liquid Fraction:
j
V
0 s
j
E
j
V
L E
j
>
j
V
L E
j
< < 0
L
E
j
j

=
Energy & Temperature Relation


Solve for T:


> +
<
=
(liquid) T , ] [
(solid) T ], [
m m L
m m S
T L T T c
T T T c
E

>

+
< <
s +
=
(liquid) E ,
) (interface E 0 ,
(solid) 0 E ,
L
c
L E
T
L T
c
E
T
T
L
m
m
S
m

Energy vs. Temperature Graph


with Enthalpy Scheme:
Explicit Time Scheme
Initial Temperature Known:

Initial Enthalpy
Set Resistance and Fluxes from Initial
Temperature and Enthalpy
Update Enthalpies at
Update Temperature
Update Liquid Fraction



M j x T T
j init j
,..., 2 , 1 ), (
0
= =
M j E
j
,..., 2 , 1 ,
0
=
1 + n
j
E
1 + n
t
Flux and Resistance Drive Heat
Flows








with
2 / 1
1
2 / 1


=
j
n
j
n
j
n
j
R
T T
q
S L
k
x
k
x
R
2
) 1 (
2
A
+
A
=



Update Enthalpy at Next Time
Step
(The Discretized Enthalpy)
M j q q
x
t
E E
n
j
n
j
j
n
n
j
n
j
,..., 1 ], [
2 / 1 2 / 1
1
=
A
A
+ =
+
+

Update Temperature at Next
Time Step:

>

+
< <
s +
=
(liquid) ,
) (interface 0 ,
(solid) 0 ,
T
L E
c
L E
T
L E T
E
c
E
T
n
j
L
n
j
m
n
j m
n
j
S
n
j
m
n
j


Update Liquid Fractions/Phases:

s
< <
s
=
(liquid) if , 1
(mushy) 0 if ,
(solid) 0 if , 0
n
j
n
j
n
j
n
j
n
j
E L
L E
L
E
E

Glaubers Salt Example


( ) solid for ty conductivi 10 16 2
liquid) for ity (conductiv 10 59 0
solid) for heat (specific 76 1
liquid) for heat (specific 31 3
heat) (latent 21 251
re) temperatu imposing ( 90
re) temperatu (initial 25
erature) (melt temp 32
(density) 1460
3
3
3
C kJ/ms . k
C kJ/ms . k
C kJ/kg . c
C kJ/kg . c
kJ/kg . L
C T
C T
C T
kg/m
o
S
o
L
o
S
o
L
o
L
o
S
o
m

=
=
=
=
=
=
=
=
=
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:

T(xout,time) error:

History Error at :

Profile Error at :
{ }
exiout Xout Xout
T iout T errorT errorT = ) ( , max
{ }
exact
X front errorX errorX = , max
max
t
out
X
{ }
exacthisti Xout Xout
T i T errorT errorT = ) ( , max
{ }
exactprofi t t
T i T errorT errorT = ) ( , max
max max
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 Ms.
Stefan2p Errors (Front,
History and Profile) vs. M
Plots at
hrs t 50
max
=
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 schemes 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 :
c
c
+ >
+ < <
<
m
m m
m
T T Liquid
T T T Mushy
T T Solid
:
:
:
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

(solid) if
(mushy) 0 . 0 if
(liquid) 0 . 0 if

>

+
< <
|
|
.
|

\
|
+
s +
=
L E
c
L E
T
L E
L
E T
E
c
E
T
T
n
j
L
p
n
j
m
n
j
n
j m
n
j
S
p
n
j
m
n
j

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

< +
+ < <

<
=
(liquid) if , 1
(mushy) if ,
(solid) if , 0
n
j m
m
n
j m
m
n
j
m
n
j
n
j
T T
T T T
T T
T T
c

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?
( ) solid for ty conductivi 10 16 2
liquid) for ity (conductiv 10 59 0
solid) for heat (specific 76 1
liquid) for heat (specific 31 3
heat) (latent 21 251
re) temperatu imposing ( 90
re) temperatu (initial 25
erature) (melt temp 32
(density) 1460
3
3
3
C kJ/ms . k
C kJ/ms . k
C kJ/kg . c
C kJ/kg . c
kJ/kg . L
C T
C T
C T
kg/m
o
S
o
L
o
S
o
L
o
L
o
S
o
m

=
=
=
=
=
=
=
=
=
Recap: Glaubers salt
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, c = 1/32 = .03125 = Ax, tmax = 50 hrs.
Max error ~ 9.24 mm
Melt Front X(t), M = 128,
c = 1/128 = .0078125 = Ax, 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, c = 1/32 = .03125 = Ax, tmax = 50 hrs.
Max error ~ 7.5510
-2
C
T(x,t) history at x ~ 0.496 m, M = 128,
c = 1/128 = .0078125 = Ax, tmax = 50 hrs.
Max error ~ 1.9110
-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 = t
max
= 50 hrs
M = 32, c = 1/32 = .03125 = Ax
Max error ~ 1.39 C
T(x,t) profile at t = t
max
= 50 hrs
M = 128, c = 1/32 = .03125 = Ax
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 (
c
= 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 (
c
= 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
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 c (with
same nodes)
Is mushy2p a better scheme?
Is it more efficient?
Whats the optimal c?
Is the error different enough to be
significant?
Can we justify using a scheme that doesnt
seem to reflect reality?

Вам также может понравиться