As part of the Solar Orbiter science support activities and in conjunction with the ERC Synergy WholeSun grant, researchers from CEA Paris-Saclay, together with an international collaboration, have developed advanced numerical simulations to study the formation of structures of the solar wind. These simulations allow studying the interaction of the convection at the solar surface with the magnetic field. They reveal the appearance of twisted magnetic structures that can participate in the creation of switchbacks.