Page 353 - Process Modelling and Simulation With Finite Element Methods
P. 353
340 Process Modelling and Simulation with Finite Element Methods
which time FEMLAB crashes. We tried fldaspk and odel5s time integration
schemes without success. The discontinuity makes the convergence criteria
unattainable. Perhaps with fixed time step it is possible to “ram through” the
discontinuity, accepting the large error, but even then the abrupt change is likely
to lead to oscillatory artifacts. There are some schemes, like total variance
diminishing and essentially non-oscillatory methods, which might alleviate this
difficulty, but they are not implemented in MATLAB or finite element methods
to our knowledge. So we abandoned this approach.
B2. Smoothed square waves
Perhaps the nonconvergence was due to the instantaneous switch which could be
alleviated by smoothing the signal. We coded a Fourier Cosine Series
representation of the square wave:
1 2n + 1)nt
2n+l
This was coded as a MATLAB m-file function, square.m, and placed in the
MATLAB current directory:
function a=square (t, tau)
sum= 0 ;
for n=1:10
sum=sum+4*tau*cos (pi* (2*n-1) *t/tau) / (2*n-1) /pi;
end
a=sum;
Figure 9.10 shows the square wave form approximating the first ten terms (n=9).
Although the jumps are no longer infinitely steep, the price paid is non-physical
oscillations and overshooting the steady levels. These are historical difficulties
for electronic circuits used as function generators for square waves, overcome by
sophisticated filters. The coding in coupling variables as below was successful
to a greater extent than the logical function coding:
switching cosine series
Qa
zetal*((PHIB-PHIA)*square(t,l)+PHIA-volta)/dsa-Re*(PA-bara)/f/dsa
Qb
zetal*((PHIA-PHIB)*square(t,l)+PHIB-voltb)/dsb-Re*(PB-barb)/f/dsb
Ia
sigr* ( (PHIB-PHIA) *square (t, 1) +PHIA-volta) /dsa
Ib
sigr* ( (PHIA-PHIB) *square (t, 1) +PHIB-voltb) /dsb
The success was that this method actually integrates, yet exceedingly slowly.
Why? Because the time integration must resolve all the non-physical oscillations
in the square wave, which slows down the within half-period integrations, and
then the jumps are inordinately slow, but eventually the new flow configuration