Sei sulla pagina 1di 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( 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

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: Tt Txx
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).

Lets Find a Solution

The solution of the


Stefan Problem is T(x,t)
and X(t)!!!!

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 )

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

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

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 (
T ( x, t ) TL (TL Tm )

2 Lt
erf

Temperature in the solid region at t>0:


x X (t )
erfc(
T ( x, t ) TS (Tm TS )

x
2 St

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:

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.

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, St S

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

-(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:
St
1
S
2 v

St S
2 St L

v

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: 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 Mx l.
t n nt (discretize time steps)

Discretize Heat Balance


Et q x 0 (Heat Balance Equation)
T

c
(
T
)
dT

c
[
T

T
]
ref

Tref

whereTref reference temperature


E e
Integrating heat balance eqn over control
volume V j and over time interval [tn , tn tn ]

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

Dividing out the A and integrating the


derivatives yields:
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

Assuming E is uniform and V j is small:


x j 1 / 2

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

Discretize Boundary Conditions


Imposing Temperature from left:

T T0 (t n ), n 0,1,2,...
n
0

Impose exact temperature at back face.


The left boundary
flux
at
x=0:
n
n
n
1/ 2

T1 T0
1 / 2x1

, with R1/ 2
R1/ 2
k1

The right boundary flux at x=l:

n
M 1 / 2

Liquid Fraction & Mushy

Ej 0

E j L

0 E j L

V j is Solid

Vj

is liquid

Vj

Liquid Fraction:

is mushy

Ej

Energy & Temperature Relation


cS [T Tm ], T Tm (solid)
E
cL [T Tm ] L, T Tm (liquid)

Solve for T:
E

E0
(solid)
Tm c ,
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:
Tj0 Tinit ( x j ), j 1,2,...,M
0
Initial Enthalpy E j , j 1,2,...,M
Set Resistance and Fluxes from Initial
Temperature and Enthalpy
Update Enthalpies E nj1 at t n 1
Update Temperature
Update Liquid Fraction

Flux and Resistance Drive Heat


Flows
q

n
j 1/ 2

T T

n
j

n
j 1

R j 1/ 2

with

(1 )x
R

2k L
2k S

Update Enthalpy at Next Time


Step
(The Discretized Enthalpy)
E

n 1
j

t n n
n
E
[q j 1/ 2 q j 1/ 2 ], j 1,..., M
x j
n
j

Update Temperature at Next


Time Step:

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

Update Liquid Fractions/Phases:


0,
if
E 0 (solid)
n
E

j
n
n
j , if 0 E j L (mushy)
L
n
1,
if L E j
(liquid)

n
j

Glaubers Salt Example


1460kg/m3 (density)
Tm 32o C (melt temperature)
TS 25o C (initial temperature)
TL 90o C ( imposing temperature)
L 251.21kJ/kg(latent heat)
cL 3.31kJ/kgo C (specific heat for liquid)
cS 1.76kJ/kgoC (specific heat for solid)
k L 0.59 103 kJ/msoC (conductivity for liquid)
k S 2.16 103 kJ/msoC conductivity 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 maxerrorX , front X exact

T(xout,time) error:

errorTXout maxerrorTXout , T (iout) Texiout

History Error at X out :

errorTXout maxerrorTXout , T (i) Texacthisti

Profile Error at t m ax :

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

Stefan2p Errors (Front,


History and Profile) vs. M
Plots at t m ax 50 hrs

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 :

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

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,
n
T j Tm
n
j
,

1,

if T

n
j

Tm (solid)

if Tm T Tm (mushy)
n
j

if Tm T (liquid)
n
j

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: Glaubers salt


1460kg/m3 (density)
Tm 32o C (melt temperature)
TS 25o C (initial temperature)
TL 90o C ( imposing temperature)
L 251.21kJ/kg(latent heat)
cL 3.31kJ/kgo C (specific heat for liquid)
cS 1.76kJ/kgoC (specific heat for solid)
k L 0.59 103 kJ/msoC (conductivity for liquid)
k S 2.16 103 kJ/msoC conductivity 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.5510-2 C

T(x,t) history at x 0.496 m, M = 128,


= 1/128 = .0078125 = x, 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 = 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

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

Max errors for numeric schemes at various numbers of


nodes: Temperature T(x,t) profile at t = 50 hrs.
M

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)

Is mushy2p a better scheme?


Is it more efficient?
Whats the optimal ?
Is the error different enough to be
significant?
Can we justify using a scheme that doesnt
seem to reflect reality?

Potrebbero piacerti anche