Next: , Previous: Elasticity problem, Up: Solving problems


3.2.4 Navier-Stokes problem

The following sequence is a short excerpt from the Driven cavity demo in femlisp/src/applications/navier-stokes/driven-cavity.lisp. It solves the two-dimensional driven cavity problem with Reynolds number 10. During the approximation the velocity components at the midpoint (0.5,0.5) are printed.

(solve 
 (blackboard
  :problem (driven-cavity 2 :reynolds 10.0) :base-level 0
  :success-if '(> :time 20.0) :output t :observe
  (append *stationary-fe-strategy-observe*
          (list
           (list (format nil "~{                 u~1D~}" '(1 2))
                 "~{~19,10,2E~}"
                 #'(lambda (blackboard)
                     (let ((val (fe-value (getbb blackboard :solution)
                                          #d(0.5 0.5))))
                       (loop for i below dim collect
                             (vref (aref val i) 0)))))))))