error_reporting

<< Click to Display Table of Contents >>

Navigation:  Sample Problems > Usage > Functions >

error_reporting

Previous pageReturn to chapter overviewNext page

{ ERROR_reporting.PDE

 This sample shows the use of the TIME_ERROR and SPACE_ERROR functions.

 It is a copy of the sample CHEMBURN.PDE.

}

 

title

'Open Tube Chemical Reactor with Strip Heater'

 

select

  painted     { make color-filled contour plots }

 

variables

 Temp(threshold=0.1)

 C(threshold=0.1)

 

definitions

 Lz = 1

 r1=1

 heat=0

 gamma = 16

 beta = 0.2

 betap = 0.3

 BI = 1

 T0 = 1

 TW = 0.92

 RC = (1-C)*exp(gamma-gamma/Temp) { the very nasty reaction rate }

 xev=0.96     { some plot points }

 yev=0.25

 

initial values

 Temp=T0

 C=0

 

equations

 Temp:     div(grad(Temp)) + heat + betap*RC = dt(Temp)

 C:        div(grad(C)) + beta*RC = dt(C)

 

boundaries

region 1

  start (0,0)

 

  { a mirror plane on X-axis }

  natural(Temp) = 0

  natural(C) = 0

  line to (r1,0)    

 

  { "Strip Heater" at fixed temperature }

  { ramp the boundary temp in time, because  discontinuity is costly to diffuse }

  value(Temp)=T0 + 0.2*uramp(t,t-0.05)                                    

 

  natural(C)=0               { no mass flow on strip heater }

  arc(center=0,0) angle 5    

 

  { convective cooling and no mass flow on outer arc }

  natural(Temp)=BI*(TW-Temp)

  natural(C)=0                

  arc(center=0,0) angle 85    

 

  { a mirror plane on Y-axis }

  natural(Temp) = 0

  natural(C) = 0

  line to (0,0) to close  

 

time 0 to 1

 

plots

for cycle=10                 { watch the fast events by cycle }

  grid(x,y)

  contour(Temp) fixed range (0.9,2.5)

  contour(C) as "Completion" fixed range(0,1.1)

  contour(space_error())

  contour(space_error(Temp))

 

for t= 0.1 by 0.05 to 0.2 by 0.01 to 0.3 0.5 endtime   { show some surfaces during burn }

  contour(Temp) fixed range (0.9,2.5)

  surface(Temp) fixed range (0.9,2.5)

  contour(C) as "Completion" fixed range(0,1.1)

  surface(C) as "Completion" fixed range(0,1.1)

 

histories

history(Temp) at (0,0) (xev/2,yev/2) (xev,yev) (yev/2,xev/2) (yev,xev)

history(C) at (0,0)  (xev/2,yev/2) (xev,yev) (yev/2,xev/2) (yev,xev) as "Completion"

history(time_error(Temp),time_error(C),time_error())

history(time_error(Temp),time_error(C))

 

end