↑top

Tutorial : Heat convection by a heater

Updated: January 21, 2020

In this tutorial, we will calculate a heat convection of a room that has a heater and a window facing open air.

Analysis summary

The room has a a window facing open air of 0 ℃. And there is a heater of 76.85 ℃ at the center of a room. We calculate a stationary state of this room and measure the temperatures at wall side and the window side.

ParaFoam velocity result Analysis result

Creating an analysis configuration file

Creating a project

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

プロジェクトの作成ダイアログ A dialog for project creating

Importing shapes

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

Drag&Drop the extracted file "Wall.stl", "Window.stl" and "Heater.stl" at "Drop files" tab and load it. The loaded shape will be shown in 3D view. You can switch the 3D display to semitransparent by clicking a display-mode button'display-mode' iconunder 3D view.

Importing shapes from files Importing shapes from files

Click Next button to go to Mesh page.

Mesh

  • Volume mesh settings

    Set 50000 as target number of base meshes. You can preview the base mesh by clicking preview button'preview' icon.

    Setting target number of base meshes Setting target number of base meshes
    Base mesh preview Base mesh preview
  • Layer mesh settings

    Confirm that 0.3 is set to layer thickness ration and 3 is set to number of layers. Click "Heater" 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 "Steady" and set 1000 as end cycle. Then check the Heat.

Buoyancy force is taken into account in heat analysis. Therefore a direction of gravity force should be set properly. When Heat is enabled, direction of gravity force will be shown in 3D view.

Basic Settings Basic Settings
Confirming gravity direction Confirming gravity direction

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 temperature to get final solution as early as possible. Select "Temperature" as physical quantity and set 300 K as value. Then click Set.

Initial condition settings Initial condition settings

Click Next button to go to Flow Boundary Condition page.

Flow Boundary Condition

  • Heater

    Select "Selected regions" as region and "Stationary wall" as type. Then select "Fixed temperature" as heat condition type and set 350 K as temperature. After that, select "Heater" on Navigation view and click Set.

    Fixed temperature condition (Heater) Fixed temperature condition (Heater)
  • Window

    Select "Selected regions" as region and "Stationary wall" as type. Then select "Fixed temperature" as heat condition type and set 273.15 K as temperature. After that, select "Window" on Navigation view and click Set.

    Fixed temperature condition (Window) Fixed temperature condition (Window)
  • Wall

    Select "Selected regions" as region and "Stationary wall" as type. Then select "Adiabatic" as heat condition type. After that, select "Wall" on Navigation view and click Set.

    Adiabatic condition (Wall) Adiabatic condition (Wall)

Click Next button to go to Calculation Settings page.

Calculation Settings

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

Calculation settings Calculation settings

Click Next button to go to Output page.

Output

Because this analysis is a steady analysis, select "Each specified cycles" as type and set 50 cycles to interval.

Output settings Output settings

Next, we will make the temperature sampling settings at the specified coordinates.

Select the "Sampling" tab, set "Temperature" as the physical quantity and (4.5, 2, 1.5) as the location, and press Set. If you push preview button'preview' icon, you can check the sampling position on the 3D view.

Sampling position preview
Sampling position preview

With the similar operation, set the temperature at the position (0.5, 2, 1.5) as the sampling target.

Sampling settings
Sampling 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 "RoomWithHeater.zip". The zip file download starts immediately.

Export Export

Running a calculation

Extract downloaded file "RoomWithHeater.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 Mesh of cross section
Mesh of cross section (zoom) Mesh of cross section (zoom)

Distributions of Flow velocity and temperature are following.

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

The sampled temperatures are output at T file in postProcessing/probe(T)/0 folder as following.

# Force coefficients
# Probe 0 (4.5 2 1.5)
# Probe 1 (0.5 2 1.5)
#       Probe             0             1
#        Time
            1           300           300
            2           300           300
            3       299.999           300
…………
          998       291.842       291.751
          999       291.803       291.738
         1000        291.77       291.724

The temperature at each sampling position in the final step 1000 is 291.77 K and 291.724 K. It indicates that there is almost no difference in temperature between the wall side and the window side.