Getting started with chtMultiRegionSimpleFoam - planeWall2D

From OpenFOAMWiki
Revision as of 15:12, 1 January 2015 by Wyldckat (Talk | contribs)

Valid versions: OF Version 21.png OF Version 22.png OF Version 23.png


1 Introduction

This page is meant to help the user get started with the chtMultiRegionSimpleFoam and chtMultiRegionFoam solvers. This page is no where near complete, so feel free to add examples based on this planeWall2D example case and write instructions and/or tips on how to use these solvers.

This page began as a result from the discussion help here: chtMultiRegionFoam--unequal temperature at coupled patches - there you might find some very more precious hints on what you can do with these solvers!

Keep in mind that:

chtMultiRegionSimpleFoam is a
Steady-state version of chtMultiRegionFoam
chtMultiRegionFoam is a
Combination of heatConductionFoam and buoyantFoam for conjugate heat transfer between a solid region and fluid region

1.1 Requirements before continuing

This tutorial assumes you're already trained and are already familiar with the following topics:

  1. How to use the shell: Installation/Working_with_the_Shell
  2. How to open and edit text files... any online tutorial can teach you about that.
  3. Have carefully studied the OpenFOAM User Guide.
  4. Have already studied some tutorials that are isothermal. If you have not yet studied any such tutorials, then please study them first. (edit note: references missing)
  5. You might also want to have a look at the tutorials chapter in the OpenFOAM Programmer's Guide. For more details, see this page: OpenFOAM guide/Programmer's Guide Errata

2 planeWall2D - Case description

This is basically the example shown in the book Fundamentals of Heat and Mass Transfer by Frank P. Incropera et. al, chapter 3, section 3.1 "The Plane Wall", which is somewhat reproduced in the following picture:

This shows the schematic for the plane wall.
This shows the equivalent thermal circuit for this plane wall.

Basically, it's an infinite solid and uniform wall with generic fluids flowing on both sides of the wall. It's one of the most basic 1D examples of heat transfer between two fluids and a solid.

The untrained reader is unlikely familiar with the several details that occur in this scenario:

  1. This schematic is for when the flow is at a stable flow rate; in order words, when the flow is exactly the same at 1km or 10km and that there is enough hot and cold fluid on each side to assume that the set-up is as good as infinite.
  2. The case initially provided for using with OpenFOAM is an initial set-up, which is at the very start of this infinite wall. This means that:
    1. If temperature was not taken into account, this would exactly be the same case for the Boundary Layer on a Flat Plate.
    2. In addition, to make the case set-up easier, this fluids are actually flowing inside a pipe and the represented walls in the case below are actually symmetry planes, i.e. the axis of each tube.
    3. In other words, the flow is not yet fully developed, therefore you'll see the effect of the initial boundary layer, mixed in with the heat transfer.
    4. For more details, research on your own for more details on this topic and/or read this Wikipedia article: Boundary layer
  3. The heat transferred through convection depends directly on the flow speed near the solid wall.
  4. If you want to properly diagnose if your cases run with OpenFOAM for this kind of simulation, you must first study the analytical expressions for each scenario you're planning on simulating, so that you can better understand the physics behind this. Otherwise you will feel that the simulations are always wrong.
    • We'll try to do this with the provided example, but further developments will have to be done by yourself.


2.1 Provided case for OpenFOAM

The case is attached for the following versions of OpenFOAM:

Note: this case will also work with OF Version 20.png, if you do the necessary tweaks in the fvSchemes files of the attached example case.

The case provides a ready to be used case for OpenFOAM and is defined as follows:

  • It's based on the tutorial heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater, but stripped down to only 3 regions, one solid and two fluids.
  • The mesh of this example case "planeWall2D" is based on the traditional OpenFOAM cavity case, but with 1m x 1m.
  • The 3 regions are defined as follows:
    • topAir - 0.6 to 1m - where the air is cold at 300K and flows from the left to the right at 0.1m/s. The top patch is a symmetry plane.
    • wall - 0.4 to 0.6m - where a solid wall is placed, initiated at 300K and has a high conduction factor.
    • bottomAir - 0 to 0.4m - where the air is hot at 500K and flows from the left to the right at 0.1m/s. The bottom patch is a symmetry plane.


