4
Modeling Heat Exchanger by FDM and FEM in C# and Comsol Multiphysics Stepan Ozana Martin Pies Lukas Skovajsa Radovan Hajovsky VSB-Technical University of Ostrava 17. listopadu 15/2172 708 33, Ostrava-Poruba [email protected] Abstract The paper deals with modeling and simulation of the heat exchanger by means of finite difference method (FDM) and finite element method (FEM) in C# and Comsol Multiphysics environments. It refers to previously published papers on this problematic while introducing new approaches. The paper brings a short introduction of solution of above mentioned particular approaches in Comsol Multiphysics and C#. 1. Mathematical model In the basic form, the thermal model of a superheater is described by a set of the following partial differential equations (1)-(5), see [1]: 1 = 1 [ ݑ1 1 ݔ+ 1 ݐ] (1) 2 = 2 [ ݑ2 2 ݔ+ 2 ݐ] (2) 1 1 + 2 2 = ݐ(3) where 1 = ܩ ߙ1 1 , 1 = 1 ܯ1 ߙ1 1 ݑ|1 | (4) and 2 = ܩ ߙ2 2 , 2 = 2 ܯ2 ߙ2 2 ݑ|2 | (5) List of parameters: heat capacity of steam J kg 1 K 1 heat capacity of flue gas J kg 1 K 1 heat capacity of superheater’s wall material J kg 1 K 1 ܩweight of wall per unit of length in x direction kg m 1 ܮactive length of the wall m ܯsteam flow mass rate kg s 1 ܯflue gas flow mass rate kg s 1 surface of wall per unit of length in x direction for steam m Surface of wall per unit of length in x direction for flue gas m ݑVelocity of the steam in x direction m s 1 ݑVelocity of the flue gas in x direction m s 1 ߙௐଵ Heat transfer coefficient between the wall and the steam J m 2 s 1 K 1 ߙௐଶ Heat transfer coefficient between the wall and the flue gas J m 2 s 1 K 1 2. Modeling the Heat Exchanger in Comsol Multiphysics Comsol Multiphysics is first-class modeling and simulation environment for solving systems of time- dependent or stationary second order in space partial differential equations in one, two, and three dimensions. There exist predefined so-called application modes which act like templates in order to hide much of the complex details of modeling by equations. There are two forms of the partial differential equations available, the coefficient form and the general form. 2.1. Preparing the equations for Comsol Multiphysics The equations (1)-(3) can be rewritten into basic form and it determines required coefficient of PDE (6)-(8) : డ௧ + ݑడ௫ ሻ=0 (6) డ௧ + ݑడ௫ ሻ=0 (7) డ௧ ሻ− ሻ=0 (8) 2.2. Solution of the project in Comsol Multiphysics The definition and solution of the task in Comsol Multiphysics consists of the following steps: a)selecting space dimension (1D,2D,3D) b)adding physics, see Figure 1 c)selecting study type (eigenvalue, stationary, time dependent) d)defining geometry e) defining coefficients of PDE

[IEEE Factory Automation (ETFA 2011) - Toulouse, France (2011.09.5-2011.09.9)] ETFA2011 - Modeling heat exchanger by FDM and FEM in C# and Comsol Multiphysics

  • Upload
    radovan

  • View
    216

  • Download
    3

Embed Size (px)

Citation preview

Page 1: [IEEE Factory Automation (ETFA 2011) - Toulouse, France (2011.09.5-2011.09.9)] ETFA2011 - Modeling heat exchanger by FDM and FEM in C# and Comsol Multiphysics

This work-in-progress paper was presented as part of the main technical program at IEEE ETFA'2011

978-1-4577-0018-7/11/$26.00 ©2011 IEEE

Modeling Heat Exchanger by FDM and FEM in C# and Comsol Multiphysics

Stepan Ozana Martin Pies

Lukas Skovajsa Radovan Hajovsky

VSB-Technical University of Ostrava 17. listopadu 15/2172

708 33, Ostrava-Poruba [email protected]

Abstract

The paper deals with modeling and simulation of the heat exchanger by means of finite difference method (FDM) and finite element method (FEM) in C# and Comsol Multiphysics environments.

