FLUENT 6 - Utility to check if convergence has been reached with the current data without having to iterate


This solution provides a simple Scheme function that will enable the user to check if convergence has been attained with the solution in the currently loaded data file without having to iterate and display residual values.


;;; A Scheme Function does the trick. Just load this file into fluent and issue the command
;;; (check-convergence)
;;;;
;;;; It returns #t or #f depending on whether all convergence criteria have been met.

(define truth (lambda (ls) (if (null? ls) #t (and (car ls) (truth (cdr ls))))))
(define check-convergence
(lambda ()
(let ((res (map cdr (solver-residuals)))
(convcrit (map caddddr (client-get-var 'residuals/settings)))
(value))
(truth (map (lambda (a b) (if (< a b) #t #f)) res convcrit))
)))





Show Form
No comments yet. Be the first to add a comment!