% This document contains the known differences between FluidsSolver2_DO.m (latest) and NavierStokesInc_DO_rho.m (original), % following Jing and Pat's updates in January 2014. % % % Written by: Tapovan Lolla. % Last Updated: 5th February, 2014. 1. Several changes in solver documentation, code formatting and white spaces (code formatting and white spaces have been partially addressed in my commited version of the codes). 2. Initialization of default options (related to the solver, tracer equations, advection, diffusion, Coriolis forces, open boundary conditions, and the DO solver. 3. Lines %Set tolerances etc. for GMRES solvers TOL=sqrt(eps); MAXIT=20; RESTARTS=10; are absent in FluidsSolver2_DO.m. They are unused in the rest of NavierStokesInc_DO_rho.m 4. Diffusion operators. NavierStokesInc_DO_rho.m uses mk_DiffusionOperator to build diffusion matrices, assuming isotropic diffusion. FluidsSolver2_DO.m uses Diffusion_Operator to build the diffusion matrices. 5. Diffusion_Operator handles anisotropic diffusion and multiplies viscosity inside the function, while mk_DiffusionOperator does not. 6. Boundary conditions are 'fixed' using FixDiffPObcs.m and FixDiffuvDbcs.m in NavierStokesInc_DO_rho.m, and there is no such operation in FluidsSolver2_DO.m. My intuition is that this fixing is performed within Diffusion_Operator.m 7. Diffusion_Operator.m gives out an additional output in the RHS vector, Dfs_bc_u etc. 8. FluidsSolver2_DO.m defines variables Dfs_u_TmMch etc. in place of Au etc. in NavierStokesInc_DO_rho.m. 9. Lines AU = -app.nu*Au etc. are removed since multiplication by non-dimensional viscosity is performed inside Diffusion_Operator.m NOTE: Dfs_u_TmMch ~ Au, Dfs_u ~ -AU etc. 10. The lines imposemean = false; if isempty(bcsDP) imposemean = true; end are absent in FluidsSolver2_DO.m, and correcty so. 11. Variables Neu, Nev in NavierStokesInc_DO.m are changed to bcN_ID_u, bcN_ID_v in FluidsSolver2_DO.m 12. The condition if app.S(1) > 0 || length(app.S)>1 in NavierStokes_Inc_DO.m is changed to if (app.S(1) > 0) in FluidsSolver2_DO.m 13. YYt has been renamed as Yi. 14. app.DOAdapt has been renamed to app.DOAdaptIntrvl 15. ui00 etc have been renamed to ui_old etc. (I changed ui00 etc. to ui_old etc in the old NavierStokesInc_DO_rho.m). 16. CYYINV has been renamed as CYY_Inv 17. FluidSolver2_DO.m uses Grad2D_P instead of Grad2d to calculate the pressure gradients. 18. app.PrRa of NavierStokesInc_DO_rho.m seems to have been renamed to app.g. 19. The term + app.Frhoi(T,[XP(idsP) YP(idsP)], rhoi_old(pid,:)); is added as an additional relaxation forcing in FluidSolver2_DO.m 20. irk is renamed to iRK. 21. Inner product computations before evolving the mean fields and during mode evolution are vectorized in FluidsSolver2_DO.m (See computation of A1j, A2j etc. and the computation of InProdi) 22. Computation of RHSq to advance mean fields includes Dfs_bc_rhs_rho instead of app.kappa*rhsrho. Furthermore, the relaxation term app.Frho is included in FluidSolver2_DO.m and is not a part of NavierStokesInc_DO_rho.m. Similar comments apply to RHSu and RHSv. 23. The loop for advancing the modes (ui, vi, rhoi) uses -Dfs_rho, -Dfs_u, -Dfs_v instead of ARHO, AU and AV. Additionally, the relaxation term app.Frho is present in the forcing for rhoi. 24. Computation of pressure gradients after calculation of InProdi uses Grad2D_P.m 25. Computation of dudx, dvdy uses Grad2D_uv, instead of Div2D. These two functions even use a different ordering of input arguments. Furthermore, the computation of the RHS of the Poisson pressure correction (q) equation uses Dfs_bc_rhs_q instead of rhsPbc. 26. Computation of gradients of q (to correct mean velocities) uses Grad2D_P instead of Grad2D. 27. Pressure correction options (NonIncremental and NonRotational) are present in FluidsSolver2_DO.m and absent from NavierStokesInc_DO_rho.m 28. FluidsSolver2_DO.m uses app.nu and app.nu2. For isotropic diffusion, we must set app.nu = app.nu2. 29. Subtraction of mean pressure from final corrected pressure is performed differently, i.e. without using the Dirichlet boundary conditions for Pressure. 30. Statements 25-29 hold for pressure/velocity mode corrections as well. 31. Correcting DO Modes for implicit terms: Use -Dfs_rho, etc. instead of ARHO etc. Vectorization of Inner Product computations. These changes need to be propagated to the NavierStokesInc_DO_rho.m code. % EOF.