Page 247 - Process Modelling and Simulation With Finite Element Methods
P. 247

234        Process Modelling and Simulation with Finite Element Methods


          Now, the major features of the program, fi1mdry.m:
          Initialization
          %  FEMLAB Model M-file
          %  Generated 08-May-2002 23:11:18 by FEMLAB 2.2.0.181.
          xx=[0:0.001:1];
                         )
          u=zeros (size (xx) ;
          %  Define parameters
          Pe=l.  ;
          slope=l. ;
          offset=2.;
          theta-rn=0.64;
          theta-0=0.4;
          alpha=(theta-m/(theta_m-theta-O)  );
          endtime=l/alpha;
          slottimes=[0.01:0.01:endtimel ;
          %  set up storage for output
          output=zeros(length(slottimes),length(xx));
          %  Roll out the frozen front position loop
          for j=l:length(slottirnes)
              tau=slottimes  (j) ;
              frontpos=(l-alpha*tau)/(l-tau);
          %  Now just alter some parts of the single pass model m-file
          ...
          front=pointl (frontpos)
                                ;
          ...
          %  Define constants
          fem.const={  ...
                  'thetam',thetam, ...
                  'theta-O',theta_O, ...
                  'alpha',  alpha, ...
                  'Pel,     Pe, . . .
                  'tau',    tau, . . .
                  'slope', slope, ...
                  'offset', offset};
          %  Multiphysics
          fern=multiphysics (fern)  ;
          %  Extend the mesh
          fem.xmesh=meshextend(fem,'context','local','cplbndeq','on','cplbndsh',
              )
           'on' ;
          %  Evaluate initial condition
          if j==1
                   init=asseminit(fem, ...
                  'context','local', ...
                  'init',  fem.xmesh.eleminit);
          end
          if jzl
                  %  Map initial solution to current xmesh
                  fern0  . sol. u ( : ,1: end-1) = [I  ;
                  umap={ ~U~,I,I,I,O};
                  init=asseminit (fern, tinit', {fernO,umap}) ;
          end
           %  Save current fem structure for restart purposes
           f ernO=f em;
   242   243   244   245   246   247   248   249   250   251   252