A magnetohydrodynamic description is used to study magnetic fusion plasmas in two different configurations: tokamak and reversed field pinch. A Fourier pseudo-spectral method with a volume penalization technique are used to solve the system of equations. The penalization method is used to introduce Dirichlet boundary conditions and it al- lows to easily modify the consider geometry. The simulations of a tokamak configuration in a toroidal geometry show the spontaneous appearance of velocities. These velocities are dominated by their toroidal component if the system is little dissipative. It is also shown that the symmetry breaking of the cross section of the torus causes a toroidal angular momentum to develop. For the Reversed Field Pinch configuration we show the appearance of helical structures. The shape of these structures varies with the value of the transport coefficients and with the pinch ratio parameter of the imposed magnetic field. To complete the study, we compare the results of simulations obtained in toroidal and in periodic cylindrical geometries. The differences in the dynamics of these two cases are highlighted. Finally, simulations are compared to experimental data and a significant better agreement is observed between the simulation and the experiment for the toroidal geometry than for the cylindrical case.