It refers to previously published papers on this problematic while introducing new approaches. The paper brings a short introduction of solution of above mentioned particular approaches in Comsol Multiphysics and C#.

1. Mathematical model

In the basic form, the thermal model of a superheater is described by a set of the following partial differential equations (1)-(5), see [1]: − 1 = 1 [ 1 1 + 1] (1) − 2 = 2 [ 2 2 + 2] (2) 1− 1 + 2− 2 = (3) where 1 = 1 1, 1 = 1 11 1| 1| (4) and 2 = 2 2, 2 = 2 22 2| 2| (5) List of parameters:

heat capacity of steam J

kg1 K1

heat capacity of flue gas J

kg1 K1

heat capacity of superheater’s wall material

J kg1 K1

weight of wall per unit of length in x direction

kg m1

active length of the wall m steam flow mass rate kg s1

flue gas flow mass rate kg s1

surface of wall per unit of length in x direction for steam

m

Surface of wall per unit of length

in x direction for flue gas m

Velocity of the steam in x

direction m s1

Velocity of the flue gas in x

direction m s1

Heat transfer coefficient between

the wall and the steam J m2

s1 K1

Heat transfer coefficient between

the wall and the flue gas J m2

s1 K1

2. Modeling the Heat Exchanger in Comsol Multiphysics

Comsol Multiphysics is first-class modeling and simulation environment for solving systems of time-dependent or stationary second order in space partial differential equations in one, two, and three dimensions. There exist predefined so-called application modes which act like templates in order to hide much of the complex details of modeling by equations. There are two forms of the partial differential equations available, the coefficient form and the general form.

2.1. Preparing the equations for Comsol Multiphysics The equations (1)-(3) can be rewritten into basic form

and it determines required coefficient of PDE (6)-(8) : + − − = 0 (6) + − − = 0 (7) − − − − = 0 (8)

2.2. Solution of the project in Comsol Multiphysics The definition and solution of the task in Comsol

Multiphysics consists of the following steps: a)selecting space dimension (1D,2D,3D) b)adding physics, see Figure 1 c)selecting study type (eigenvalue, stationary, time

dependent) d)defining geometry e) defining coefficients of PDE

Page 2: [IEEE Factory Automation (ETFA 2011) - Toulouse, France (2011.09.5-2011.09.9)] ETFA2011 - Modeling heat exchanger by FDM and FEM in C# and Comsol Multiphysics

f)meshing

Figure 1

2.3. Coeffici The task

coefficient fo

+ = where =

= = = =

If we form of equ1 00 10 0 0−

g, computing,

. Defining th

ient form of t

k defined in orm of PDE (9+ +=

0 0 00 0 00 0 0 1 0 00 1 00 0 1

= 0 0 00 0 00 0 0= 000 0= 00−

substitute thuation (9), we0 01 00 1 ∙

0

postprocessin

he physics

the PDE

this paper 9) as follows: − −

= = =000 =0 −−−

