↑top

Tutorial : Heat convection by a heater

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 °C. And there is a heater of 76.85 °C 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.

Create Project Dialog 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 ratio 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 5000 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).

The calculation of natural convection tend to be instable, so we set relaxation factors for the velocity and pressure to a smaller value of 0.07 and 0.03, respectively, to ensure stable calculations.

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 1000 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 settings. 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 start 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

Running in 4 parallel (Inter(R) Core(TM) i7-8700 CPU @ 3.20GHz 3.19GHz), it takes 1 seconds to create a mesh and about 7 minutes to analyze.

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)
# Time        0             1      
0             300           300    
1             299.985       300.005
2             299.962       300.005
3             299.964       300.005
…………
4998          287.864       287.883
4999          287.864       287.883
5000          287.864       287.882

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.