Post on 26-Dec-2015
transcript
The Stefan Problemand 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( ), melt temperature( ), Specific heats( ), and Thermal conductivities( ).
L
mT LS cc ,
LS kk ,
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
mT
Assumptions (cont’d)
• Thermophysical properties are different for each phase– Conductivities ( )– Specific heats ( )
• Density remains constant
L Sc c
L Sk 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 xcT kT
t xxT Tk
c
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).
lx 0minit TT
mL TT
0x lx
Let’s 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
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
lxTTxT
X
minit
0,)0,(
0)0(
0),(
0,),0(
tlTk
tTTtT
xS
mL
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 mT T
L mT T 0x
Mathematical Model
• Heat Equations for
• Interface(t>0)– Stefan condtion:
• Initial Condition
• Boundary Condition
t L xx
t S xx
T T
T T
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(
xTTxT
X
minit
Sx
mL
TtxT
tTTtT
),(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
( , ) ( )LT x t F
( , ) ( )ST x t F
( ) 2 LX t t
Temperature
• Temperature in the liquid region at t>0:
• Temperature in the solid region at t>0:
0 ( )
( )2
( , ) ( ) LL L m
x X t
xerf
tT x t T T T
erf
( )
( )2
( , ) ( )( / )
SS m S
L S
x X t
xerfc
tT x t T T T
erfc
• Neumann similarity solution of the 2-phase Stefan Problem for the interface
( ) 2 LX t t
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 TSt
L
( )S m S
S
c T TSt
L
L
S
v
)(exp()()exp( 222 verfcvv
St
erf
St SL
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, 0L SSt St v
Newton Algorithm
1. Guess x0
2. Take a Newton Step
where
3. Terminate if
xxx nn 1
)(
)(
xf
xfx
10*
)(
TOLx
TOLxf
-(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:
21
22
S SL
St StSt
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 Examplemaximum number of iterations to be performed,20tolerance for the residual,1.0e-7Iterations is 1xn = 5.170729e-001fx = -2.740474e-001
Iterations is 2xn = 5.207715e-001fx = 1.747621e-002
Iterations is 3xn = 5.207862e-001fx = 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 StefanFor 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: with each
Subregion associate a node .
Volume of :
MVVV ,...,, 21
jxMjxAV jj ,...,1 ,
jV
jV
Create the control mesh:
.
,,...,1 ,)1(
,0
/
2/1
2/1
2/1
lxMx
Mjxjx
x
Mlxx
M
j
j
steps) timediscretize(tntn
Discretize Heat Balance
Integrating heat balance eq’n over control
volume and over time interval
e
T
TTcdTTcE
qE
ref
ref
T
T
xt
ref
E
re temperatureference where
][)(
Equation) Balance(Heat 0
jV ],[ nnn ttt
Continue…
Dividing out the A and integrating the derivatives yields:
Assuming E is uniform and is small:
dxdttxqAdtdxtxEAt
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
1
1
2/1
2/1
)],(),([),( 2/12/1
n
n
n
n
j
j
t
t
jjtttt
x
x
dttxqtxqdxtxE
j
x
x
j xtxEdxtxEj
j
),(),(2/1
2/1
jV
Discretized Enthalpy
From Last Slide:
Or
Mjqqx
tEE n
jnj
j
nnj
nj ,...,1 ],[ 2/12/1
1
1
)],(),([
)],(),([
2/12/1
1
n
n
t
t
jj
jnjnj
dttxqtxq
xtxEtxE
Discretize Fluxes
Fourier’s Law:
Approximate q discretely:
x
TkkTq x
Mjxx
TTkq
jj
jjjj ,...,2 ,
1
12/12/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 ),(00 ntTT nn
1
12/1
2/1
012/1
2/1 with ,
k
xR
R
TTq
nnn
02/1 nMq
Liquid Fraction & “Mushy”
• is Solid
• is liquid
• is “mushy”
Liquid Fraction:
jV0jE
jVLE j
jVLE j 0
L
E jj
Energy & Temperature Relation
Solve for T:
(liquid) T ,][
(solid) T ],[
mmL
mmS
TLTTc
TTTcE
(liquid) E ,
)(interface E0 ,
(solid) 0E ,
Lc
LET
LT
c
ET
T
Lm
m
Sm
Energy vs. Temperature Graph with Enthalpy Scheme:
Explicit Time SchemeInitial Temperature Known: Initial Enthalpy Set Resistance and Fluxes from Initial Temperature and Enthalpy Update Enthalpies at Update Temperature Update Liquid Fraction
MjxTT jinitj ,...,2,1 ),(0 MjE j ,...,2,1 ,0
1njE 1nt
Flux and Resistance Drive Heat Flows
with2/1
12/1
j
nj
njn
j R
TTq
SL k
x
k
xR
2
)1(
2
Update Enthalpy at Next Time Step
(The Discretized Enthalpy)
Mjqqx
tEE n
jnj
j
nnj
nj ,...,1 ],[ 2/12/1
1
Update Temperature at Next
Time Step:
(liquid) ,
)(interface 0 ,
(solid) 0 ,
T
LEc
LET
LET
Ec
ET
nj
L
nj
m
njm
nj
S
nj
m
nj
Update Liquid Fractions/Phases:
(liquid) if ,1
(mushy) 0 if ,
(solid) 0 if ,0
nj
nj
nj
nj
nj
EL
LEL
E
E
Glauber’s Salt Example
solidfor ty conductivi10162
liquid)for ity (conductiv10590
solid)for heat (specific761
liquid)for heat (specific313
heat)(latent 21251
re) temperatuimposing (90
re) temperatu(initial25
erature)(melt temp32
(density)1460
3
3
3
CkJ/ms.k
CkJ/ms.k
CkJ/kg.c
CkJ/kg.c
kJ/kg.L
CT
CT
CT
kg/mρ
oS
oL
oS
oL
oL
oS
om
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 :
exioutXoutXout TioutTerrorTerrorT )(,max
exactXfronterrorXerrorX ,max
maxt
outX
exacthistiXoutXout TiTerrorTerrorT )(,max
exactprofitt TiTerrorTerrorT )(,maxmaxmax
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
hrst 50max
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 ε:
m
mm
m
TTLiquid
TTTMushy
TTSolid
:
:
:
E vs. T graph with enthalpy scheme (solid) and mushy scheme (dashed)
Introducing mushy2p
Explicit schemeIndependent from Stefan2pDiffers from Stefan 2p (PDE function)Imposed mushy zone affects
- Temperature
- Liquid fraction
Temperature
(solid) if
(mushy) 0.0 if
(liquid) 0.0 if
LEc
LET
LEL
ET
Ec
ET
T
njL
p
nj
m
nj
njm
njS
p
nj
m
nj
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
njm
mnjm
mnj
mnj
nj
TεT
ε TTTTT
T T
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 increasesIs 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?
solidfor ty conductivi10162
liquid)for ity (conductiv10590
solid)for heat (specific761
liquid)for heat (specific313
heat)(latent 21251
re) temperatuimposing (90
re) temperatu(initial25
erature)(melt temp32
(density)1460
3
3
3
CkJ/ms.k
CkJ/ms.k
CkJ/kg.c
CkJ/kg.c
kJ/kg.L
CT
CT
CT
kg/mρ
oS
oL
oS
oL
oL
oS
om
Recap: Glauber’s 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 x3.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 mM = 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 hrsM = 32, = 1/32 = .03125 = x
Max error 1.39 °C
T(x,t) profile at t = tmax = 50 hrsM = 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– 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?
• 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?