↑top

XSim User manual

Tutorial : Unsteady external flow

Updated: June 22, 2019

In this tutorial, we will create analysis area around a imporing shape and setting files for OpenFOAM®.

Analysis summary

We will calculate the external flow around a simple car-model (Ahmed body) for 5 seconds in simulation time. The model is placed in a air flow of approximately 10 km/h.

ParaFoam velocity result Analysis result

Creating an analysis configuration file

Creating a project

Open XSim. Type "MyProject" as Project Name and click Create button to create project.

A dialog for project creating A dialog for project creating

Importing shapes

We will use a prepared shape file in this tutorial. Please download a zipped file from next link, "tutorial-AhmedBody.zip", and extract it.

Drag&Drop the extracted file "AhmedBody.stl" at "Drop files" tab and load it. The loaded shape will be shown in 3D view.

Importing shapes from a file Importing shapes from a file

Select "Cuboid" as type in "Add shapes" tab and set (-2, -1.5, 0) m to minimum coordinate, (5, 1.5, 1.5) m to maximum coordinate. Then click Add. You can switch the 3D display to semitransparent by clicking a display-mode button'toggle display' iconunder 3D view.

Adding a shape Adding a shape
Adding a shape for analysis area (3D view) Adding a shape for analysis area (3D view)

Click Next button to go to Mesh page.

Mesh

  • Refinement settings

    Select "Cuboid" as range type in "Refinement settings" and set (-0.1, -0.5, 0) m to minimum coordinate, (3, 0.5, 0.5) m to Maximum coordinate. And set 2 to refinement level. Preview the range shape by clicking preview button「プレビュー」アイコン, then click Add.

    Refinement settings (Cuboid) Refinement settings (Cuboid)
    Cuboid area for refinement Cuboid area for refinement

    Then select "Surface" as range type in "Refinement settings" and "AhmedBody" as assembly. Set 3 to refinement level and click Add.

    Refinement settings (Surface) Refinement settings (Surface)
  • Layer mesh settings

    Confirm that 0.3 is set to layer thickness ration and 3 is set to number of layers. Click "AhmedBody" and "ZMin" in Navigation view at left side of the window to select, then click Set.

    Layer mesh settings Layer mesh settings

Click Next button to go to Basic Settings page.

Basic Settings

In this section, we will set a type of analysis. Select "Transient" and set 5 seconds as end time.

Basic Settings Basic Settings

Click Next button to go to Physical Property page.

Physical Property

In this section, we will set a type of fluid. Click Physical property library button'Physical property library' iconto show dialog. Select "Air" in the dialog and click OK.

Physical Property Physical property
A dialog for physical property library A dialog for physical property library

Click Next button to go to Initial Condition page.

Initial Condition

We will set initial flow field to get final solution as early as possible. Select "Velocity" as physical quantity and set (2.77, 0, 0) m/s as value. Then click Set.

Initial condition settings Initial condition settings

Click Next button to go to Flow Boundary Condition page.

Flow Boundary Condition

  • Inflow boundary

    Select "Selected regions" as region and "Fixed flow velocity" as type. Then select "XMin" on Navigation view and set (2.77, 0, 0) m/s as flow velocity. After that, click Set.

    Inflow boundary condition Inflow boundary condition
  • Outflow boundary

    Select "Selected regions" as region and "Fixed static pressure" as type. Then select "XMax" on Navigation view and set 0 Pa as static pressure. After that, click Set.

    Outflow boundary condition Outflow boundary condition
  • Stationary wall boundary

    Select "Selected regions" as region and "Stationary wall" as type. Then select "AhmedBody" and "ZMin" on Navigation view and click Set.

    Wall boudary condition Wall boudary condition

Inflow boudary and outflow boudary are displayed as arrows in 3D view.

Inflow/Outflow boundaries will be shown in 3D view Inflow/Outflow boundaries will be shown in 3D view

Click Next button to go to Calculation Settings page.

Calculation Settings

In this section, we set parallel number of CPU core for using this calculation (for example, 4).

Calculation settings Calculation settings

Click Next button to go to Output page.

Output

Because this analysis is a transient analysis, select "Each specified time" as type and set 1 second to interval.

Output settings Output settings

Click Next button to go to Export page.

Export

Finally we finished all setings. Click Export button to export the analysis setting as zipped OpenFOAM case directory "MyProject.zip". The zip file download starts immediately.

エクスポート Exporting

Running calculation

Extract downloaded file "MyProject.zip". There is a bash-script "Allrun " in the case directory. So run the script to make mesh and calculate the OpenFOAM solver by following command.

./Allrun

If the machine that calculation is running has desktop environment and gunuplot was installed, residual convergence chart will be displayed.

Chart for monitoring Chart for monitoring

Confirming calculation result

After the calculation, execute a following command to visualize the mesh and the calculation result.

paraFoam

Mesh is following.

Mesh of shape surface Mesh of shape surface
Mesh of cross section in flow direction Mesh of cross section in flow direction
Mesh of cross section in flow direction (zoom) Mesh of cross section in flow direction (zoom)

Distributions of Flow velocity and pressure are following.

Flow velocity distribution Flow velocity distribution
Flow velocity distribution (only fluid-side) Flow velocity distribution (only fluid-side)
Pressure distribution Pressure distribution
Pressure distribution (only fluid-side) Pressure distribution (only fluid-side)