Nabla Logo programmer
  Advanced Search
  
  Send us a comment/query
 
  Back to main web site
 
  OpenFOAM guides
  - User guide
  - Programmer’s guide
 
  Index
 
  Changes from OpenFOAM 2.2 to 2.3
 
  Trademarks in the guides
  ©2000-2007 Nabla Ltd.

3.5 Magnetohydrodynamic flow of a liquid

In this example we shall investigate an flow of an electrically-conducting liquid through a magnetic field. The problem is one belonging to the branch of fluid dynamics known as magnetohydrodynamics (MHD) that uses mhdFoam.

3.5.1 Problem specification

The problem is known as the Hartmann problem, chosen as it contains an analytical solution with which mhdFoam can be validated. It is defined as follows:

Solution domain
The domain is 2 dimensional and consists of flow along two parallel plates as shown in Fig.  3.12.
                          20

 y

   x                        By = 20 T                   2



Inlet: Ux = 1 m/s                    Outlet: p = 0 bar
\special {t4ht=

Figure 3.12: Geometry of the Hartmann problem


Governing equations
 
  • Mass continuity for incompressible fluid
     \~/  •U = 0
           \special {t4ht=
    (3.20)

  • Momentum equation for incompressible fluid
    @U                                                       •
----+   \~/  • (UU) +  \~/  • (2BGBUB)  +  \~/  • (nU) +  \~/  (GBUB •B)  = -  \~/ p
 @t
           \special {t4ht=
    (3.21)

    where B  \special {t4ht= is the magnetic flux density,             -1
GBU =  (2mr)   \special {t4ht=.

  • Maxwell’s equations
                @B
 \~/  × E =  - ----
            @t
           \special {t4ht=
    (3.22)

    where E  \special {t4ht= is the electric field strength.

     \~/  •B = 0
           \special {t4ht=
    (3.23)

                  @D
 \~/  × H = J +  @t--= J
           \special {t4ht=
    (3.24)

    assuming @D/@t   «  J  \special {t4ht=. Here, H  \special {t4ht= is the magnetic field strength, J  \special {t4ht= is the current density and D  \special {t4ht= is the electric flux density.

  • Charge continuity
      •
 \~/   J = 0
           \special {t4ht=
    (3.25)

  • Constitutive law
    B  = mH
           \special {t4ht=
    (3.26)

  • Ohm’s law
    J = s (E + U  × B)
           \special {t4ht=
    (3.27)

  • Combining Equation 3.22, Equation 3.24, Equation 3.27, and taking the curl
    @B--+  \~/  • (UB) -  \~/  • (fBU) -  \~/  • (GBB) = 0
@t
           \special {t4ht=
    (3.28)

Boundary conditions
 
  • inlet is specified the inlet condition with fixed velocity U =  (1,0,0)  \special {t4ht= m/s;
  • outlet is specified as the outlet with with fixed pressure p = 0 Pa  \special {t4ht=;
  • upperWall is specified as a wall where B =  (0, 20,0) T  \special {t4ht=.
  • lowerWall is specified as a wall where B =  (0, 20,0) T  \special {t4ht=.
  • front and back boundaries are specified as empty.
Initial conditions
U  = 0 m/s  \special {t4ht=, p = 100 Pa  \special {t4ht=, B =  (0, 20,0) T  \special {t4ht=.
Transport properties
 
  • Kinematic viscosity n = 1 Pa s  \special {t4ht=
  • Density r = 1 kg m/s  \special {t4ht=
  • Electrical conductivity            - 1
s = 1 (_O_ m)   \special {t4ht=
  • Permeability m = 1 H/m  \special {t4ht=
Solver name
mhdFoam: an incompressible laminar magneto-hydrodynamics code.
Case name
hartmann case located in the $OpenFOAM_TUTORIALS/mhdFoam directory.

3.5.2 Mesh generation

The geometry is simply modelled with 100 cells in the x  \special {t4ht=-direction and 40 cells in the y  \special {t4ht=-direction; the set of vertices and blocks are given in the mesh description file below:


1  // The OpenFOAM Project // File: blockMeshDict
2  /*
3  -------------------------------------------------------------------------------
4   =========         | dictionary
5   \\      /         |
6    \\    /          | Name:   blockMeshDict
7     \\  /           | Family: FoamX configuration file
8      \\/            |
9      F ield         | OpenFOAM version: 2.3
10      O peration     | Product of Nabla Ltd.
11      A and          |
12      M anipulation  | Email: Enquiries@Nabla.co.uk
13  -------------------------------------------------------------------------------
14  */
15  // FoamX Case Dictionary.
16  
17  FoamFile
18  {
19      version         2.0;
20      format          ascii;
21  
22      root            "";
23      case            "";
24      instance        "";
25      local           "";
26  
27      class           dictionary;
28      object          blockMeshDict;
29  }
30  
31  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32  
33  convertToMeters 1;
34  
35  vertices
36  (
37      (0 -1 0)
38      (20 -1 0)
39      (20 1 0)
40      (0 1 0)
41      (0 -1 0.1)
42      (20 -1 0.1)
43      (20 1 0.1)
44      (0 1 0.1)
45  );
46  
47  blocks
48  (
49      hex (0 1 2 3 4 5 6 7) (100 40 1) simpleGrading (1 1 1)
50  );
51  
52  edges
53  (
54  );
55  
56  patches
57  (
58      patch inlet
59      (
60          (0 4 7 3)
61      )
62      patch outlet
63      (
64          (2 6 5 1)
65      )
66      patch lowerWall
67      (
68          (1 5 4 0)
69      )
70      patch upperWall
71      (
72          (3 7 6 2)
73      )
74      empty frontAndBack
75      (
76          (0 3 2 1)
77          (4 5 6 7)
78      )
79  );
80  
81  mergePatchPairs
82  (
83  );
84  
85  // ************************************************************************* //

3.5.3 Running the case

The user can run the case and view results in dxFoam. It is also useful at this stage to run the Ucomponents utility to convert the U  \special {t4ht= vector field into individual scalar components. MHD flow is governed by, amongst other things, the Hartmann number which is a measure of the ratio of electromagnetic body force to viscous force

       V~  ---
M  = BL    -s-
           rn
\special {t4ht=
(3.29)

where L  \special {t4ht= is the characteristic length scale. In this case with By  = 20 T  \special {t4ht=, M  =  20  \special {t4ht= and the electromagnetic body forces dominate the viscous forces. Consequently with the flow fairly steady at t = 2 s  \special {t4ht= the velocity profile is almost planar, viewed at a cross section midway along the domain x =  10 m  \special {t4ht=. The user can plot a graph of the profile of Ux  \special {t4ht= in dxFoam.


 y (m)

+1.0


                                      By =  1 T



  0.0                   By =  20 T








 -1.00.0           0.5           1.0           1.5

                                        Ux (m/s)
\special {t4ht=


Figure 3.13: Velocity profile in the Hartmann problem for By  = 1 T  \special {t4ht= and By  = 20 T  \special {t4ht=.


Now the user should reduce the magnetic flux density B  \special {t4ht= to 1 T  \special {t4ht=and re-run the code and Ucomponents. In this case, M  = 1  \special {t4ht= and the electromagnetic body forces no longer dominate. The velocity profile consequently takes on the parabolic form, characteristic of Poiseuille flow as shown in Figure 3.13. To validate the code the analytical solution for the velocity profile Ux  \special {t4ht= is superimposed in Figure 3.13, given by:
Ux(y)    cosh M  - cosh M (y/L)
------ = -----------------------
Ux(0)          cosh M  - 1
\special {t4ht=
(3.30)

where the characteristic length L  \special {t4ht= is half the width of the domain, i.e. 1 m  \special {t4ht=.