Page 248 - Process Modelling and Simulation With Finite Element Methods
P. 248
Geometric Continuation 235
t Postinterp the solution
[is,pel =postinterp(fem,xxj
;
[ul =postinterp(fem, ‘u’ ,is) ;
j
output (j, : ) =u-ones (size (u) ;
end
% Write the final output to file
dlmwrite ( ’ f ilmroll . dat ’, output ’ , ‘ , ’ ) ;
quit;
Note that we write the transpose of the matrix output, purely for the convenience
of the graphics package (GNUPLOT) which plots column vector data. The file
filmroll.dat contains the current solution less one, which helps in maintaining
accuracy, since by default, MATLAB writes five significant figures, but
internally stores double precision floating point numbers (about twelve
significant figures). The post interp command generates an interpolation
structure [is,pe], which can be applied to the solvent concentration ‘u’ or any
other computed quantity, say ‘ux’ or ‘ut’. This is the common way to extract
detailed information about the solution from the fem structure. A frequently
asked question in FEMLAB seminars is how to get the GUI to output a “data
file” for import into the favorite graphics package. Figures 6.12 - 6.19 were
generated using GNUPLOT on data output from MATLAB using postinterp
on a fern structure.
The role of the two if structures, (if j==1 ...) and (if j>l ...), are crucial to
the model formulation. The default setting is to initialize with the initial fields
u(tO)=l. This is done during the first time step using the (if j==1 ...) structure.
For subsequent time steps, the (if j>l . . .) structure interpolates the solution from
the last time step (femO.so1) onto the new mesh and places the interpolated
solution in the init field of the new fem structure. I wish I could take the credit
for this fancy programming effort using little understood features of
asseminit (j , but in fact, all I did was to get the GUI to generate the commands
automatically by altering a mesh and using the solve using previous solution
toolbar button. The model m-file provided the appropriate code for
asseminit (1. Since it is easy to run fi1mdry.m with the default setting, we did
this for Figure 6.12 and term it the “non-cumulative” model. Running with the
interpolation scheme on for the cumulative effect of the point source at the
compaction front as written above is termed the “cumulative” model. The non-
cumulative model permits the understanding of the compaction front dynamics in
the abstract.
Figure 6.12 demonstrates the model predictions for equal duration front
translation “hops” and convective-diffusive relaxation steps of At=O.Ol . As we
saw in Figure 6.11, the initial profile rises along the upper compaction layer,
with the top surface having elevated surfactant concentration. The boundary
condition (no flux) requires the flat profile. At subsequent times, the peak