Auto iterate with transient solver
Need to iterate with fixed time step until time > T. For last time step, adjust dt so that tfinal = T. ;; Use the following scheme functions : ;; ;; Two Functions to autoiterate until a certain time is reached. ;; ;; 1. (aice tfinal) is for use by the coupled explicit solver ;; ;; 2. (ai tfinal ipts) is for use by the other solvers, where ipts is the maximum ;; number of iterations per time step ;; ;; Once time >= tfinal, no more iterations are performed. ;; ;; (define deltat) (define (aice tfinal) (set! deltat ( tfinal (rpgetvar 'flowtime))) (if (> deltat 0) (if (> deltat (rpgetvar 'physicaltimestep)) (begin (iterate 1) (aice tfinal) ) (begin (format "nWarning: Requested time step is ~a. Reducing time step to ~a.n" (rpgetvar 'physicaltimestep) deltat) (rpsetvar 'physicaltimestep deltat) (iterate 1) (aice tfinal) ) ) (display "nAutoiterate Done.n") ) ) (define (ai tfinal ipts) (set! deltat ( tfinal (rpgetvar 'flowtime))) (if (> deltat 0) (if (> deltat (rpgetvar 'physicaltimestep)) (begin (physicaltimesteps 1 ipts) (ai tfinal ipts) ) (begin (format "nWarning: Requested time step is ~a. Reducing time step to ~a.n" (rpgetvar 'physicaltimestep) deltat) (rpsetvar 'physicaltimestep deltat) (physicaltimesteps 1 ipts) (ai tfinal ipts) ) ) (display "nAutoiterate Done.n") ) ) 

