0% found this document useful (0 votes)
175 views45 pages

Fluent 6.1 Magnetohydrodynamics (MHD) Module Manual: February 2003

Uploaded by

abdullaalakour
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
175 views45 pages

Fluent 6.1 Magnetohydrodynamics (MHD) Module Manual: February 2003

Uploaded by

abdullaalakour
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

FLUENT 6.

1
Magnetohydrodynamics (MHD)
Module Manual

February 2003
Licensee acknowledges that use of Fluent Inc.’s products can only provide an imprecise
estimation of possible future performance and that additional testing and analysis, inde-
pendent of the Licensor’s products, must be conducted before any product can be finally
developed or commercially introduced. As a result, Licensee agrees that it will not rely
upon the results of any usage of Fluent Inc.’s products in determining the final design,
composition or structure of any product.

Copyright c 2003 by Fluent Inc.


All rights reserved. No part of this document may be reproduced or otherwise used in
any form without express written permission from Fluent Inc.

Airpak, FIDAP, FLUENT, GAMBIT, Icepak, MixSim, and POLYFLOW are registered
trademarks of Fluent Inc. All other products or name brands are trademarks of their
respective holders.

Fluent Inc.
Centerra Resource Park
10 Cavendish Court
Lebanon, NH 03766
Contents

1 Introduction 1-1

2 Technical Background 2-1


2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1
2.2 Magnetic Induction Method . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
2.2.1 Case 1: B~0 generated in non-conducting media. . . . . . . . . . . 2-3
2.2.2 Case 2: B~0 generated in conducting media. . . . . . . . . . . . . 2-3
2.3 Electric Potential Method . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4

3 Implementation 3-1
3.1 Solving Induction Equations . . . . . . . . . . . . . . . . . . . . . . . . . 3-1
3.2 Solving Electric Potential Equation . . . . . . . . . . . . . . . . . . . . . 3-2
3.3 Calculation of MHD Variables . . . . . . . . . . . . . . . . . . . . . . . . 3-2
3.4 MHD Interaction with Fluid Flows . . . . . . . . . . . . . . . . . . . . . 3-2
3.5 MHD Interaction with Discrete Phase Model . . . . . . . . . . . . . . . 3-2
3.6 General UDFs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3

4 Using the FLUENT MHD Model 4-1


4.1 MHD Module Installation . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1
4.1.1 Installing the MHD Model on Unix/Linux Platforms . . . . . . . 4-1
4.1.2 Installing the MHD Model on NT/Windows Platforms . . . . . . 4-2
4.2 Getting Started With the MHD Model . . . . . . . . . . . . . . . . . . . 4-2
4.3 MHD Modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3
4.3.1 External Applied Field . . . . . . . . . . . . . . . . . . . . . . . 4-3
4.3.2 User-Defined Scalar Allocation . . . . . . . . . . . . . . . . . . . 4-3
4.3.3 Solving User-Defined Scalars . . . . . . . . . . . . . . . . . . . . 4-7


c Fluent Inc. January 24, 2003 i
CONTENTS

4.3.4 Allocating User-Defined Memory . . . . . . . . . . . . . . . . . . 4-8


4.3.5 Source Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-8
4.3.6 Boundary Conditions . . . . . . . . . . . . . . . . . . . . . . . . 4-8
4.3.7 MHD/DPM Interaction . . . . . . . . . . . . . . . . . . . . . . . 4-11
4.3.8 General UDF Set-up . . . . . . . . . . . . . . . . . . . . . . . . . 4-14
4.4 Solving and Post-processing . . . . . . . . . . . . . . . . . . . . . . . . . 4-14
4.4.1 MHD Model Initialization . . . . . . . . . . . . . . . . . . . . . . 4-14
4.4.2 Iteration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-15
4.4.3 Post-processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-15
4.5 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-18

A Guidelines For Using the FLUENT MHD Model A-1


A.1 Installing the MHD Module . . . . . . . . . . . . . . . . . . . . . . . . . A-1
A.2 An Overview of Using the MHD Module . . . . . . . . . . . . . . . . . . A-2

B Definitions of the Magnetic Field B-1


B.1 Magnetic Field Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . B-1

C External Magnetic Field Data Format C-1


C.1 Magnetic Field Data Format . . . . . . . . . . . . . . . . . . . . . . . . C-1

ii
c Fluent Inc. January 24, 2003
Chapter 1. Introduction

Magnetohydrodynamics (MHD) refers to the interaction between an applied electromag-


netic field and a flowing, electrically-conductive fluid. The FLUENT MHD model allows
you to analyze the behavior of electrically conducting fluid flow under the influence of
constant (DC) or oscillating (AC) electromagnetic fields. The externally-imposed mag-
netic field may be generated either by selecting simple built-in functions or by importing
a user-supplied data file. For multiphase flows, the MHD model is compatible with both
the discrete phase model (DPM) and the volume-of-fluid (VOF) approach in FLUENT,
including the effects of a discrete phase on the electrical conductivity of the mixture.
This document describes the FLUENT MHD model. Chapter 2 provides theoretical back-
ground information. Chapter 3 summarizes the UDF-based software implementation.
Instructions for getting started with the model are provided in Chapter 4. Appendix A
provides an condensed overview on how to use the MHD model, while Appendix B con-
tains defintions for the magnetic field, and Appendix C describes the external magnetic
field data format.


c Fluent Inc. January 24, 2003 1-1
Introduction

1-2
c Fluent Inc. January 24, 2003
Chapter 2. Technical Background

2.1 Introduction
The coupling between the fluid flow field and the magnetic field can be understood on the
basis of two fundamental effects: the induction of electric current due to the movement
of conducting material in a magnetic field, and the effect of Lorentz force as the result of
electric current and magnetic field interaction. In general, the induced electric current and
the Lorentz force tend to oppose the mechanisms that create them. Movements that lead
to electromagnetic induction are therefore systematically braked by the resulting Lorentz
force. Electric induction can also occur in the presence of a time-varying magnetic field.
The effect is the stirring of fluid movement by the Lorentz force.
Electromagnetic fields are described by Maxwell’s equations:

~ =0
∇·B (2.1-1)

~
~ = − ∂B
∇×E (2.1-2)
∂t

~ =q
∇·D (2.1-3)

~
∂D
~ = ~ +
∇×H (2.1-4)
∂t

