# Magnetized Ramp Flow (rampFlow.pre)¶

Keywords:

body fitted grid, MHD, ramp flow, supersonic

## Problem description¶

This simulation shows magnetized flow over a ramp using ideal magnetohydrodynamics. The shock wave leads to compression of both the fluid and the magnetic field.

This simulation can be performed with a USimBase license.

## Creating the run space¶

The Magnetized Ramp Flow example is accessed from within USimComposer by the following actions:

• Select the New from Template menu item in the File menu.
• In the resulting New from Template dialog, expand USimBase: Basic Physics Capabilities.
• Select Magnetized Ramp Flow and press the Choose button.
• In the Choose a name for the new runspace dialog, press the Save button to create a copy of this example in your run area.
• Press the Save And Process Setup button in the upper right corner of the Editor pane.

The basic example variables are editable in the Editor pane of the Setup window as described below. After any change is made, the Save and Process Setup button must be pressed again before a new run may commence.

## Input file features¶

The input file allows the user to set a variety of problem parameters related to the physics, initial conditions, domain and solver used for the magnetized ramp flow problem.

The following parameters control the physics of the magnetized ramp flow problem:

• THETA controls the angle of attack of the ramp.
• PRESSURE controls the pressure of the inflowing fluid.
• DENSITY controls the density of the inflowing fluid.
• MACH_NUM sets the ratio of the flow velocity to the sound speed (the Mach number) for the inflowing gas.
• BETA controls the ratio of the gas pressure to the magnetic pressure in the inflowing gas.
• GAS_GAMMA sets the adiabatic index (ratio of specific heats) of the fluid.

The following parameters control the dimensionality, domain size and resolution of the simulation:

• NDIM = 2,3 selects whether to run the problem in two- or three-dimensions.
• SCALE sets the resolution of the grid. Large values correspond to higher resolution.

The following parameters control the duration of the simulation and data output:

• TEND sets the end time for the simulation
• NUMDUMPS sets the number of data dumps during the simulation
• WRITE_RESTART = False,True tells USim to output data necessary to restart the simulation. If this parameter is set to False then the Restart at Dump Number functionality in the Standard tab under Runtime Options in the Run window will not be available.

The following parameters control the USim solvers used to run the simulation:

• TIME_ORDER = first,second,third,fourth sets the order of accuracy for the time-integration.
• DIFFUSIVE = False,True sets whether to use diffusive (but robust!) spatial integration schemes.
• DEBUG = False,True sets whether to output data for debugging a run. Warning: this will output A LOT of information!

## Running the simulation¶

After performing the above actions, continue as follows:

• Proceed to the Run window by pressing the Run icon in the workflow panel.
• To run the simulation, click on the Run button in the upper right corner of the Logs and Output Files pane.

You will also see the engine log output in the Logs and Output Files pane. The run has completed when you see the output, “Engine completed successfully.”

## Visualizing the results¶

After performing the above actions, continue as follows:

• Proceed to the Visualize window as instructed by pressing the Visualize icon in the workflow panel.
• Press the Open button to begin visualizing.
• Expand Scalar Data and click the check box for fluids/density to visualize fluid density.
• Drag the slider at the bottom of the Visualization Results pane to move through the simulation in time. The density at the end of the simulation is shown in Fig. 77.

Figure 77: Visualization of the fluid mass density in the Magnetized Ramp Flow example

## Further experiments¶

• You can increase the steepness of the shock by reducing the Mach number (MACH_NUM).
• You can also change the angle of the shock by changing the ramp angle (THETA).
• Set NDIM to 3 to solve the magnetized ramp flow problem in 3D. The increased computational requirements of such a simulation means that you should enable Run with MPI in the MPI tab under Runtime Options in the Run Window.