2.2 Get and run the case

  1. Download the attached file for the version of OpenFOAM you're using (seen in the Case description) and unpack it by running:
    • OF Version 21.png:
      tar xzf planeWall2D.tar.gz
    • OF Version 22.png:
      tar xzf planeWall2D-2.2.tar.gz
    • OF Version 23.png:
      tar xzf planeWall2D-2.3.tar.gz
  2. Then go into the folder:
    cd planeWall2D
  3. And run it:
    ./Allrun
  4. For resetting the case, run:
    ./Allclean


2.3 Post-Processing

When the script Allrun finishes executing, you'll have the following 3 files:

planeWall2D{bottomAir}.OpenFOAM
planeWall2D{topAir}.OpenFOAM
planeWall2D{wall}.OpenFOAM

Start up ParaView from the command line and open those 3 files:

paraview

In the following two pictures is shown what you can do:

This shows how to configure the Plot Over Line filter. Notice that it is being applied to another intermediate filter named Group Datasets, which groups the 3 files into a single dataset.
This shows how to configure the lines to be plotted.


2.4 File description

The following list of files are the ones you should first study, before you even try to modify anything on this case:

  • 0/* - These files are pre-configured and don't need to be modified... at least in theory, because they provide a blank template of the field files that will be created. In other words, changing these files won't affect much.
  • Allclean - This script is the one that takes care of resetting everything. Reconfigure it if you add more regions.
  • Allrun - This script is the one that takes care of running the case. Reconfigure it if you add more regions and to suit your needs.
  • constant - In this folder is placed all properties that are preserved during execution.
    • polyMesh - In this folder is located the mesh for the case.
      • blockMeshDict - This is the dictionary file used by blockMesh to generate the base mesh. It's here that you can change the base resolution of the mesh or even extend the dimensions of the mesh.
    • regionProperties - This file defined which regions are solid and which are fluid.
    • bottomAir - In here are defined all properties of the fluid located in the bottom region.
    • topAir - In here are defined all properties of the fluid located in the top region.
    • wall - In here is a single file that defines the properties of the solid.
  • system - In here are the files that configure or help configure the case.
    • controlDict - Here you control the number of iterations and so on...
    • topoSetDict - Here you defined the extents of each region. It's here that you can select which cells of the mesh that belong in each region.
    • bottomAir - In here are the runtime configurations for the bottom region.
      • changeDictionaryDict - This is the main file where you define the actual boundary conditions to be used for the bottom region.
    • topAir - In here are the runtime configurations for the top region.
      • changeDictionaryDict - This is the main file where you define the actual boundary conditions to be used for the top region.
    • wall - In here are the runtime configurations for the wall region.
      • changeDictionaryDict - This is the main file where you define the actual boundary conditions to be used for the wall region.


2.5 Understanding the physics

There are at least 3 major topics that need to be seen and understood and which will be explained in the following subsections:

  1. The boundary layer that generates naturally near a no-slip wall: Boundary Layer
  2. How heat propagates along fluid, along solid and when solid interfaces with fluid: Analytical solution
  3. What happens when the two are combined: Interpreting the results


2.5.1 Boundary Layer

TODO


2.5.2 Analytical solution

TODO


2.5.3 Interpreting the results

TODO


3 Suggested Exercises

  • Reduce the resolution of the mesh from 100x100x1 to 20x20x1 and use refineMesh to increase resolution where it matters, namely near the wall! A good reference tutorial for this is multiphase/cavitatingFoam/les/throttle.
  • Change the properties of the solid and/or top and bottom fluids, so you can see what's going on.
  • Extend the wall or apply the cyclic boundary condition to the outlets and inlets (the ones named leftLet and rightLeft), turning this into an infinite wall.
  • Follow the directions given in the post #34 on the thread "conjugate heat transfer in OpenFOAM" at CFD-Online, to calculate the analytical solution, for comparison with the results achieved with the chtMultiRegion*Foam solvers.
    • Beyond that, you might want to try and implement a solver similar to potentialFoam, to do this calculation.
  • Any more exercises are up to you!


4 References

Maaike Van Der Tempel: A chtMultiRegionSimpleFoam tutorial. Slides Report Code Case1 Case2