where B ~ (Tesla) and E ~ (V/m) are the magnetic and electric fields, respectively, and H ~
and D~ are the induction fields for the magnetic and electric fields, respectively. q (C/m3 )
is the electric charge density, and ~ (A/m2 ) is the electric current density vector.
~ and D
The induction fields H ~ are defined as:

~ = 1B
H ~ (2.1-5)
µ

~ = εE
D ~ (2.1-6)


c Fluent Inc. January 24, 2003 2-1
Technical Background

where µ and ε are the magnetic permeability and the electric permittivity, respectively.
For sufficiently conducting media such as liquid metals, the electric charge density q and
~
the displacement current ∂∂tD are customarily neglected [1].
In studying the interaction between flow field and electromagnetic field, it is critical to
know the current density ~ due to induction. Generally, two approaches may be used
to evaluate the current density. One is through the solution of a magnetic induction
equation; the other is through solving an electric potential equation.

2.2 Magnetic Induction Method


In the first approach, the magnetic induction equation is derived from Ohm’s law and
Maxwell’s equation. The equation provides the coupling between the flow field and the
magnetic field.
In general, Ohm’s law that defines the current density is given by:

~
~ = σ E (2.2-1)

~ in a magnetic
where σ is the electrical conductivity of the media. For fluid velocity field U
~
field B, Ohm’s law takes the form:

~ +U
~ = σ(E ~ × B)
~ (2.2-2)

From Ohm’s law and Maxwell’s equation, the induction equation can be derived as:

~
∂B
+ (U ~ = 1 ∇2 B
~ · ∇)B ~ + (B
~ · ∇)U
~ (2.2-3)
∂t µσ

~ the current density ~ can be calculated using Ampere’s


From the solved magnetic field B,
relation as:

1 ~
~ = ∇×B (2.2-4)
µ

~ in a MHD problem can be decomposed into the externally


Generally, the magnetic field B
imposed field B~0 and the induced field ~b due to fluid motion. Only the induced field ~b
needs to be solved.
From Maxwell’s equations, the imposed field B~0 satisfies the following equation:

∂ B~0
∇2 B~0 − µσ 0 =0 (2.2-5)
∂t

2-2
c Fluent Inc. January 24, 2003
2.2 Magnetic Induction Method

where σ 0 is the electrical conductivity of the media in which field B~0 is generated. Two
cases need to be considered.

2.2.1 ~0 generated in non-conducting media.


Case 1: B
In this case the imposed field B~0 satisfies the following conditions:

∇ × B~0 = 0 (2.2-6)

∇2 B~0 = 0 (2.2-7)

~ = B~0 + ~b, the induction equation (Equation 2.2-3) can be written as:
With B

∂~b ~ · ∇)~b = 1 ∇2~b + ((B~0 + ~b) · ∇)U


