Values returned to the solver by UDFs must be in SI units. ...... Used to compute steady-state solution when intermediate solution is not important. â³ ..... model are of the form. â Value of the parameters εâ k k k kkk k k k t k k kkkk kkk k. G k ku.
Fluent Software Training TRN-99-003
User Defined Functions
G1
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Introduction u
What is a User Defined Function? l
A UDF is a routine (programmed by the user) written in C which can be dynamically linked with the solver. n
n
u
Standard C functions s e.g., trigonometric, exponential, control blocks, do-loops, file i/o, etc. Pre-Defined Macros s Allows access to field variable, material property, and cell geometry data.
Why build UDF’s? l
Standard interface cannot be programmed to anticipate all needs. n
n n n
Customization of boundary conditions, source terms, reaction rates, material properties, etc. Adjust functions (once per iteration) Execute on Demand functions Solution Initialization
G2
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
UDF Basics u
UDF’s assigns values (e.g., boundary data, source terms) to individual cells and cell faces in fluid and boundary zones. l l
In a UDF, zones are referred to as threads. A looping macro is used to access individual cells belonging to a thread. n
n
u
e.g., a face-loop macro visits 563 faces on face zone 3 (velocity-inlet). s Position of each face is available to calculate and assign spatially varying properties. Thread and variable references are automatically passed to UDF when assigned to boundary in GUI.
Values returned to the solver by UDFs must be in SI units.
G3
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Using UDFs in the Solvers u
The basic steps for using UDFs in FLUENT are as follows: STEP 1: STEP 2: STEP 3: STEP 4: STEP 5: STEP 6:
Create a file containing the UDF source code Start the solver and read in your case/data files Interpret or Compile the UDF Assign the UDF to the appropriate variable and zone in BC panel. Set the UDF update frequency in the Iterate panel Run the calculation
G4
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Example: Non-Uniform Inlet Velocity u
A non-uniform inlet velocity is to be imposed on the 2D turbine vane shown below. The x-velocity variation is to be specified as: u(y) = 20 [ 1 - (y/0.0745)2]
y=0
G5
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Example: Source Code u
The DEFINE_PROFILE macro allows the function inlet_x_velocity to be defined. l
l
u
u
u u
All UDFs begin with a DEFINE_ macro. inlet_x_velocity will be identifiable in solver GUI.
#include "udf.h" DEFINE_PROFILE(inlet_x_velocity, thread, nv) { float x[3]; /* this will hold the position vector*/ float y; face_t f; begin_f_loop(f, thread) { F_CENTROID(x,f,thread); y = x[1]; F_PROFILE(f, thread, nv) = 20.*(1.- y*y/(.0745*.0745)); } end_f_loop(f, thread)
and nv are dynamic references, input to the UDF to identify the zone and variable being defined, respectively. The macro begin_f_loop loops } over all faces, f, on thread. The F_CENTROID macro assigns cell position vector to x[]. The F_PROFILE macro applies the velocity component to face f. thread
G6
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Example: Interpreting the UDF u u
u u
The UDF is saved as velprof.c Define ÕUser Defined ÕFunctions ÕInterpreted…
Click Compile The assembly language code will scroll past window.
velocity_profile: .local.pointer thread (r0) .local.int position (r1) 0 .local.end 0 save .local.int f (r6) 8 push.int 0 10 save .local.int. . . . .L1: 132 restore 133 restore 134 ret.v
G7
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Example: Activating the UDF u
u
Access the boundary condition panel. Switch from constant to the UDF function in the X-Velocity dropdown list.
G8
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Example: Run the Calculation u u
Run the calculation as usual. You can change the UDF Profile Update Interval in the Iterate panel (here it is set to1).
G9
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Example: Numerical Solution u
u
The figure at right shows velocity field throughout turbine blade passage. The bottom figure shows the velocity vectors at the inlet. Notice the imposed parabolic profile.
G10
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Macros u
Macros are pre-defined (Fluent) functions: l l
u
Allows definition of UDF functionality and function name (DEFINE_ macro) Allows access to field variables, cell information, looping capabilities, etc.
Macros are defined in header files. l
The udf.h header file must be included in your source code. n
l
The header files must be accessible in your path. n
l
#include “udf.h”
Typically stored in Fluent.Inc/src/ directory.
Other “.h” header files may need to be included. n
Depends upon relevant variables and macros needed in your UDF, e.g., s dpm.h for DPM variable access
G11
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
DEFINE Macros u
Any UDF you write must begin with a DEFINE macro: l
14 general purpose macros and 10 DPM-related macros (not listed):
DEFINE_ADJUST(name,domain); general purpose UDF called every iteration DEFINE_INIT(name,domain); UDF used to initialize field variables DEFINE_ON_DEMAND(name); defines an ‘execute-on-demand’ function DEFINE_RW_FILE(name,face,thread,index); customize reads/writes to case/data files DEFINE_PROFILE(name,thread,index); defines boundary profiles DEFINE_SOURCE(name,cell,thread,dS,index); defines source terms DEFINE_HEAT_FLUX(name,face,thread,c0,t0,cid,cir); defines heat flux DEFINE_PROPERTY(name,cell,thread); defines material properties DEFINE_DIFFUSIVITY(name,cell,thread,index); defines UDS and species diffusivities DEFINE_UDS_FLUX(name,face,thread,index); defines UDS flux terms DEFINE_UDS_UNSTEADY(name,face,thread,index); defines UDS transient terms DEFINE_SR_RATE(name,face,thread,r,mw,yi,rr); defines surface reaction rates DEFINE_VR_RATE(name,cell,thread,r,mw,yi,rr,rr_t); defines vol. reaction rates DEFINE_SCAT_PHASE_FUNC(name,cell,face); defines scattering phase function for DOM
G12
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Looping and Thread Macros cell_t face_t Thread Domain
c; defines a cell f; defines a face *t; pointer to a thread *d; pointer to collection of all threads
Specialized variable types used for referencing.
thread_loop_c(t, d){} loop that steps through all cell threads in domain thread_loop_f(t, d){} loop that steps through all face threads in domain begin_c_loop(c, t){} end_c_loop(c, t) loop that steps through all cells in a thread begin_f_loop(f, t){} end_f_loop(f, t) loop that steps through all faces in a thread Thread *tf = Lookup_Thread(domain, ID); return thread pointer of integer ID of zone THREAD_ID(tf); returns zone integer ID of thread pointer
Code enclosed in {} is executed in loop.
G13
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Geometry and Time Macros C_NNODES(c, t); returns nodes/cell C_NFACES(c, t); returns faces/cell F_NNODES(f, t); returns nodes/face C_CENTROID(x, c, t); returns coordinates of cell centroid in array x[] F_CENTROID(x, f, t); returns coordinates of face centroid in array x[] F_AREA(A, f, t); returns area vector in array A[] C_VOLUME(c, t); returns cell volume C_VOLUME_2D(c, t); returns cell volume for axisymmetric domain NV_MAG(x); returns magnitude of vector x[] real flow_time(); returns actual time int time_step; returns time step number RP_Get_Real(“physical-time-step”); returns time step size
G14
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Cell Field Variable Macros C_R(c,t); density C_P(c,t); pressure C_U(c,t); u-velocity C_V(c,t); v-velocity C_W(c,t); w-velocity C_T(c,t); temperature C_H(c,t); enthalpy C_K(c,t); turbulent KE C_D(c,t); tke dissipation C_YI(c,t,i); species mass fraction C_UDSI(c,t,i); UDS scalars C_UDMI(c,t,i); UDM scalars C_DUDX(c,t); C_DUDY(c,t); C_DUDZ(c,t); C_DVDX(c,t); C_DVDY(c,t);
velocity derivative velocity derivative velocity derivative velocity derivative velocity derivative
C_DVDZ(c,t); C_DWDX(c,t); C_DWDY(c,t); C_DWDZ(c,t);
velocity derivative velocity derivative velocity derivative velocity derivative
C_MU_L(c,t); laminar viscosity C_MU_T(c,t); turbulent viscosity C_MU_EFF(c,t); effective viscosity C_K_L(c,t); laminar thermal conductivity C_K_T(c,t); turbulent thermal conductivity C_K_EFF(c,t); effective thermal conductivity C_CP(c,t); specific heat C_RGAS(c,t); gas constant C_DIFF_L(c,t); laminar species diffusivity C_DIFF_EFF(c,t,i); effective species diffusivity
G15
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Face Field Variable Macros u
Face field variables are only available when using the segregated solver and generally, only at exterior boundaries. F_R(f,t); density F_P(f,t); pressure F_U(f,t); u-velocity F_V(f,t); v-velocity F_W(f,t); w-velocity F_T(f,t); temperature F_H(f,t); enthalpy F_K(f,t); turbulent KE F_D(f,t); tke dissipation F_YI(f,t,i); species mass fraction F_UDSI(f,t,i); UDS scalars F_UDMI(f,t,i); UDM scalars
G16
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Other UDF Applications u
In addition to defining boundary values, source terms, and material properties, UDFs can be used for: l
Initialization n
l
Adjust n
l
n
l
defines fluid-side diffusive and radiative wall heat fluxes in terms of heat transfer coefficients applies to all walls
User Defined Surface and Volumetric Reactions Read-Write to/from case and data files n
l
Executes every iteration.
Wall Heat Flux n
l
Executes once per initialization.
Read order and Write order must be same.
Execute-on-Demand capability n
Not accessible during solve G17
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
User Defined Memory User-allocated memory Define ® User-Defined ® Memory... u
l l
Up to 500 field variables can be defined. Can be accessed by UDFs: n n
l l
C_UDMI(cell,thread,index); F_UDMI(face,thread,index);
Can be accessed for post-processing. Information is stored in data file.
G18
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
User Defined Scalars u
FLUENT can solve (up to 50) generic transport
equations for User Defined Scalars, fk: ∂φ k ∂φ k ∂ = Sφk + Fiφk − Γk ∂t ∂xi ∂xi u
k = 1, …, Nscalars
User specifies: DefineÕModelsÕUser-Defined Scalars… l
Number of User-Defined Scalars
l
Flux Function, F n n
n
u
DEFINE_UDS_FLUX(name,face,thread,index) DEFINE_UDS_UNSTEADY(name,cell,thread,index,apu,su)
‘case’ statement can be used to associate multiple flux and transient functions with each UDS.
Example l
Can be used to determine magnetic and/or electric field in a fluid zone. G19
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
User Defined Scalars (2) u
User must also specify: l l
Source terms, Sf Diffusivity, Gf n
l
Boundary Conditions for each UDS. n
u
case statement needed to define UDF diffusivities for each UDS. Specified Flux or Specified Value.
Define as constant or with UDF.
G20
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Interpreted vs. Compiled UDF’s u
u
Functions can either be read in and interpreted at run time (as in the example) or compiled and grouped into a shared library that is linked with the standard FLUENT executable. Interpreted vs. compiled code l
Interpreter n n n n
l
Interpreter is a large program that sits in the computer’s memory. Executes code on a “line by line” basis instantaneously Advantages - does not need a separate compiler Disadvantage - slow and takes up space in memory
Compiler (refer to User’s Guide for instructions)n n n n
Code is translated “once” into machine language (object modules). Efficient way to run UDF’s. Uses Makefiles Creates “shared libraries” which are linked with the rest of the solver Overcomes interpreter limitations e.g. mixed mode arithmetic, structure references etc. G21
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Supporting UDF’s u
Because UDF’s can be very complicated, Fluent Inc. does not assume responsibility for the accuracy or stability of solutions obtained using UDFs that are user-generated. l
l
Support will be limited to guidance related to communication between a UDF and the FLUENT solver. Other aspects of the UDF development process that include conceptual function design, implementation (writing C code), compilation and debugging of C source code, execution of the UDF, and function design verification will remain the responsibility of the UDF author. n
Consulting option
G22
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Modeling Multiphase Flows
1
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Outline u u u u
Definitions; Examples of flow regimes Description of multiphase models in FLUENT 5 and FLUENT 4.5 How to choose the correct model for your application Summary and guidelines
2
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Definitions u
Multiphase flow is simultaneous flow of l l
u
Matters with different phases( i.e. gas, liquid or solid). Matters with different chemical substances but with the same phase (i.e. liquid-liquid like oil-water).
Primary and secondary phases l
One of the phases is considered continuous (primary) and others (secondary) are considered to be dispersed within the continuous phase. n
u
A diameter has to be assigned for each secondary phase to calculate its interaction (drag) with the primary phase (except for VOF model).
Dilute phase vs. Dense phase; l
Refers to the volume fraction of secondary phase(s) n
Volume fraction of a phase = Volume of the phase in a cell/domain Volume of the cell/domain 3
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Flow Regimes u
Multiphase flow can be classified by the following regimes: l
l
l
l
l
l
Bubbly flow: Discrete gaseous or fluid bubbles in a continuous fluid Droplet flow: Discrete fluid droplets in a continuous gas Particle-laden flow: Discrete solid particles in a continuous fluid Slug flow: Large bubbles (nearly filling cross-section) in a continuous fluid Annular flow: Continuous fluid along walls, gas in center Stratified/free-surface flow: Immiscible fluids separated by a clearly-defined interface 4
slug flow
annular flow
bubbly flow droplet flow particle-laden flow
free-surface flow
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Flow Regimes u
User must know a priori what the flow field looks like: l
Flow regime, n
l l l
bubbly flow , slug flow, etc. s Model one flow regime at a time. – Multiple flow regime can be predicted if they are predicted by one model e.g. slug flow and annular flow may coexist since both are predicted by VOF model.
turbulent or laminar, dilute or dense, bubble or particle diameter (mainly for drag considerations).
5
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Multiphase Models u
Four models for multiphase flows currently available in structured FLUENT 4.5 l Lagrangian dispersed phase model (DPM) l Eulerian Eulerian model l Eulerian Granular model l Volume of fluid (VOF) model
u
Unstructured FLUENT 5 l Lagrangian dispersed phase model (DPM) l Volume of fluid model (VOF) l Algebraic Slip Mixture Model (ASMM) l Cavitation Model
6
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Dispersed Phase Model
7
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Dispersed Phase Model u
Appropriate for modeling particles, droplets, or bubbles dispersed (at low volume fraction; less than 10%) in continuous fluid phase: l l l
u
u
u u u
Spray dryers Coal and liquid fuel combustion Some particle-laden flows
Computes trajectories of particle (or droplet or bubble) streams in continuous phase. Computes heat, mass, and momentum transfer between dispersed and continuous phases. Neglects particle-particle interaction. Particle trajectories in a spray dryer Particles loading can be as high as fluid loading Computes steady and unsteady (FLUENT 5) particle tracks. 8
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Particle Trajectory Calculations u
Particle trajectories computed by solving equations of motion of the particle in Lagrangian reference frame: r r du p r r r = f drag (u − u p ) + g ( ρ p − ρ ) / ρ p + F / ρ p dt where F represents additional forces due to: l virtual mass and pressure gradients l rotating reference frames l temperature gradients l Brownian motion ( FLUENT 5) l Saffman lift (FLUENT 5) l user defined
9
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Coupling Between Phases u
One-Way Coupling Fluid phase influences particulate phase via drag and turbulence transfer. l Particulate phase have no influence on the gas phase. Two-Way Coupling l Fluid phase influences particulate phase via drag and turbulence transfer. l Particulate phase influences fluid phase via source terms of mass, momentum, and energy. l Examples include: l
u
n n n n n
Inert particle heating and cooling Droplet evaporation Droplet boiling Devolatilization Surface combustion
10
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
DPM: Calculation Procedure u
To determine impact of dispersed phase on continuous phase flow field, coupled calculation procedure is used: continuous phase flow field calculation interphase heat, mass, and momentum exchange particle trajectory calculation
u
Procedure is repeated until both flow fields are unchanged.
11
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Turbulent Dispersion of Particles u
Dispersion of particle due to turbulent fluctuations in the flow can be modeled using either: l
Discrete Random Walk Tracking (stochastic approach)
l
Particle Cloud Tracking
12
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
User Defined Function Access in DPM u
User defined functions (UDF’s) are provided for access to the discrete phase model. Functions are provided for user defined: l l l l l l l l
drag external force laws for reacting particles and droplets customized switching between laws FLUENT 5 output for sample planes erosion/accretion rates access to particle definition at injection time scalars associated with each particle and access at each particle time step (possible to integrate scalar variables over life of particle)
13
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Eulerian-Eulerian Multiphase Model FLUENT 4.5 10s
70s
120s
Becker et al. 1992
water water
air air Locally Aerated Bubble Column
14
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Eulerian Multiphase Model u
Appropriate for modeling gas-liquid or liquid-liquid flows (droplets or bubbles of secondary phase(s) dispersed in continuous fluid phase (primary phase)) where: l l
Phases mix or separate Bubble/droplet volume fractions from 0 to 100% n n n n
u
Evaporation Boiling Separators Aeration
Volume fraction of water
Stream function contours for water
Boiling water in a container
Inappropriate for modeling stratified or free-surface flows. 15
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Eulerian Multiphase Model u
u u
Solves momentum, enthalpy, continuity, and species equations for each phase and tracks volume fractions. Uses a single pressure field for all phases. Interaction between mean flow field of phases is expressed in terms of a drag, virtual and lift forces. l l
l
Several formulations for drag is provided. Alternative drag laws can be formulated via UDS. Other forces can be applied through UDS.
16
Gas sparger in a mixing tank: contours of volume fraction with velocity vectors
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Eulerian Multiphase Model u
Can solve for multiple species and homogeneous reactions in each phase. l
Heterogeneous reactions can be done through UDS.
u
Allows for heat and mass transfer between phases.
u
Turbulence models for dilute and dense phase regimes.
17
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Mass Transfer u
Evaporation/Condensation. l
For liquid temperatures ≥ saturation temperature, evaporation rate:
m& v = l
l
u
rvα l ρ l (Tl − Tsat ) Tsat
For vapor temperatures ≤ saturation temperature, condensation rate:
rlα v ρ v (Tsat − Tv ) m& l = Tsat
User specifies saturation temperature and, if desired, “time relaxation parameters” rl and rv . (Wen Ho Lee (1979))
Unidirectional mass transfer, r is constant
m& 12 = rα 2 ρ1 u
User Defined Subroutine for mass transfer 18
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Eulerian Multiphase Model: Turbulence u
u
Time averaging is needed to obtain smoothed quantities from the space averaged instantaneous equations. Two methods available for modeling turbulence in multiphase flows within context of standard k-ε model: l
Dispersed turbulence model (default) appropriate when both of these conditions are met: n
n
l
u
Number of phases is limited to two: s Continuous (primary) phase s Dispersed (secondary) phase Secondary phase must be dilute.
Secondary turbulence model appropriate for turbulent multiphase flows involving more than two phases or a non-dilute secondary phase.
Choice of model depends on importance of secondary-phase turbulence in your application.
19
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Eulerian Granular Multiphase Model: FLUENT 4.5
Volume fraction of air 2D fluidized bed with a central jet 20
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Eulerian Granular Multiphase Model: u
u
Extension of Eulerian-Eulerian model for flow of granular particles (secondary phases) in a fluid (primary)phase Appropriate for modeling: l l l l l
Fluidized beds Risers Pneumatic lines Hoppers, standpipes Particle-laden flows in which: n
u
Phases mix or separate
Granular volume fractions can vary from 0 to packing limit
Solid velocity profiles
Contours of solid volume fraction
Circulating fluidized bed, Tsuo and Gidaspow (1990). 21
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Eulerian Granular Multiphase Model: Overview u u u
u
The fluid phase must be assigned as the primary phase. Multiple solid phase can be used to represent size distribution. Can calculate granular temperature (solids fluctuating energy) for each solid phase. Calculates a solids pressure field for each solid phase. l l
u
All phases share fluid pressure field. Solids pressure controls the solids packing limit
Solids pressure, granular temperature conductivity, shear and bulk viscosity can be derived based on several kinetic theory formulations. n n n
Gidaspow Syamlal Sinclair
-good for dense fluidized bed applications -good for a wide range of applications -good for dilute and dense pneumatic transport lines and risers 22
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Eulerian Granular Multiphase Model u
Frictional viscosity pushes the limit into the plastic regime. l
u
Several choice of drag laws: l
u
u
Hoppers, standpipes Drag laws can be modified using UDS.
Heat transfer between phases is the same as in Eulerian/Eulerian multiphase model. Only unidirectional mass transfer model is available. l l
Rate of mass transfer can be modified using UDS. Homogeneous reaction can be modeled. n
u u
u
Heterogeneous reaction can be modeled using UDS.
Can solve for enthalpy and multiple species for each phase. Physically based models for solid momentum and granular temperature boundary conditions at the wall. Turbulence treatment is the same as in Eulerian-Eulerian model l
Sinclair model provides additional turbulence model for solid phase 23
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Algebraic Slip Mixture Model FLUENT 5
Courtesy of Fuller Company
24
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Algebraic Slip Mixture Model u
Can substitute for Eulerian/Eulerian, Eulerian/Granular and Dispersed phase models Efficiently for Two phase flow problems: l l l
u
Fluid/fluid separation or mixing: Sedimentation of uniform size particles in liquid. Flow of single size particles in a Cyclone.
Applicable to relatively small particles ( 1000
Schuh et al.
3 Cd
)
SchilerandNaumann Schuhetal. MorsietAlexander
2.5 2 1.5 1
( (
)
241+ 0.15Re0.687 0 < Re≤ 200 CD = 24 0.914Re0.282+ 0.0135Re / Re 200≤ Re> 2500 0.4008 Re> 2500
)
Morsi and Alexander
0.5 0
CD = a1 +
10 2460 4910 7360 9810 1226014710 Re
49
a2 a3 + where a1, a2 , a3 are f (Re) Re Re2
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Solution Algorithms for Multiphase Flows Multiphase MultiphaseFlow FlowSolution Solution Algorithms Algorithms Only Eulerian/Eulerian model
Implicit/Full Implicit/FullElimination Elimination Algorithm Algorithmv4.5 v4.5 u
Coupled solver algorithms (more coupling between phases) l
u
TDMA TDMACoupled Coupled Algorithm Algorithmv4.5 v4.5
Faster turn around and more stable numerics
High order discretization schemes for all phases. l
More accurate results
50
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Heterogeneous Reactions in FLUENT4.5 u
Problem Description l l l
u
Two liquid e.g. (L1,L2) react and make solids e.g. (s1,s2) Reactions happen within liquid e.g. (L1-->L2) Reactions happen within solid e.g. (s1--->s2)
Solution! l
Consider a two phase liquid (primary) and solid (secondary) n n
l
l
liquid has two species L1, L2 solid has two species s1,s2
Reactions within each phase i.e. (L1-->L2) and (s1-->s2) can be set up as usual through GUI (like in single phase) For heterogeneous reaction e.g. (L1+0.5L2-->0.2s1+s2)
51
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Heterogeneous Reactions in FLUENT 4.5 n
n
In usrmst.F s calculate the net mass transfer between phases as a result of reactions – Reactions could be two ways s Assign this value to suterm – If the net mass transfer is from primary to secondary the value should be negative and vica versa. s The time step and mass transfer rate should be such that the net volume fraction change would not be more than 5-10%. In urstrm.F s Adjust the mass fraction of each species by assigning a source or sink value (+/-) according to mass transfer calculated above. s Adjust the enthalp of each phase by the net amount of heat of reactions and enthalpy transfer due to mass transfer. Again this will be in a form of a source term.
52
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Heterogeneous Reactions in FLUENT 4.5 u u
Compile your version of the code Run Fluent and set up the case : l l l l l l
Enable time dependent, multiphase, temperature and species calculations. Define phases Enable mass transfer and multi-component multi-species option. Define species, homogeneous reactions within each phases Define properties Enable user defined mass transfer
GOOD LUCK!! 53
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Particle size Descriptive terms Coarse solid Granular solid Coarse powder Fine powder Super fine powder Ultra fine powder Nano Particles
Size range 5 - 100 mm 0.3 - 5 mm 100-300 µm 10-100 µm 1-10 µm ~1 µm ~1e-3 µm
54
Example coal sugar salt, sand FCC catalyst face powder paint pigments molecules
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Discrete Random Walk Tracking u
u
Each injection is tracked repeatedly in order to generate a statistically meaningful sampling. Turbulent fluctuation in the flow field are represented by defining an instantaneous fluid velocity:
u i = u i + u 'i where
u ' i is derived from the local turbulence parameters:
u 'i = ς
u
2k 3
and ς is a normally distributed random number Mass flow rates and exchange source terms for each injection are divided equally among the multiple stochastic tracks.
55
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Cloud Tracking u
The particle cloud model uses statistical methods to trace the turbulent dispersion of particles about a mean trajectory. The mean trajectory is calculated from the ensemble average of the equations of motion for the particles represented in the cloud. The distribution of particles inside the cloud is represented by a Gaussian probability density function.
56
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Stochastic vs. Cloud Tracking u
Stochastic tracking: l
l
l
l
u
Accounts for local variations in flow properties such as temperature, velocity, and species concentrations. Requires a large number of stochastic tries in order to achieve a statistically significant sampling (function of grid density). Insufficient number of stochastic tries results in convergence problems and non-smooth particle concentrations and coupling source term distributions. Recommended for use in complex geometry
Cloud tracking: l
l l
Local variations in flow properties (e.g. temperature) get averaged away inside the particle cloud. Smooth distributions of particle concentrations and coupling source terms. Each diameter size requires its own cloud trajectory calculation.
57
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Granular Flow Regimes Elastic Regime
Plastic Regime Viscous Regime
Stagnant
Slow flow
Stress is strain dependent dependent Elasticity
Strain rate independent Soil mechanics
58
Rapid flow Strain rate
Kinetic theory
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Flow regimes
59
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Eulerian Multiphase Model: Heat Transfer u
Rate of energy transfer between phases is function of temperature difference between phases:
(
Q pq = H pq T p − Tq l
)
Hpq (= Hqp) is heat transfer coefficient between pth phase and qth phase. n
Can be modified using UDS.
Boiling water in a container: contours of water temperature 60
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Sample Planes and Particle Histograms u
As particles pass through sample planes (lines in 2-D), their properties (position, velocity, etc.) are written to files. These files can then be read into the histogram plotting tool to plot histograms of residence time and distributions of particle properties. The particle property mean and standard deviation are also reported.
61
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Combustion Modeling in FLUENT
1
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Outline u u u u u u u
Applications Overview of Combustion Modeling Capabilities Chemical Kinetics Gas Phase Combustion Models Discrete Phase Models Pollutant Models Combustion Simulation Guidelines
2
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Applications u
Wide range of homogeneous and heterogeneous reacting flows l l l l l
u
Furnaces Boilers Process heaters Gas turbines Rocket engines
Temperature in a gas furnace
Predictions of: l
l l l
CO2 mass fraction
Flow field and mixing characteristics Temperature field Species concentrations Particulates and pollutants
Stream function 3
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Aspects of Combustion Modeling Combustion Models
Dispersed Phase Models
Premixed Partially premixed Nonpremixed
Droplet/particle dynamics Heterogeneous reaction Devolatilization Evaporation
Governing Transport Equations Mass Momentum (turbulence) Energy Chemical Species
Radiative Heat Transfer Models
Pollutant Models
4
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Combustion Models Available in FLUENT u
Gas phase combustion l l l l
u
Generalized finite rate formulation (Magnussen model) Conserved scalar PDF model (one and two mixture fractions) Laminar flamelet model (V5) Zimont model (V5)
Discrete phase model n
n
u u u
Turbulent particle dispersion s Stochastic tracking s Particle cloud model (V5) Pulverized coal and oil spray combustion submodels
Radiation models: DTRM, P-1, Rosseland and Discrete Ordinates (V5) Turbulence models: k-ε, RNG k-ε, RSM, Realizable k-ε (V5) and LES (V5) Pollutant models: NOx with reburn chemistry (V5) and soot 5
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Modeling Chemical Kinetics in Combustion u
Challenging l l
l
u
Most practical combustion processes are turbulent Rate expressions are highly nonlinear; turbulence-chemistry interactions are important Realistic chemical mechanisms have tens of species, hundreds of reactions and stiff kinetics (widely disparate time scales)
Practical approaches l
Reduced chemical mechanisms n
l
Finite rate combustion model
Decouple reaction chemistry from turbulent flow and mixing n
n
Mixture fraction approaches s Equilibrium chemistry PDF model s Laminar flamelet Progress variable s Zimont model 6
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Generalized Finite Rate Model u u
Chemical reaction process described using global mechanism. Transport equations for species are solved. l
u
These equations predict local time-averaged mass fraction, mj , of each species.
Source term (production or consumption) for species j is net reaction rate over all k reactions in mechanism: Rj =
∑R
jk
k
u
u
Rjk (rate of production/consumption of species j in reaction k) is computed to be the smaller of the Arrhenius rate and the mixing or “eddy breakup” rate. Mixing rate related to eddy lifetime, k /ε. l
Physical meaning is that reaction is limited by the rate at which turbulence can mix species (nonpremixed) and heat (premixed). 7
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Setup of Finite Rate Chemistry Models u
Requires: l l
List of species and their properties List of reactions and reaction rates
u
FLUENT V5 provides this info in a mixture material database.
u
Chemical mechanisms and physical properties for the most common fuels are provided in database. If you have different chemistry, you can:
u
l l
Create new mixtures. Modify properties/reactions of existing mixtures.
8
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Generalized Finite Rate Model: Summary u
Advantages: l l l
u
Applicable to nonpremixed, partially premixed, and premixed combustion Simple and intuitive Widely used
Disadvantages: l
l l
l
Unreliable when mixing and kinetic time scales are comparable (requires Da >>1). No rigorous accounting for turbulence-chemistry interactions Difficulty in predicting intermediate species and accounting for dissociation effects. Uncertainty in model constants, especially when applied to multiple reactions.
9
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Conserved Scalar (Mixture Fraction) Approach: The PDF Model u u
Applies to nonpremixed (diffusion) flames only Assumes that reaction is mixing-limited l l
u
Reaction mechanism is not explicitly defined by you. l
u
u
Local chemical equilibrium conditions prevail. Composition and properties in each cell defined by extent of turbulent mixing of fuel and oxidizer streams. Reacting system treated using chemical equilibrium calculations (prePDF).
Solves transport equations for mixture fraction and its variance, rather than species transport equations. Rigorous accounting of turbulence-chemistry interactions.
10
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Mixture Fraction Definition u
The mixture fraction, f, can be written in terms of elemental mass fractions as:
f = l
u
u
Z k − Z k ,O Z k , F − Z k ,O
where Zk is the elemental mass fraction of some element, k. Subscripts F and O denote fuel and oxidizer inlet stream values, respectively.
For simple fuel/oxidizer systems, the mixture fraction represents the fuel mass fraction in a computational cell. Mixture fraction is a conserved scalar: l
Reaction source terms are eliminated from governing transport equations.
11
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Systems That Can be Modeled Using a Single Mixture Fraction u
Fuel/air diffusion flame:
60% CH4 40% CO 21% O2 79% N2
f=1 f=0 35% O2 65% N2
u
u
Diffusion flame with oxygenenriched inlets:
System using multiple fuel inlets:
f=1
35% O2 65% N2
f=0
60% CH4 20% CO 10% C3H8 10% CO2 21% O2 79% N2 60% CH4 20% CO 10% C3H8 10% CO2 12
f=0
60% CH4 40% CO
f=1 f=0 f=1 © Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Equilibrium Approximation of System Chemistry u u
Chemistry is assumed to be fast enough to achieve equilibrium. Intermediate species are included.
13
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
PDF Modeling of Turbulence-Chemistry Interaction u
Fluctuating mixture fraction is completely defined by its probability density function (PDF).
1 T→∞ T
p(V )∆V = lim
u
u
∑τ
i
i
p(V), the PDF, represents fraction of sampling time when variable, V, takes a value between V and V + ∆V. p(f) can be used to compute time-averaged values of variables that 1 depend on the mixture fraction, f: φ i = ∫0 p( f )φ i ( f ) df l l
Species mole fractions Temperature, density 14
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
PDF Model Flexibility u
Nonadiabatic systems: l
l
u
In real problems, with heat loss or gain, local thermo-chemical state must be related to mixture fraction, f, and enthalpy, h. Average quantities now evaluated as a function of mixture fraction, enthalpy (normalized heat loss/gain), and the PDF, p(f).
Second conserved scalar: l
With second scalar in FLUENT, you can model: n
n n n
Two fuel streams with different compositions and single oxidizer stream (visa versa) Nonreacting stream in addition to a fuel and an oxidizer Co-firing a gaseous fuel with another gaseous, liquid, or coal fuel Firing single coal with two off-gases (volatiles and char burnout products) tracked separately
15
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Mixture Fraction/PDF Model: Summary u
Advantages: l l l l
l
u
Predicts formation of intermediate species. Accounts for dissociation effects. Accounts for coupling between turbulence and chemistry. Does not require the solution of a large number of species transport equations Robust and economical
Disadvantages: l l l
System must be near chemical equilibrium locally. Cannot be used for compressible or non-turbulent flows. Not applicable to premixed systems.
16
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
The Laminar Flamelet Model u
u
u
Extension of the mixture fraction PDF model to moderate chemical nonequilibrium Turbulent flame modeled as an ensemble of stretched laminar, opposed flow diffusion flames Temperature, density and species (for adiabatic) specified by two parameters, the mixture fraction and scalar dissipation rate l Recall that for the mixture fraction PDF model (adiabatic), thermo-chemical state is function of f only
φi =φi ( f , χ) l
χ = (∂f / ∂x)2
χ can be related to the local rate of strain 17
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Laminar Flamelet Model (2) u
Statistical distribution of flamelet ensemble is specified by the PDF P(f,χ), which is modeled as Pf (f) Pχ (χ), with a Beta function for Pf (f) and a Dirac-delta distribution for Pχ (χ) 1∞
φi = ∫∫φi ( f , χ)⋅ Pf ( f )Pχ (χ)dχdf 00
u u
Only available for adiabatic systems in V5 Import strained flame calculations l
u
prePDF or Sandia’s OPPDIF code
Single or multiple flamelets l l
Single: Multiple: n n
u
user specified strain, a strained flamelet library, 0 < a < aextinction
a=0 equilibrium a= a extinction is the maximum strain rate before flame extinguishes
Possible to model local extinction pockets (e.g. lifted flames) 18
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
The Zimont Model for Premixed Combustion u
Thermo-chemistry described by a single progress variable, c = ∑ Y p / ∑ Y pad ∂ ν t ∂c ∂ ∂ ( ρ c ) + ρ u c ρ = ( ) i ∂x i Sc t ∂x i ∂t ∂x i
u u
+ Rc
p
p
0≤ c≤1
Mean reaction rate, Rc = ρ unburnt U t ∇ c Turbulent flame speed, Ut, derived for lean premixed combustion and accounts for l l l l
Equivalence ratio of the premixed fuel Flame front wrinkling and thickening by turbulence Flame front quenching by turbulent stretching Differential molecular diffusion
u
For adiabatic combustion, T = (1 − c )T unburnt + c T ad
u
The enthalpy equation must be solved for nonadiabatic combustion 19
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Discrete Phase Model u
Trajectories of particles/droplets/bubbles are computed in a Lagrangian frame. l
u
l
l
u u
Although the mass loading can be large No particle-particle interaction or break up
Turbulent dispersion modeled by l
u
Continuous phase flow field calculation
Discrete phase volume fraction must < 10% l
u
Exchange (couple) heat, mass, and momentum with Eulerian frame gas phase
Stochastic tracking Particle cloud (V5)
Rosin-Rammler or linear size distribution Particle tracking in unsteady flows (V5) Model particle separation, spray drying, liquid fuel or coal combustion, etc. 20
Particle trajectory calculation
Update continuous phase source terms
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Particle Dispersion: The Stochastic Tracking Model u
Turbulent dispersion is modeled by an ensemble of Monte-Carlo realizations (discrete random walks)
u
Particles convected by the mean velocity plus a random direction turbulent velocity fluctuation
u
Each trajectory represents a group of particles with the same properties (initial diameter, density etc.)
u
Turbulent dispersion is important because l l
Physically realistic (but computationally more expensive) Enhances stability by smoothing source terms and Coal particle tracks in an eliminating local spikes in coupling to the gas phase industrial boiler 21
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Particle Dispersion: The Particle Cloud Model u u
u u u u
Track mean particle trajectory along mean velocity Assuming a 3D multi-variate Gaussian distribution about this mean track, calculate particle loading within three standard deviations Rigorously accounts for inertial and drift velocities A particle cloud is required for each particle type (e.g. initial d,ρ etc.) Particles can escape, reflect or trap (release volatiles) at walls Eliminates (single cloud) or reduces (few clouds) stochastic tracking l l
Decreased computational expense Increased stability since distributed source terms in gas phase
BUT decreased accuracy since l l
Gas phase properties (e.g. temperature) are averaged within cloud Poor prediction of large recirculation zones
22
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Particle Tracking in Unsteady Flows u u
u
Each particle advanced in time along with the flow For coupled flows using implicit time stepping, sub-iterations for the particle tracking are performed within each time step For non-coupled flows or coupled flows with explicit time stepping, particles are advanced at the end of each time step
23
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Coal/Oil Combustion Models u
Coal or oil combustion modeled by changing the modeled particle to l l
Droplet - for oil combustion Combusting particle - for coal combustion Particle Type Inert Droplet (oil) Combusting (coal)
u
Description inert/heating or cooling heating/evaporation/boiling heating; evolution of volatiles/swelling; heterogeneous surface reaction
Several devolatilization and char burnout models provided. l
Note: These models control the rate of evolution of the fuel off-gas from coal/oil particles. Reactions in the gas (continuous) phase are modeled with the PDF or finite rate combustion model. 24
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
NOx Models u
NOx consists of mostly nitric oxide (NO). l l l
u
Precursor for smog Contributes to acid rain Causes ozone depletion
Three mechanisms included in FLUENT for NOx production: l
Thermal NOx - Zeldovich mechanism (oxidation of atmospheric N) n
l
Prompt NOx - empirical mechanisms by De Soete, Williams, etc. n n
l
Contribution is in general small Significant at fuel rich zones
Fuel NOx - Empirical mechanisms by De Soete, Williams, etc. n
u
Most significant at high temperatures
Predominant in coal flames where fuel-bound nitrogen is high and temperature is generally low.
NOx reburn chemistry (V5) l
NO can be reduced in fuel rich zones by reaction with hydrocarbons 25
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Soot modeling in FLUENT u
Two soot formation models are available: l
One-step model (Khan and Greeves) n
l
Two-Step model (Tesner) n
u
u u
Single transport equation for soot mass fraction Transport equations for radical nuclei and soot mass fraction concentrations
Soot formation modeled by empirical rate constants R formation = C p f Φ n e − E / RT where, C, pf, and Φ are a model constant, fuel partial pressure and equivalence ratio, respectively Soot combustion (destruction) modeled by Magnussen model Soot affects the radiation absorption l
Enable Soot-Radiation option in the Soot panel
26
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Combustion Guidelines and Solution Strategies u
Start in 2D l l l
u
Determine applicability of model physics Mesh resolution requirements (resolve shear layers) Solution parameters and convergence settings
Boundary conditions l
Combustion is often very sensitive to inlet boundary conditions n
l
u
Correct velocity and scalar profiles can be critical
Wall heat transfer is challenging to predict; if known, specify wall temperature instead of external convection/radiation BC
Initial conditions l
l l
While steady-state solution is independent of the IC, poor IC may cause divergence due to the number and nonlinearity of the transport equations Cold flow solution, then gas combustion, then particles, then radiation For strongly swirling flows, increase the swirl gradually 27
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Combustion Guidelines and Solution Strategies (2) u
Underrelaxation Factors l
The effect of under-relaxation is highly nonlinear n n n n
l
u
Once solution is stable, attempt to increase all URFs to as close to defaults as possible (and at least 0.9 for T, P-1, swirl and species (or mixture fraction statistics))
Discretization l l
u
Decrease the diverging residual URF in increments of 0.1 Underrelax density when using the mixture fraction PDF model (0.5) Underrelax velocity for high bouyancy flows Underrelax pressure for high speed flows
Start with first order accuracy, then converge with second order to improve accuracy Second order discretization especially important for tri/tet meshes
Discrete Phase Model - to increase stability, l l
Increase number of stochastic tracks (or use particle cloud model) Decrease DPM URF and increase number of gas phase iterations per DPM 28
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Combustion Guidelines and Solution Strategies (3) u
Magnussen model l
Defaults to finite rate/eddy-dissipation (Arrhenius/Magnussen) n n
l l
u
For nonpremixed (diffusion) flames turn off finite rate Premixed flames require Arrhenius term so that reactants don’t burn prematurely
May require a high temperature initialization/patch Use temperature dependent Cp’s to reduce unrealistically high temperatures
Mixture fraction PDF model l l
l
Model of choice if underlying assumptions are valid Use adequate numbers of discrete points in look up tables to ensure accurate interpolation (no affect on run-time expense) Use beta PDF shape
29
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Combustion Guidelines and Solution Strategies (4) u
Turbulence l l
u
Start with standard k-ε model Switch to RNG k-ε , Realizable k-ε or RSM to obtain better agreement with data and/or to analyze sensitivity to the turbulence model
Judging Convergence l
l l l
Residuals should be less than 10-3 except for T, P-1 and species, which should be less than 10-6 The mass and energy flux reports must balance Monitor variables of interest (e.g. mean temperature at the outlet) Ensure contour plots of field variables are smooth, realistic and steady
30
© Fluent Inc. 2/20/01
Fluent Software Training TRN-99-003
Concluding Remarks u
FLUENT V5 is the code of choice for combustion modeling. l Outstanding set of physical models l Maximum convenience and ease of use n
l
u
u
Built-in database of mechanisms and physical properties
Grid flexibility and solution adaption
A wide range of reacting flow applications can be addressed by the combustion models in FLUENT. Make sure the physical models you are using are appropriate for your application.
31
© Fluent Inc. 2/20/01