Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

ns.hpp

Go to the documentation of this file.
00001 //************************************************************************************//
00002 // Module       : ns.hpp
00003 // Date         : 8/4/02 (DLR)
00004 // Copyright    : 2002-2006 Copyright University Corporation for Atmospheric
00005 //                Research
00006 // Description  : Encapsulates the methods and data associated with
00007 //                the solver for the Navier-Stokes equations. The problem solved is
00008 //                du/dt + u.Del u + 1/rho Del p -  nu_  Del^2 u = 0
00009 // Derived From : none.
00010 // Modifications:
00011 //************************************************************************************//
00012 #if !defined(NAVIER_STOKES_SOLVER_HPP)
00013 #define NAVIER_STOKES_SOLVER_HPP 
00014 
00015 #include "gstepper.hpp"
00016 #include "cg.hpp"
00017 #include "gttlist.hpp"
00018 #include "gelemlist.hpp"
00019 #include "gfieldlist.hpp"
00020 #include "glinoplist.hpp"
00021 #include "gobjlist.hpp"
00022 #include "gadvect.hpp"
00023 #include "stokes.hpp"
00024 #include "ab.hpp"
00025 #include "ext.hpp"
00026 #include "glop.hpp"
00027 
00028 class NavierStokes : public GStepper
00029 {
00030 public:
00031          enum TIME_EVOLTYPE {TE_OIFS=0, TE_ABBDF, TE_EXBDF};
00032 
00033                            NavierStokes(GFieldList *ulist[], GINT nf, GElemList *uelems, GElemList *pelems, GINT t);
00034                           ~NavierStokes();
00035 
00036          GBOOL             Step(GDOUBLE dt);                                              // Take one time step
00037          GDOUBLE           GetIntegTime();                                                // Get total integration time
00038 //       GDOUBLE           TimeStep();                                                    // Get minumum timestep
00039 
00040 
00041          void              SetEvolType(TIME_EVOLTYPE itype);                     // Set time stepping scheme
00042          void              SetFields(GFieldList *u1list, GFieldList *u2list, 
00043                                      GFieldList *pelist);
00044                                                                                           // Set field list
00045          void              SetComm(GS  *ggs);                                             // Set global gather scatter operator
00046          GCHandle          SetCommHandle(GCHandle hIn) ;                                  // Initializes comm with existing handle 
00047          void              SetVisc(const GDOUBLE nu);                                     // Set kinematic viscosity, nu
00048          void              SetVisc(const GDOUBLE nu, GINT idir);                          // Set kinematic viscosity, nu
00049          void              SetDen(const GDOUBLE rho);                                     // Set const. density
00050          void              SetPreconditioner(GINT iwhich, GPC type );
00051          void              SetAdvOrder(GINT  iorder);                                     // Sets order of Adams-Bashforth explicit advection approx.
00052          void              SetBDFOrder(GINT  iorder_bdf);                                 // Sets order of BDF time approx.
00053          void              SetFilter(GLinOpList *filter);                                 // Sets filter operator
00054          StokesSolver      *GetStokes() { return stokes_; }                               // Get Stokes operator
00055          GDOUBLE           GetDivMax(GINT  iLevel);                                       // Get max(divergence V ) for time level iLevel
00056          void              DivV(GFieldList *divv);                                        // Compute Div.V field
00057          CG                *GetSolver(GINT iwhich);
00058          void              SetVBdyData (GINT  idir, GVecList *bdy_vals);                  // Set bcs for component idir
00059          void              SetTimestepHistory(GDBuffer *dthist);                          // Set timestep hist. buffer for AB/Ext methods
00060          void              SetNSubcycles(GINT nsub);                                      // Set number of OIFS subcycles
00061 
00062          void              SetTime(GDOUBLE t);                                            // Set stepper time
00063          void              SetDoAdvection(GBOOL bflag);                                   // Set Do Advect flag
00064          void              SetDoDealiasing(GBOOL bflag);                                  // Set Do Dealiasing flag
00065          GBOOL             ResetExpandables();                                            // Create  dynamically-allocated list-dependent quantities
00066 
00067 private:
00068          // Methods:
00069          GBOOL             DoNormalStep(GDOUBLE dt);                                      // Step with adv. from GAdvect
00070          void              DeleteDynamic();                                               // Delete dynamically-allocated list-dependent quantities
00071          GBOOL             Advect(GDOUBLE dt, GINT  &iLevel);                             // Do advection 
00072          GBOOL             ElemListChange();                                              // Determine if element list has changed
00073 
00074 
00075 
00076 
00077          // Field and other data:
00078          GCHandle          hDSOp;
00079          TIME_EVOLTYPE     itime_type_;
00080          STOKES_TYPE       iStokes_type_;
00081          GBOOL             bInitReqd_;
00082          GBOOL             bDoAdvect_;
00083          GINT              irank_;
00084          GINT              nelems_;
00085          GINT              ntimelevels_;
00086          GINT              icycle_;
00087          GDOUBLE           maxCFL_;
00088          GDOUBLE           dt_curr_;
00089          GDOUBLE           dt_last_;
00090          GDOUBLE           time_;
00091          GDOUBLE           rho_;
00092          GFieldList        *var_list_[GDIM+1];
00093          GElemList         *uelems_;
00094          GElemList         *pelems_;
00095          GVecList          *ubdyvals[GDIM];
00096          GVecList          pu_[GDIM];
00097          GVecList          Nj_[GDIM];
00098 
00099 
00100          // Math operators
00101          GAdvect          *advect_;    // (macro) Advection operator 
00102          StokesSolver     *stokes_;    // Stokes solver
00103 
00104          // Communication:
00105          GS               *gsop;       // communication operator
00106       
00107 };
00108 
00109 #endif

Generated on Wed Dec 21 16:00:48 2005 for Geophysics & Astrophysics Spectral Element Adaptive Refinement (GASpAR) 2D Code by  doxygen 1.4.4