~
~ · ∇)B~0 − ∂ B0
~ − (U
+ (U (2.2-8)
∂t µσ ∂t

The current density is given by:

1
~ = ∇ × ~b (2.2-9)
µ

2.2.2 ~0 generated in conducting media.


Case 2: B
In this case the conditions given in Equations 2.2-6 and 2.2-7 are not true. Assuming
that the electrical conductivity of the media in which field B~0 is generated is the same
as that of the flow, i.e. σ 0 = σ, from Equations 2.2-3 and 2.2-5 the induction equation
can be written as:

∂~b ~ · ∇)~b = 1 ∇2~b + ((B~0 + ~b) · ∇)U


~ − (U
~ · ∇)B~0
+ (U (2.2-10)
∂t µσ

and the current density is given by:

1
~ = ∇ × (B~0 + ~b) (2.2-11)
µ

For the induction equation Equations 2.2-8 or 2.2-10, the boundary conditions for the
induced field are given by:

~b = {bn bt1 bt2 }T = b~∗ (2.2-12)


c Fluent Inc. January 24, 2003 2-3
Technical Background

where the subscripts denote the normal and tangential components of the field and b~∗ is
specified by the user. For an electrically insulating boundary, as jn = 0 at the boundary,
from Ampere’s relation one has bt1 = bt2 = 0 at the boundary.

2.3 Electric Potential Method


The second approach for the current density is to solve the electric potential equation
~ can
and calculate the current density using Ohm’s law. In general, the electric field E
be expressed as:

~
~ = −∇ϕ − ∂ A
E (2.3-1)
∂t

where ϕ and A ~ are the scalar potential and the vector potential, respectively. For a static
field and assuming ~b << B~0 , Ohm’s law given in Equation 2.2-2 can be written as:

~ × B~0 ))
~ = σ(−∇ϕ + (U (2.3-2)

For sufficiently conducting media, the principle of conservation of electric charge gives:

∇ · ~ = 0 (2.3-3)

The electric potential equation is thus given by:

~ × B~0 )
∇2 ϕ = ∇ · (U (2.3-4)

The boundary condition for the electric potential ϕ is given by:

∂ϕ ~ × B~0 )boundary · ~n
= (U (2.3-5)
∂n
for an insulating boundary, where ~n is the unit vector normal to the boundary, and

ϕ = ϕ0 (2.3-6)

for a conducting boundary, where ϕ0 is the specified potential at the boundary. The
current density can then be calculated from Equation 2.3-2.

2-4
c Fluent Inc. January 24, 2003
2.3 Electric Potential Method

With the knowledge of the induced electric current, the MHD coupling is achieved by
introducing additional source terms to the fluid momentum equation and energy equation.
For the fluid momentum equation, the additional source term is the Lorentz force given
by:

F~ = ~ × B
~ (2.3-7)

which has units of N/m3 in the SI system. For the energy equation, the additional source
term is the Joule heating rate given by:

1
Q= ~ · ~ (2.3-8)
σ

which has units of W/m3 .


For charged particles in an electromagnetic field, the Lorentz force acting on the particle
is given by:

F~p = q(E
~ + ~νp × B)
~ (2.3-9)

where q is the particle charge density (Coulomb/m3 ) and νp is the particle velocity. The
force F~p has units of N/m3 .
For multiphase flows, assuming that the electric surface current at the interface between
phases can be ignored, the electric conductivity for the mixture is given by:

X
σm = σi νi (2.3-10)
i

where σi and νi are respectively the electric conductivity and volume fraction of phase i.
σm is used in solving the induction equations.


c Fluent Inc. January 24, 2003 2-5
Technical Background

2-6
c Fluent Inc. January 24, 2003
Chapter 3. Implementation

Implementation of the MHD model is achieved through the user-defined function (UDF)
facility of FLUENT. The UDF module is linked to the FLUENT code as a run-time library.
The model is accessed through a number of UDF schemes. The magnetic induction
equation given by Equations 2.2-8 or 2.2-10 and the electric potential equation given by
Equation 2.3-4 are solved through user-defined scalar (UDS) transport equations. Other
model-related variables such as the external magnetic field data, current density, Lorentz
force and Joule heat are stored through user-defined memory locations. The MHD-related
parameters are input through a combination of new, modified, and standard FLUENT
graphical user interface (GUI) panels, as described in Chapter 4.

3.1 Solving Induction Equations


The magnetic induction equation is solved as a set of user-defined scalar transport equa-
tions. The magnetic field vector is represented by its Cartesian components, each solved
as a user-defined scalar.
The convection and the diffusion terms of the scalar equations are defined through
user functions DEFINE UDS FLUX(mhd flux, ..., ns) and DEFINE DIFFUSIVITY (mhd
magnetic diffusitivity, ..., ns) respectively. The user-defined scalar equation is
identified by the scalar index ns.
The source terms to the induction equations are implemented through user function
DEFINE SOURCE(mhd magnetic source, ..., eqn), where eqn identifies the scalar equa-
tions.
For unsteady cases, the additional unsteady source term is introduced through user func-
tion DEFINE UDS UNSTEADY(mhd magnetic tsource, ..., ns), where ns identifies the
scalar being solved.
The wall boundary conditions are implemented through user profile functions (DEFINE
PROFILE()). Two types of boundary condition, i.e. insulating and conducting, exist and
each can be applied to the Cartesian components of the induced magnetic field vector.


c Fluent Inc. January 24, 2003 3-1
Implementation

3.2 Solving Electric Potential Equation


The electric potential is also solved through a user-defined scalar equation. The con-
vection and the diffusion terms for the equation are introduced through user functions
DEFINE UDS FLUX(mhd flux, ..., ns) and DEFINE DIFFUSIVITY (mhd magnetic
diffusitivity, ..., ns), respectively. The equation is identified by the scalar in-
dex ns.
The source term for the equation is implemented through user function DEFINE SOURCE
(mhd phi source, ..., eqn). A user profile function DEFINE PROFILE(mhd phi bc ins,
...) is used for defining the insulating wall boundary condition for the equation.

3.3 Calculation of MHD Variables


Apart from the Cartesian components of the magnetic field vectors and the electric
potential function, which are stored as user-defined scalars, other MHD-related vari-
ables include the induced electric current density vector, induced electric field vector,
the Lorentz force vector and Joule heat. These variables are stored in user-defined
memory locations. Updating of MHD variables is accessed through the user function
DEFINE ADJUST(mhd adjust, ...). The variables are updated at the start of each iter-
ation using the solved induced magnetic field from the previous iteration.

3.4 MHD Interaction with Fluid Flows


Additional source terms due to the magnetic induction are added to the flow momen-
tum and energy equations as user defined source terms. For the momentum equation,
user function DEFINE SOURCE(mhd momentum source, ..., eqn) is used to introduce
the Lorentz force to the equation, where eqn identifies the Cartesian component of the
fluid momentum. For the energy equation, the additional source due to Joule heating
is added through user function DEFINE SOURCE(mhd energy source, ..., eqn), where
eqn is the energy equation index.

3.5 MHD Interaction with Discrete Phase Model


In discrete phase modelling, the Lorentz force acting on charged particles is introduced
through the user function DEFINE DPM BODY FORCE(mhd dpm force, ...). User function
DEFINE DPM SOURCE(mhd dpm source, ...) is used to update the volume fraction of
the discrete phase inside a fluid cell and the volume-weighted electric conductivity of the
discrete phase.

3-2
c Fluent Inc. January 24, 2003
3.6 General UDFs

3.6 General UDFs


Several general UDFs are used as part of the MHD model implementation.

• DEFINE INIT(mhd init, ...) is an initialization function called during the gen-
eral case initialization to set up the external magnetic field and initialize MHD
model parameters and variables.

• DEFINE ADJUST(mhd adjust, ...) is called at the start of each iteration. It is used
to adjust the magnetic boundary conditions and update MHD related variables and
properties.

• DEFINE ON DEMAND(mhd initialise, ...) is used to initialise the MHD model


on a solved or partially solved case. DEFINE ON DEMAND(mhd update B0, ...) is
used to re-initialise the external magnetic field. DEFINE ON DEMAND(mhd init dpm,
...) is used to initialise MHD variables that are used in FLUENT’s discrete phase
model.


c Fluent Inc. January 24, 2003 3-3
Implementation

3-4
c Fluent Inc. January 24, 2003
Chapter 4. Using the FLUENT MHD Model

This chapter provides basic instructions to install the magnetohydrodynamics (MHD)


module and solve MHD problems in FLUENT. It assumes that you are already familiar
with standard FLUENT features, including the user-defined function procedures described
in the FLUENT UDF Manual. Appendix A also outlines the general procedure for using
the MHD model.

4.1 MHD Module Installation


The MHD model consists of a number of user-defined functions (UDFs) and scheme
routines which need to be loaded and activated before calculations can be performed.
These files are provided with your standard installation of FLUENT. They can be found
in your installation area in a directory called addons/mhd1.0. In order to load these files,
you will need to either provide the complete path to your installation area when loading,
or create a local copy of the files (or a link for UNIX platforms).

4.1.1 Installing the MHD Model on Unix/Linux Platforms


To install the MHD model on Unix and Linux platforms, it is recommended that you
create links in your local working directory to the files you will need. This can be done
with the commands:

ln -s <path>/addons/mhd1.0/lib/mhd-parameter.scm mhd-parameter.scm
ln -s <path>/addons/mhd1.0 libudf

where <path> represents the location in the file system where FLUENT is installed.


c Fluent Inc. January 24, 2003 4-1
Using the FLUENT MHD Model

4.1.2 Installing the MHD Model on NT/Windows Platforms


To install the MHD model on Windows platforms, you will need to create copies of the
MHD model folder and the files you will need in your local working folder. From your
installation area, you will have to copy the folder

<path>\addons\mhd1.0

locally and rename it to libudf. Inside this folder are three different ports of the MHD
module, one for each type of parallel message passing supported (net, smpi and vmpi).
You will need to select one of the folders; ntx86 net, ntx86 smpi, or ntx86 vmpi you
wish to use and rename it as ntx86. If you are only running in serial mode, you can
rename any of the folders.
Also you will need to copy the file

<path>\addons\mhd1.0\lib\mhd-parameter.scm

locally. Note that <path> represents the location in the file system where FLUENT is
installed.

4.2 Getting Started With the MHD Model


The graphical user interface for the MHD module is designed in the form of a Scheme
program. You load this program into FLUENT by using the
File−→Read−→Scheme...
menu and selecting the file mhd-parameter.scm from the Select File panel. MHD pa-
rameters you subsequently input are stored in the FLUENT case file. When restarting
a MHD calculation, it is important that the Scheme program for the user interface is
loaded before the case/data files are read into FLUENT.
The MHD model library should be pre-compiled using the standard procedure for com-
piling FLUENT UDFs. You install this library into FLUENT using the
Define−→User-Defined−→Functions−→Compiled...
menu. Enter libudf in the Compiled UDFs panel to open the library. The name of the
UDF library will be saved with the FLUENT case file. The library is opened automatically
when the case file is subsequently read into FLUENT.

4-2
c Fluent Inc. January 24, 2003
4.3 MHD Modeling

4.3 MHD Modeling


4.3.1 External Applied Field
Following installation, you can access the MHD Model Setup panel using the
Define−→User-Defined−→MHD Model...
menu. This panel is designed for setting up the external magnetic field conditions.
Two options are available for setting up the external magnetic field. One is to patch
the computational domain with a constant or varying magnetic field in the form of
sinusoidal or square wave. Figure 4.3.1 shows the set-up panel for patching the external
magnetic field. Definitions for the sinusoidal and square forms of patched magnetic field
are provided in Appendix B.
The second option for setting the external magnetic field is to read it from a magnetic
data file that you provide. Figure 4.3.2 shows the sub-panel that appears if you select
Import for the B0 Input Option in Figure 4.3.1. The magnetic data can be generated using
a third-party program such as MAGNA. The required format of the magnetic field data
file is given in Appendix C.
When using the Import option, set the B0 Data Media flag in Figure 4.3.2 to Non-
Conducting or Conducting, depending on the assumptions used in generating this data.
(These choices correspond to “Case 1” and “Case 2”, respectively, as discussed in Sec-
tion 2.2.)

4.3.2 User-Defined Scalar Allocation


You need to specify the number of user-defined scalars using the
Define−→User-Defined Scalars...
menu. The number of user-defined scalars is five for a 2-D case and seven for a 3-D case.
Table 4.3.1 lists the names of the scalars and the variables they represent in the MHD
model. In the User-Defined Scalars panel (Figure 4.3.3), set the Number of User-Defined
Scalars to 5 or 7 depending on whether the case is 2-D or 3-D.
For the user-defined scalar transport equation, a user flux function and, for unsteady
cases, a user unsteady function should also be set. In the User-Defined Scalars panel,
select mhd flux as Flux Function and mhd magnetic tsource as Unsteady Function.
To set the diffusion term for the user-defined scalar equations, you use the
Define−→Materials...
menu. In the Materials panel, select the user-defined option for UDS Diffusivity and se-
lect mhd magnetic diffusivity from the User-Defined Functions list. Figure 4.3.4 shows the
Materials panel.


c Fluent Inc. January 24, 2003 4-3
Using the FLUENT MHD Model

Figure 4.3.1: The MHD Model Setup Panel for Patching an External Magnetic Field

Table 4.3.1: Identification of User-Defined Scalars

Scalar Description
2-D Scalar-0 X component of induced magnetic field (bx )
Scalar-1 Y component of induced magnetic field (by )
Scalar-2 X component of imposed magnetic field (B0x )
Scalar-3 Y component of imposed magnetic field (B0y )
Scalar-4 Electric potential (ϕ)
3-D Scalar-0 X component of induced magnetic field (bx )
Scalar-1 Y component of induced magnetic field (by )
Scalar-2 Z component of induced magnetic field (bz )
Scalar-3 X component of imposed magnetic field (B0x )
Scalar-4 Y component of imposed magnetic field (B0y )
Scalar-5 Z component of imposed magnetic field (B0z )
Scalar-6 Electric potential (ϕ)

4-4
c Fluent Inc. January 24, 2003
4.3 MHD Modeling

Figure 4.3.2: The MHD Model Setup Panel for Importing an External Magnetic Field

Figure 4.3.3: The User-Defined Scalars Panel


c Fluent Inc. January 24, 2003 4-5
Using the FLUENT MHD Model

Figure 4.3.4: Setting Up UDS Diffusivity in the Materials Panel

4-6
c Fluent Inc. January 24, 2003
4.3 MHD Modeling

4.3.3 Solving User-Defined Scalars


Not all the scalars you define in the User-Defined Scalars panel need to be solved in a MHD
calculation. The selection of which user scalars to solve will depend on the approach used
in solving a MHD problem and the type of problem.
As mentioned in Chapter 2, a MHD problem may be approached by solving the magnetic
induction equation or the electric potential equation. For steady cases where the induced
magnetic field (~b) is much smaller than the imposed field (B ~ 0 ), the electric potential
approach can be used. In this case only the electric potential scalar needs to be solved.
In the magnetic induction approach, the scalars representing the induced magnetic field
(~b) must be solved. Scalars representing the imposed magnetic field (B
~ 0 ) are not solved.

The user-defined scalars that do not need to be solved can be de-selected from the
Equations list in the Solution Controls panel, shown in Figure 4.3.5, accessed from the
Solve−→Controls−→Solution...
menu.

Figure 4.3.5: The Solution Controls Panel


c Fluent Inc. January 24, 2003 4-7
Using the FLUENT MHD Model

4.3.4 Allocating User-Defined Memory


The number of user-defined memory locations used by the MHD module is 27. You must
allocate this memory using the
Define−→User-Defined−→Memory...
menu. In the User-Defined Memory panel set the Number of User-Defined Memory Locations
to 27 or more, as shown in Figure 4.3.6. Table 4.3.2 gives the names of the user memory
locations and the variables they represent in the MHD model.

Figure 4.3.6: The User-Defined Memory Panel

4.3.5 Source Terms


MHD source terms should be defined for the momentum equation, energy equation,
magnetic induction equations, and electric potential equation. You set these terms using
the
Define−→Boundary Conditions...
menu. Select a fluid zone in the Boundary Conditions panel and set appropriate user-
defined functions in the Fluid panel (Figure 4.3.7). Repeat this process for each fluid
zone in the model that represents an electrically conductive fluid. UDFs for all MHD
source terms are listed in Table 4.3.3.

4.3.6 Boundary Conditions


You set electromagnetic boundary conditions with user-defined functions at the relevant
boundaries using the
Define−→Boundary Conditions...
menu. Figure 4.3.8 shows the panel for a Wall boundary condition set-up. For all scalars
except the electric potential, set the User Defined Scalar Boundary Condition to Specified
Value and set the corresponding User Defined Scalar Boundary Value to the appropriate
user function listed in Table 4.3.4, according to the type of boundary condition required.
For the electric potential equation, a user-defined function is required only for electrically
insulating boundaries. In this case, the User Defined Scalar Boundary Condition for the

4-8
c Fluent Inc. January 24, 2003
4.3 MHD Modeling

Table 4.3.2: Identification of User-Defined Memory Locations

User Memory Description


UDM-0 Magnitude of the induced magnetic field ( |~b| )
UDM-1 Magnitude of the imposed magnetic field ( |B ~ 0| )
UDM-2 X component of the induced electric
current density (jx )
UDM-3 Y component of the induced electric
current density (jy )
UDM-4 Z component of the induced electric
current density (jz )
UDM-5 Magnitude of the induced electric
current density (|~j|)
UDM-6 X component of the induced electric field (Ex )
UDM-7 Y component of the induced electric field (Ey )
UDM-8 Z component of the induced electric field (Ez )
UDM-9 Magnitude of the induced electric field ( |E|~ )
UDM-10 X component of Lorentz force (Fx )
UDM-11 Y component of Lorentz force (Fy )
UDM-12 Z component of Lorentz force (Fz )
UDM-13 Magnitude of Lorentz force ( |F~ | )
UDM-14 Joule heating rate (Q)
UDM-15 x component of the real part of the external
AC magnetic field
UDM-16 y component of the real part of the external
AC magnetic field
UDM-17 z component of the real part of the external
AC magnetic field
UDM-18 x component of the imaginary part of the
external AC magnetic field
UDM-19 y component of the imaginary part of the
external AC magnetic field
UDM-20 z component of the imaginary part of the
external AC magnetic field
UDM-21 Electrical conductivity of the overall fluid mixture (σm )
UDM-22 Volume-weighted discrete phase electrical conductivity
UDM-23 Volume concentration of the discrete phase
UDM-24 x component of the external DC magnetic field
UDM-25 y component of the external DC magnetic field
UDM-26 z component of the external DC magnetic field


c Fluent Inc. January 24, 2003 4-9
Using the FLUENT MHD Model

Figure 4.3.7: The Fluid Panel Showing Source Term Selection

Table 4.3.3: MHD Source Term UDFs

Equation User-Defined Function


X Momentum mhd momentum source
Y Momentum mhd momentum source
Z Momentum mhd momentum source
Energy mhd energy source
User-defined scalar-0 mhd magnetic source
User-defined scalar-1 mhd magnetic source
User-defined scalar-2 mhd magnetic source (3-D) or
mhd B0 source (2-D)
User-defined scalar-3 mhd B0 source
User-defined scalar-4 mhd B0 source (3-D) or
mhd phi source (2-D)
User-defined scalar-5 mhd B0 source (3-D)
User-defined scalar-6 mhd phi source (3-D)

4-10
c Fluent Inc. January 24, 2003
4.3 MHD Modeling

electric potential scalar should be set to Specified Flux, and User Defined Scalar Boundary
Value set to user function mhd phi bc. For conducting boundaries, set the User Defined
Scalar Boundary Condition to Specified Value and set User Defined Scalar Boundary Value
to the desired numerical value of the potential function without referencing a UDF.

Figure 4.3.8: Setting Up the MHD Model in the Wall Panel

4.3.7 MHD/DPM Interaction


You can simulate MHD for a two-phase mixture using the discrete phase model (DPM)
described in the FLUENT User’s Guide. To include Lorentz force and/or Joule heating
effects on the discrete second phase, you access the Discrete Phase Model panel (Fig-
ure 4.3.9), through the
Defined−→Models−→Discrete Phase...
menu. In the User-Defined Functions box, select mhd dpm force as the UDF for Body
Force and mhd dpm source as the UDF for Source.


c Fluent Inc. January 24, 2003 4-11
Using the FLUENT MHD Model

Figure 4.3.9: Setting Up the MHD Model in the Discrete Phase Model Panel

4-12
c Fluent Inc. January 24, 2003
4.3 MHD Modeling

Table 4.3.4: MHD Boundary Condition UDFs

Scalar Insulating Wall Conducting Wall


2-D Scalar-0 mhd BX bc ins mhd BX bc con
Scalar-1 mhd BY bc ins mhd BY bc con
Scalar-2 mhd B0X bc mhd B0X bc
Scalar-3 mhd B0Y bc mhd B0Y bc
Scalar-4 mhd phi bc* (none - set value directly)
3-D Scalar-0 mhd BX bc ins mhd BX bc con
Scalar-1 mhd BY bc ins mhd BY bc con
Scalar-2 mhd BZ bc ins mhd BZ bc con
Scalar-3 mhd B0X bc mhd B0X bc
Scalar-4 mhd B0Y bc mhd B0Y bc
Scalar-5 mhd B0Z bc mhd B0Z bc
Scalar-6 mhd phi bc* (none - set value directly)

*(BC Type = Specified Flux)


c Fluent Inc. January 24, 2003 4-13
Using the FLUENT MHD Model

4.3.8 General UDF Set-up


To complete MHD problem set-up, you need to invoke two utility UDFs in the User-
Defined Function Hooks panel accessed from the
Define−→User-Defined Function Hooks...
menu. As shown in Figure 4.3.10, you should select mhd init and mhd adjust for Initial-
ization Function and Adjust Function, respectively.

Figure 4.3.10: Setting Up the UDFs in the User-Defined Function Hooks Panel

4.4 Solving and Post-processing


4.4.1 MHD Model Initialization
Initialization of the MHD model involves specifying the externally-imposed magnetic field
and all MHD-related user-defined scalars and memory locations. Two approaches may
be used for the model initialization.
In the first approach, the MHD model is initialized along with the overall FLUENT case.
The Hook Function mhd init is called during the initialization. This approach is used
when the MHD model is to be activated at the start of the flow field calculation.
In the second approach, the MHD model is initialized manually using the execute-on-
demand UDF capability. This approach is used when MHD effects are added to a fully
or partially solved flow field, or when the model parameters are changed during a MHD
calculation. You can access the execute-on-demand user function using the
Define−→User-Defined−→Execute On Demand...

4-14
c Fluent Inc. January 24, 2003
4.4 Solving and Post-processing

menu. In the Execute On Demand panel (Figure 4.4.1), select mhd initialise from the
function list and click Execute to run the function. If your problem involves MHD/DPM
interactions, you should also execute the function mhd init dpm to initialize the DPM-
related user memory locations.

Figure 4.4.1: The Execute On Demand Panel

To change external magnetic field parameters such as the scale factor during a MHD
calculation, you will need to update the imposed magnetic field. This can be performed
by running the execute-on-demand UDF named mhd update B0.

4.4.2 Iteration
It is often an effective strategy to begin your MHD calculations using a previously-
converged flow field solution. With this approach, the induction equations themselves
are generally easy to converge. The under-relaxation factors for these equations can be
set to 0.8 ∼ 0.9, although for very strong magnetic fields smaller values may be needed.
For the electric potential equation, the convergence is generally slow. However, the
under-relaxation value for this equation should not be set to 1. As additional source
terms are added to the momentum and energy equations, the under-relaxation factors
for these equations should generally be reduced to improve the rate of convergence. In
case of convergence difficulties, another helpful strategy is to use the B0 Scale Factor in
the MHD Model Setup panel (Figure 4.3.1) to gradually increase the MHD effect to its
actual magnitude through a series of restarts.

4.4.3 Post-processing
You can use the standard post-processing facilities of FLUENT to display the results of
a MHD calculation. Contours of MHD variables can be displayed using the
Display−→Contours...
menu. The MHD variables can be selected from the variable list. Vectors of MHD
variables, such as the magnetic field vector and current density vector, can be displayed
using the
Display−→Vectors...
menu as custom vectors. Custom vectors are defined through the Custom Vectors...
button in the Vectors panel. In the Custom Vectors panel, the components of the vector


c Fluent Inc. January 24, 2003 4-15
Using the FLUENT MHD Model

can be selected. The defined custom vector can be selected from the Vectors Of dropdown
list in the Vectors panel. The color scheme used to display the vector can be selected
from the Color By list. Figures 4.4.2 and 4.4.3 illustrate the settings for displaying the
induced magnetic field vector, colored by its magnitude.
For more information on the postprocessing variables available in the FLUENT MHD
model, Table 4.3.1 and 4.3.2 lists the names of the user-defined scalars and user-defined
memory locations and the variables they represent in the MHD model.

Figure 4.4.2: The Vectors Panel

4-16
c Fluent Inc. January 24, 2003
4.4 Solving and Post-processing

Figure 4.4.3: The Custom Vectors Panel


c Fluent Inc. January 24, 2003 4-17
Using the FLUENT MHD Model

4.5 Limitations
Many MHD applications involve the simultaneous use of other advanced FLUENT ca-
pabilities such as solidification, free surface modeling with the volume of fluid (VOF)
approach, DPM, Eulerian multiphase, etc. You should consult the latest FLUENT doc-
umentation for the limitations that apply to those features. In addition, you should be
aware of the following limitations of the MHD capability.

• Currently the MHD equations can be solved only in Fluid zones. Solving in Solid
zones is not possible.

• You must specify the MHD wall boundary conditions as either perfectly conducting
or non-conducting, which implies that the conductivity of the wall material is either
infinite or zero. It is not possible to model walls with a finite non-zero conductivity.

• As explained in Chapter 2, the MHD module assumes a sufficiently conductive fluid


so that the charge density and displacement current terms in Maxwell’s equations
can be neglected. For marginally conductive fluids, this assumption may not be
valid. Further information about this simplification is available in the bibliography.

• For the electromagnetic material properties including conductivity and permeabil-


ity, only constant isotropic models are available. Although multiphase volume
fractions affect the mixture conductivity, no dependence on temperature, species
concentration, or field strength can be modeled. Sufficiently strong magnetic fields
can cause the constant-permeability assumption to become invalid.

• You must specify the applied magnetic field directly. The alternative specification
of an imposed electrical current is not supported.

• In the case of alternating-current (AC) magnetic fields, the capability has been
designed for relatively low frequencies; explicit temporal resolution of each cycle
is required. Although not a fundamental limitation, the computational expense of
simulating high-frequency effects may become excessive due to small required time
step size. Time-averaging methods to incorporate high-frequency MHD effects have
not been implemented.

4-18
c Fluent Inc. January 24, 2003
Appendix A. Guidelines For Using the
FLUENT MHD Model

This appendix provides a basic outline to installing the magnetohydrodynamics (MHD)


module and solving MHD problems in FLUENT.
! While Chapter 4 covers much of the same material in greater detail, this appendix
presents a set of guidelines for solving typical MHD problems with FLUENT, with occa-
sional references to Chapter 4 where more information can be found.

A.1 Installing the MHD Module


Before using the MHD module, you first need to install the necessary files onto your
computer. These files are provided with your standard installation of FLUENT. They can
be found in your installation area in a directory called addons/mhd1.0. In order to load
these files, you will need to either provide the complete path to your installation area
when loading, or create a local copy of the files (or a link for UNIX platforms). For more
information on installing the MHD model on UNIX and Windows, see Section 4.1.
Once the MHD model is installed, beneath the mhd directory there are two subdirectories:
a lib directory, and a directory corresponding to your specific architecture, ntx86 for
example. The lib directory holds a Scheme file called mhd-parameter.scm that contains
the MHD module graphical interface. The specific architecture directory, ntx86 for
example, contains the following subdirectories that hold various FLUENT files:

2d 2ddp 3d 3ddp
2d_host 2ddp_host 3d_host 3ddp_host
2d_node 2ddp_node 3d_node 3ddp_node


c Fluent Inc. January 24, 2003 A-1
Guidelines For Using the FLUENT MHD Model

A.2 An Overview of Using the MHD Module


To use the MHD module in a FLUENT simulation, follow the general guidelines:

1. Start FLUENT.
To begin modeling your MHD simulation, you need to start an appropriate FLUENT
session. Choose from either the 2d, 3d, 2ddp, 3ddp, or the parallel version of
FLUENT.

2. Read in the Scheme graphical interface.


The graphical user interface for the MHD module is designed in the form of a
Scheme program. You load this program into FLUENT by using the following
menu selection:
File−→Read−→Scheme...
and selecting the file mhd-parameter.scm from the Select File panel. MHD param-
eters you subsequently input are stored in the FLUENT case file.
! When restarting a MHD calculation, it is important that the Scheme program
for the user interface is loaded before the mesh, case, or data files are read into
FLUENT.
Following installation, you can access the MHD Model Setup panel using the
Define−→User-Defined−→MHD Model...
menu. This panel is designed for setting up the external magnetic field conditions.
For more information, see Section 4.3.

3. Read in a mesh file or a non-MHD case file.


You can have FLUENT read in your mesh file or a previously saved (non-MHD) case
file. Note that if you read in a new mesh file, you need to perform the appropriate
grid check and grid scale procedures.

4. Read in the user-defined function library.


The MHD model library should be pre-compiled using the standard procedure for
compiling FLUENT user-defined functions (UDFs). You install this library into
FLUENT using the Compiled UDFs panel.
Define−→User-Defined−→Functions−→Compiled...
Select the Load option and enter libudf in the Compiled UDFs panel to open the
library. The name of the UDF library will be saved with the FLUENT case file.
The library is opened automatically when the case file is subsequently read into
FLUENT.

A-2
c Fluent Inc. January 24, 2003
A.2 An Overview of Using the MHD Module

5. Define user-defined scalars.


You need to specify the number of user-defined scalars using the User-Defined Scalars
panel.
Define−→User-Defined Scalars...
The number of user-defined scalars is five for a 2-D case and seven for a 3-D case.
In the User-Defined Scalars panel, set the Number of User-Defined Scalars to 5 or 7
depending on whether the case is 2-D or 3-D.
For the user-defined scalar transport equation, a user flux function should be set.
For unsteady cases, a user unsteady function should also be set. In the User-Defined
Scalars panel, select mhd flux as Flux Function and mhd magnetic tsource as Unsteady
Function.
To set the diffusion term for the user-defined scalar equations, you use the Materials
panel.
Define−→Materials...
In the Materials panel, select the user-defined option for UDS Diffusivity and select
mhd magnetic diffusvity from the User-Defined Functions list..
! Note the spelling of the UDS-Diffusivity user-defined function.
! For more information, see Chapter 4. Also, refer to Table 4.3.1 for a list of scalars
and the variables they represent in the MHD model.

6. Define user-defined memories.


The number of user-defined memory locations used by the MHD module is 27. You
must allocate this memory using the User-Defined Memory panel.
Define−→User-Defined−→Memory...
In the User-Defined Memory panel set the Number of User-Defined Memory Locations
to 27 or more.
! Table 4.3.2 lists the names of the user memory locations and the variables they
represent in the MHD model.

7. Define user-defined function hooks.


As part of the MHD problem set-up, you need to invoke two utility UDFs through
the User-Defined Function Hooks panel.
Define−→User-Defined−→Function Hooks...
Select mhd init and mhd adjust for Initialization Function and Adjust Function, re-
spectively.


c Fluent Inc. January 24, 2003 A-3
Guidelines For Using the FLUENT MHD Model

8. Define the FLUENT solver parameters.


You define the FLUENT solver parameters using the Solver panel.
Define−→Models−→Solver...
(a) Under Solver, select the Segregated option.
(b) Under Formulation, select the Implicit option.
(c) Under Space, select either the 3D or 2D option.
(d) For steady cases, under Time, select the Steady option.
(e) For unsteady cases, under Time, select the Unsteady option.
(f) For unsteady cases, under Unsteady Formulation, select the 1st-Order Implicit
option.
9. Define the turbulence model.
A FLUENT MHD analysis involves using a turbulence model in your simulation. It
is recommended that you start with the standard k- turbulence model. Turbulence
models are set using the Viscous Model panel.
Define−→Models−→Viscous...
10. Activate the energy equation (optional).
Depending on your particular model, you may need to enable the energy equation
in your FLUENT simulation. The energy equation option can be found in the Energy
panel.
Define−→Models−→Energy...
11. Specify gravity (optional).
Depending on your particular model, you may or may not want to enable gravity
in your FLUENT simulation. The Operating Conditions panel contains the Gravity
option that you can either select or deselect.
Define−→Operating Conditions...
12. Define source terms.
MHD source terms should be defined for the momentum equation, energy equation,
magnetic induction equations, and electric potential equation. You set these terms
using the Fluid panel via the Boundary Conditions panel.
Define−→Boundary Conditions...
Select a fluid zone in the Boundary Conditions panel and set appropriate user-defined
functions in the Fluid panel. Repeat this process for each fluid zone in the model
that represents an electrically conductive fluid. You can use the Copy option in
the the Boundary Conditions panel to repeatedly attach source UDFs to other fluid
zones.
! UDFs for all MHD source terms are listed in Table 4.3.3.

A-4
c Fluent Inc. January 24, 2003
A.2 An Overview of Using the MHD Module

13. Define boundary conditions.


You set electromagnetic boundary conditions with user-defined functions at the
relevant boundaries using the Boundary Conditions panel.
Define−→Boundary Conditions...
For all scalars except the electric potential, set the User Defined Scalar Boundary
Condition to Specified Value and set the corresponding User Defined Scalar Boundary
Value to the appropriate user function according to the type of boundary condition
required.
! Boundary condition user-defined functions are listed in Table 4.3.4.
For the electric potential equation, a user-defined function is required only for
electrically insulating boundaries. In this case, the User Defined Scalar Boundary
Condition for the electric potential scalar should be set to Specified Flux, and User
Defined Scalar Boundary Value set to the user function mhd phi bc. For conducting
boundaries, set the User Defined Scalar Boundary Condition to Specified Value and set
User Defined Scalar Boundary Value to the desired numerical value of the potential
function without referencing a UDF.

14. Initialize the MHD Module.


To initialize the MHD model, you must specify the externally-imposed magnetic
field and all MHD-related user-defined scalars and memory locations. Two ap-
proaches may be used for the model initialization.
In the first approach, the MHD model is initialized along with the overall FLUENT
case. The hook function mhd init is called during the initialization. This approach
is used when the MHD model is to be activated at the start of the flow field
calculation.
In the second approach, the MHD model is initialized manually using the execute-
on-demand UDF capability. This approach is used when MHD effects are added
to a fully or partially solved flow field, or when the model parameters are changed
during a MHD calculation. You can access the execute-on-demand user function
using the Execute On Demand panel.
Define−→User-Defined−→Execute On Demand...
In the Execute On Demand panel, select mhd initialise from the function list and click
Execute to run the function. If your MHD problem involves interactions with the
discrete phase model (DPM), you should also execute the function mhd init dpm
to initialize the DPM-related user memory locations. For more information on
MHD/DPM interaction, see Section 4.3.7.
To change external magnetic field parameters, such as the scale factor, during a
MHD calculation, you will need to update the imposed magnetic field. This can be
performed by running the execute-on-demand UDF named mhd update B0.


c Fluent Inc. January 24, 2003 A-5
Guidelines For Using the FLUENT MHD Model

! Make sure the proper function is displayed in the Function drop-down list before
clicking Execute.
15. Fine-tune the FLUENT solver parameters.
Not all the scalars you define in the User-Defined Scalars panel need to be solved
for in a MHD calculation. The selection of which user scalars to solve will depend
on the approach used in solving a MHD problem and the type of problem.
In the magnetic induction approach, the scalars representing the induced magnetic
field (~b) must be solved. Scalars representing the imposed magnetic field (B
~ 0 ) are
never solved for in FLUENT.
You can choose which user-defined scalars do not need to be solved using the
Solution Controls panel.
Solve−→Controls−→Solution...
The user-defined scalars that do not need to be solved can be de-selected from the
Equations list in the Solution Controls panel.
For the magnetic induction approach, use the following solution control settings:
• In the Solution Controls panel, deselect User defined scalar-3 to User defined
scalar-6 from the Equations listings.
• Under Under-Relaxation Factors, enter 0.9 for the remaining user defined scalars
(i.e., User defined scalar-0 to User defined scalar-2).
Choose other under-relaxation factors as usually done in FLUENT(e.g., Mo-
mentum:0.7, Pressure:0.3, Energy:1.0).
16. Run the FLUENT MHD simulation.
It is often an effective strategy to begin your MHD calculations using a previously-
converged flow field solution. With this approach, the induction equations them-
selves are generally easy to converge. For more information, see Chapter 4.
17. Process the solution data.
You can use the standard post-processing facilities of FLUENT to display the results
of a MHD calculation. Contours of MHD variables can be displayed using the
Display−→Contours...
menu. The MHD variables can be selected from the variable list. Vectors of MHD
variables, such as the magnetic field vector and current density vector, can be
displayed using the
Display−→Vectors...
menu as custom vectors. For more information, see Chapter 4.
For more information on the postprocessing variables available in the FLUENT
MHD model, Table 4.3.1 and 4.3.2 lists the names of the user-defined scalars and
user-defined memory locations and the variables they represent in the MHD model.

A-6
c Fluent Inc. January 24, 2003
Appendix B. Definitions of the Magnetic
Field

B.1 Magnetic Field Definitions


The sinusoidal form of the magnetic field is defined as:

B0 = B̄0 + A0 cos(2 πft − K • R + φ)


( )
1 1 1 1
K = i+ j+ k (B.1-1)
λ cos α cos β cos γ

where B̄0 is the mean vector, A0 is the amplitude vector, K is defined as the propagation
vector, R is the position vector of an arbitrary point. cos α, cos β and cos γ are the
x , y and z direction cosines respectively. The quantities f , λ, and φ are the frequency,
wavelength, and phase offset, respectively. For a non-moving field the propagation vector
is zero. For a static field only applies.
The square form of the magnetic field is defined as:

cos(2 πft − K · R + φ)
B0 = B̄0 + A0 (B.1-2)
| cos(2 πft − K · R + φ)|

The definition of the propagation vector is the same as for the sinusoidal form.


c Fluent Inc. January 24, 2003 B-1
Definitions of the Magnetic Field

B-2
c Fluent Inc. January 24, 2003
Appendix C. External Magnetic Field Data
Format

C.1 Magnetic Field Data Format


The external magnetic field data file is in text format and of the following structure:
M AG DAT A
nX nY nZ
X1 Xn
Y1 Yn
Z1 Zn
nAC F req
BXre−1 BYre−1 BZre−1 BXim−1 BYim−1 BZim−1
...
BXre−n BYre−n BZre−n BXim−n BYim−n BZim−n
The first line is an identification tag for the data file. The second line defines the number
of data points in the x , y and z directions. The next three lines define the ranges in
x , y and z directions. The data points are assumed to be evenly distributed along each
direction. Line 6 defines the AC field flag and frequency. When nAC = 0, the magnetic
field is static. For AC field, nAC = 1 and Freq is the frequency in Hz.
The rest of the data file contains the magnetic field data points. Each line defines the
components of the real and imaginary parts of the magnetic field vector on one data
point. The data points are indexed as:

l = i + nX ((j − 1 ) + nY (k − 1 ))
i = 1 , ..., nX ; j = 1 , ..., nY ; k = 1 , ..., nZ

The data is listed in the ascending order from 1 to n, where n is the total number of
data points given by n = nX nY nZ .
For magnetic fields comprised of both DC and AC fields, the entire file structure described
above is repeated for the DC and AC parts. These two sections within the same file will
be imported into FLUENT and stored separately. The order of the DC and AC sections
of the file is not important.


c Fluent Inc. January 24, 2003 C-1
External Magnetic Field Data Format

The imported data is interpreted as a snapshot of the applied magnetic field at an instant
in time. Complex form is used to accommodate oscillating/moving fields. Thus, using
complex numbers, and with reference to the quantities defined in Appendix B,

   
 BX re 
   BX im 
 
B~0 ≡  BY re  + i  BY im 

BZ re  
BZ im 
= B̄0 + A0 exp[i (2 πft + φ)] (C.1-1)

For a DC field,

B̄o,i = Bre,i i = x , y, z (C.1-2)

For an AC field,
q
Ao,i = Bre,i 2 + Bim,i 2 i = x , y, z (C.1-3)

and

Bim,i
 
−1
φi = tg i = x , y, z (C.1-4)
Bre,i

Note that when the external magnetic field import option is used, the frequency, f , read
from this file supercedes the value specified in the GUI.

C-2
c Fluent Inc. January 24, 2003
Bibliography

[1] R. Moreau. Magnetohydrodynamics. Kluwer Academic Publishers, 1990.


c Fluent Inc. January 24, 2003 Bib-1

You might also like