he matrices (e get:

+ 000 0−−− ∙

ng

requires use + +

=

= 0 0 00 0 00 0 0= 000

= 000 (10)

(10) into gen

000 ∙= 000 (1

e of

(9)

neral

+11) Fig

forexc

gure 2. Entm of diffechanger

tering matrierential eq

ices to defiquation for

ine general the heat

Page 3: [IEEE Factory Automation (ETFA 2011) - Toulouse, France (2011.09.5-2011.09.9)] ETFA2011 - Modeling heat exchanger by FDM and FEM in C# and Comsol Multiphysics

2.4. Plotting the results Comsol Multiphysics offers a wide range of graphical

outputs. We can display 2D plot of particular state variables over time or over x-axis or 3D graphs.

Figure 3. Steam temperature along the

x-axis of the superheater in different times

Figure 4. Output steam temperature over the time

Figure 5. Steam temperature for x=20m over

the time For example, as it can be seen from Figure 3, the

heat exchanger is being heated by hot flue gases with time. We can also display time dependencies in a certain point, see Figure 4 and Figure 5.

Figure 6. 3D steam temperature distribution

along x-axis and time by Comsol Multiphysics

3. Modeling in C#

3.1. Heat Exchanger Utility Within the frame of this project, the Heat Exchanger

Utility has been created under C#. Besides standard functions of C#, it also uses a specialized library for solving a set of ODEs (ALGLIB).

Figure 7. Heat exchanger utility

Page 4: [IEEE Factory Automation (ETFA 2011) - Toulouse, France (2011.09.5-2011.09.9)] ETFA2011 - Modeling heat exchanger by FDM and FEM in C# and Comsol Multiphysics

Based on given parameters, it computes output temperature of the steam, flue gas and the wall.

3.2. ALGLIB Package

ALGLIB [5] is a cross-platform numerical analysis and data processing library. It supports several programming languages (C++, C#, Pascal, VBA) and several operating systems (Windows, Linux, and Solaris). ALGLIB features include:

ALGLIB package implement Runge-Kutta-Cash-

Karp adaptive integrator to solve ordinary differential equations. Cash-Karp method uses six function evaluations to calculate 4-th and fifth-order accurate solutions. One of them is used to advance solution, another is used as the error estimate.

Use of ALGLIB functions regarding solution requires rewriting a set of PDEs into a set of ODES, as it is introduced in [1].

Heat Exchanger utility computes the dynamic of the heat exchanger very effectively, using powerful graphical capabilities of ZedGraph, see [6].

Figure 8. Output steam temperature

computed by Heat Exchanger utility.

4. Conclusion

The paper introduced new approaches to simulation of the dynamics of the heat exchanger described by a set of partial differential equations. Further development of the project will be devoted to low-cost solution using C# and extension of the Heat Exchanger utility.

The Comsol Multiphysics and Matlab&Simulink environment, stated in [1], [2], [3], [4] are professional tools for modeling and simulation. They are especially efficient during development and tuning of the algorithms regarding modeling and simulation of the

heat transfer in heat exchangers. However, the license policy, prices of the products and portability make are the main drawbacks to spread these solutions into commercial field.

At this moment, Heat Exchanger Utility makes it possible to enter the number of blocks connected in series. The main goal of its further development is to supply this product with graphical capabilities similar to Simulink. Blocks will be connected by the lines, and it will be possible to connect the blocks not only in series, but in arbitrary way, including feedbacks. The functionality of Heat Exchanger utility has been verified by comparison with the same model in Comsol Multiphysics.

Acknowledgment

The work was supported by the grant “Simulation of

heat exchangers with the high temperature working media and application of models for optimal control of heat exchanger”', No.102/09/1003, of the Czech Science Foundation.

References

[1] NEVŘIVA, Pavel, OŽANA, Štěpán, VILIMEC, Ladislav. The Finite Difference Method Applied for the Simulation of the Heat Exchangers Dynamics. In MASTORAKIS, Nikos E., et al. RECENT ADVANCES IN SYSTEMS : Proceedings of the 13th WSEAS International Conference on SYSTEMS. [s.l.] : WSEAS Press, 2009. s. 109-114. July 22-24, Rhodes Island, Greece. ISBN 978-960-474-097-0. ISSN 17902769.

[2] OŽANA, Štěpán, PIEŠ, Martin. Using

Simulink S-Functions with Finite Difference Method Applied for Heat Exchangers. In MASTORAKIS, Nikos E., et al. RECENT ADVANCES IN SYSTEMS : Proceedings of the 13th WSEAS International Conference on SYSTEMS. [s.l.] : WSEAS Press, 2009. s. 210-215. July 22-24, Rhodes Island, Greece. ISBN 978-960-474-097-0. ISSN 17902769.

[3] Nevriva, P., Ozana, S., Pies, M., Vilimec, L. Dynamical Model of a Power Plant Superheater. In WSEAS Transactions on Systems 9 (7), pp. 774-783. Issue 7, Volume 9, 2010, dostupný z WWW:http://www.wseas.us/e-library/transactions/systems/2010/89-878.pdf ISSN: 1109-2777

[4] Pryor, R. Multiphysics Modeling Using COMSOL: A First Principles Approach. Jones and Bartlett Publishers, 2011.

[5] http://www.alglib.net/ [6] http://sourceforge.net/projects/zedgraph/