Applications of functional analysis and global analysis to some problems in fluid dynamics and magnetofluid dynamics