© Acta hydrotechnica 18/28 (2000), Ljubljana ISSN 1581-0267 3 UDK: 519.61/64:532.5 UDC: 519.61/64:532.5 Izvirni znanstveni č lanek Scientific paper MATEMATIČ NO MODELIRANJE DVODIMENZIONALNIH TURBULENTNIH TOKOV V KRIVOČ RTNIH KOORDINATNIH SISTEMIH MATHEMATICAL MODELLING OF TWO-DIMENSIONAL TURBULENT FLOW IN CURVILINEAR COORDINATE SYSTEMS Slavko GERČ ER V prvem delu naloge je obravnavana matematič na izpeljava dinamič ne in kontinuitetne enač be v krivoč rtnem koordinatnem sistemu. Namen razvoja teh enač b je priprava temeljnih izhodišč za t. i. prvi pristop k reševanju enač b, ki jih uporabimo v transformirani obliki za krivoč rtni koordinatni sistem. V drugem delu naloge pa je izveden t.i. drugi pristop, enač be so rešene v netransformirani obliki.Razložena je numerič na diskretizacija dinamič ne in kontinuitetne enač be na pravokotni mreži. Razvita je teoretič na izpeljava numerič ne diskretizacije po metodi konč nih volumnov za poljubno obliko celic (trapezi), ki sestavljajo numerič no mrežo.Na tej podlagi je bil razvit rač unalniški model (PCFLOW2D-CURVE), ki omogoč a modeliranje tokov za poljubno obliko strukturirane numerič ne mreže. Narejen je rač unalniški program v CADD okolju (GEO-CURVE), ki generira numerič no mrežo za poljubno obliko reč nega korita. Naloga podaja pregled in temelje pristopa k reševanju enač b v krivoč rtnem koordinatnem sistemu. Zato je dobra matematič na podlaga za vse, ki bodo nadaljevali z razvojem modelov v krivoč rtnih koordinatah. Ključ ne besede: matematič ni modeli, dvodimenzionalno modeliranje, numerič ne metode, metoda konč nih volumnov, krivoč rtni koordinatni sistem In the first part of the thesis, a mathematical derivation of the dynamic and the mass conservation equation in curvilinear coordinate system is presented. The mean purpose of the derivation of equations is to establish the basics of the first approach for the solving of the equations which, in their transformed form, are later used in a curvilinear coordinate system. In the second part, the so- called second approach is derived, where the equations are solved in a non-transformed form.The numerical discretisation of the dynamic and mass conservation equations in the orthogonal grid is interpreted. The theoretical derivation of the numerical discretisation of equations for trapezoidal cells is described using a finite volume method. Afterwards, a new mathematical model (PCFLOW2D-CURVE) which enables the modelling of flow for any optional structure of numerical grid was developed. A new software (GEO-CURVE) in the CADD environment was developed to generate a numerical grid for any optional form of the riverbed. The thesis gives a review and basic principles of solving the equations in a curvilinear coordinate system. Therefore, it can be used as a good mathematical basis for the further development of curvilinear models. Key words: mathematical models, two-dimensional modelling, numerical methods, finite volume method, curvilinear coordinate system Gerč er, S.: Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih - Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems © Acta hydrotechnica 18/28 (2000), 3-40, Ljubljana 4 1. UVOD Gibanje vode v naravnih vodotokih je v splošnem tridimenzionalno. Transport energije, toplote in polutantov poteka v vseh smereh. Tok v vodotokih, kjer širina za red velikosti presega globino, lahko poenostavljeno obravnavamo kot dvodimenzionalnega. V matematič nem modelu lahko uporabimo osnovne enač be, ki so povpreč ene po globini toka. Kontinuitetno, dinamič no enač bo in enač be modela turbulence (dodatno pa lahko še konvekcijsko difuzijsko enač bo za širjenje polutantov ali toploto) obič ajno zapišemo v obliki parcialnih diferencialnih enač b. Te so lahko izražene v Kartezijevem koordinatnem sistemu (slika 1), ki je primeren za v naravi redke ravne kanale. Za ukrivljene struge z nepravokotno obliko je primernejša uporaba krivoč rtnega koordinatnega sistema, ki se prilagaja nepravilnim robovom rač unskega področ ja (slika 2). Ker omenjene enač be obič ajno analitič no niso rešljive, jih poskušamo reševati s pomoč jo numerič ne diskretizacije. Metod za reševanje splošnih parcialno-diferencialnih enač b je več , v glavnem pa jih delimo na: - metode konč nih elementov, - metode robnih elementov, - metode konč nih razlik. Metoda končnih razlik oziroma njena variantna metoda konč nih volumnov ima pri reševanju problemov mehanike tekoč in najdaljšo tradicijo. Zanjo je znač ilna preprostost in jasna fizikalna interpretacija. Tudi na Katedri na mehaniko tekoč in FGG se je ta metoda najbolj uveljavila kot primerna za reševanje tovrstnih enač b. Izvirna metoda konč nih volumnov temelji na pravokotnem koordinatnem sistemu, kar pomeni, da imajo celice v tlorisu vedno obliko pravokotnikov ali kvadratov (slika1). To predstavlja določ eno omejitev, saj n pr. pri modeliranju toka s prosto gladino v naravnih reč nih koritih nastopijo težave zaradi slabe prilagoditve numerič ne mreže nepravilnim robovom rač unskega področ ja. Obič ajno tovrstne težave rešujemo z zgostitvijo mreže, kar pa posledič no vpliva na veliko porabo rač unalniških zmogljivosti, tako spomina kot predvsem č asa rač unanja. 1. INTRODUCTION In natural waters, there is generally a three- dimensional flow. The transport of energy, heat and pollutants is performed in all directions. The flow in waters where the width and length are, by an order of magnitude, greater than the depth, can be considered to be two-dimensional, and, therefore, simplified into a two-dimensional flow. In the mathematical model, we can use the basic equations averaged along the depth. The mass conservation equation, dynamic equation and the turbulence closure scheme equations, as well as the advection-dispersion equation for the transport of heat or pollutants, are usually written as partial differential equations. These can be written in the Cartesian coordinate system (Figure 1), suitable for straight channels, which are very rare in nature. For non-orthogonally shaped and bend riverbeds, the use of a curvilinear coordinate system is more convenient. In this way, the non-regular borders of the computational domain are better described (Figure 2). The equations mentioned above are usually analytically insolvable; therefore, numerical discretisation is used to solve these equations. There are several methods for solving general partial differential equations, which can be mostly divided into - finite element methods, - border element methods and - finite difference methods. The finite difference method (respectively, a derivative known as the finite volume method) has the longest tradition in the solving of fluid mechanics problems. This method is characterised by its simplicity and clear physical interpretation. At the Chair of Fluid Mechanics at the University of Ljubljana, this method is mostly used as the most convenient for solving the equations mentioned above. The fundamental finite volume method is based on an orthogonal coordinate system. In the horizontal plane, all the cells are rectangles or squares (Figure 1). This represents a certain limitation, as the boundary of the computational domain with the natural river beds is very difficult to describe. Refining the grid at the boundaries, which is the method usually used to solve the problem, results in a higher consumption of computational capacities (memory, and, in particular, computational time). Gerč er, S.: Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih - Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems © Acta hydrotechnica 18/28 (2000), 3-40, Ljubljana 5 Za rešitev omenjene težave se v svetu vse bolj uveljavlja uporaba t.i. krivoč rtnega koordinatnega sistema (slika 2). V tem primeru se celice lahko zelo natanč no prilagajajo naravni obliki, kar ima za posledico možnost uporabe manjšega števila celic, s č imer privarč ujemo pri uporabi rač unalniških zmogljivosti. A better solution, which is widely used across the world, is the use of the so-called curvilinear coordinate system (Figure 2). Using this method, the grid cells can fit the natural boundaries much better. As a consequence, fewer cells can be used, and the use of computational capacities can be reduced. X Y η ξ Slika 1 . Pravokotna - koordinatna mreža. Figure 1. Orthogonal coordinate grid Slika 2. Krivoč rtna koordinatna mreža. Figure 2. Curvilinear coordinate grid. Slika 3. Primer pravokotne krivoč rtne koordinatne mreže. Figure 3. An example of orthogonal curvilinear coordinate grid. Slika 4. Primer nepravokotne krivoč rtne koordinatne mreže. Figure 4. An example of non-orthogonal curvilinear coordinate grid. Pristopa za reševanje tovrstnih težav sta dva: - prvi pristop, - drugi pristop. Pri prvem pristopu enač be najprej izrazimo v vektorski obliki, ki je neodvisna od koordinatnega sistema. Z znanimi matematič nimi izrazi za vektorske operatorje, kot so gradient, divergenca in rotor za različ ne koordinatne sisteme, lahko osnovne enač be transformiramo v koordinatno obliko za There are two approaches to solving the described problem: - the first approach - the second approach With the first approach, the equations are primarily written in a vectorised form, independent of the coordinate system. Using known mathematical expressions of vectorial operators (gradient, divergence and curl) for different coordinate systems, the basic equations are transformed into a coordinate form for the curvilinear orthogonal or general Gerč er, S.: Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih - Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems © Acta hydrotechnica 18/28 (2000), 3-40, Ljubljana 6 krivoč rtni pravokotni ali splošni nepravokotni sistem (realno območ je Φ z robom Γ v ravnini X-Y na –sliki 5) . Tega potem preslikamo v pravokotno mrežo (območ je Φ’ z robom Γ’ v ravnini ξ-η), na kateri izvedemo numerič no diskretizacijo enač b. Konč ne rezultate nato preslikamo nazaj v krivoč rtni sistem. Lastnost območ ja Φ’ je ta, da je konstruirano samo iz horizontalnih in vertikalnih č rt (slika 5). non-orthogonal system (real area Φ with the boundary Γ in the plane X-Y – see Figure 5). The equations are further transformed into an orthogonal grid (real area Φ’ with the boundary Γ’ in the plane ξ-η), where the numerical discretisation of the equations is applied. The results are finally transformed back into the curvilinear system. By definition, the boundaries of the area Φ’ consist only of horizontal and vertical lines (Figure 5). Y X Γ Φ ξ Φ Γ Slika 5. Transformacija območ ja krivoč rtne koordinatne mreže v pravokotno. Figure 5. Transformation of an area with a curvilinear coordinate grid into an orthogonal grid. Tako vsaki diskretizirani toč ki P znotraj območ ja Φ pripada transformirana toč ka P’ znotraj območ ja Φ’. V splošnem opisani postopek pomeni, da enač be, ki so izražene s spremenljivkama X-Y transformiramo tako, da jih lahko izrazimo s spremenljivkama ξ-η. Po izvedeni transformaciji koordinat in enač b lahko za njihovo rešitev uporabimo numerič ne metode, ki veljajo za pravokotna območ ja. Pri drugem pristopu uporabimo osnovne enačbe v običajnem Kartezijevem koordinatnem sistemu, vpliv nepravokotnih celic krivoč rtne mreže pa nato upoštevamo pri numerič ni diskretizaciji (slika 6). In this way, a single transformed point P’ within the area Φ’ belongs to each discrete point P within the area Φ. Generally, the described procedure shows how to transform equations expressed with the X-Y variables into equations expressed with the ξ-η variables. After the transformation of the coordinates and the equations, the same numerical methods as used for the rectangular computational domains may be used. With the second approach, the basic equations in the Cartesian coordinate system are used, and the influence of non-rectangular cells is taken into account later, during the numerical discretisation (Figure 6). Y X U V U V U V U V Slika 6. Diskretizacija osnovnih enač b v X-Y sistemu v krivoč rtni koordinatni mreži. Figure 6. Discretisation of the basic equations in X-Y system in a curvilinear coordinate grid. Gerč er, S.: Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih - Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems © Acta hydrotechnica 18/28 (2000), 3-40, Ljubljana 7 V primeru prvega pristopa se sreč amo z zahtevno matematič no transformacijo enač b in nato podobno numerič no diskretizacijo, kot jo že uporabljamo v naših obstoječ ih matematič nih modelih. V drugem primeru pa poznamo enač be v pravokotnem koordinatnem sistemu, vendar numerič na diskretizacija po metodi konč nih volumnov za poljubne oblike kontrolnih površin v naših matematič nih modelih še ni bila razvita. 2. PRVI PRISTOP 2.1 ENAČ BE DVODIMENZIONALNEGA TOKA V KARTEZIJEVEM KOORDINATNEM SISTEMU Kontinuitetno in dinamično enačbo v konzervativni obliki lahko za primer dvodimenzionalnega toka uporabimo v Kartezijevem koordinatnem sistemu. Pri izpeljavi enačb so upoštevane naslednje predpostavke (Č etina, 1 988): - stalni tok, - tok je dvodimenzionalen, hitrosti u in v so povpreč ene po globini, - napetosti zaradi trenja ob dno izrazimo z Manningovo empirič no enač bo, - ni upoštevana “rigid lid” aproksimacija, tako da so spremembe globine v primerjavi z osnovno globino lahko velike. - upoštevan je model konstantne efektivne viskoznosti ν ef . Kontinuitetna enač ba: The first approach demands a complicated mathematical transformation of the equations and numerical discretisation, similar to the discretisation which is already known from our existing mathematical models. With the second approach, we use the well- known equations in the orthogonal coordinate system, while the numerical discretisation using the finite volume method for any optional shape of the control volumes has not yet been developed and used in our mathematical models. 2. THE FIRST APPROACH 2.1 EQUATIONS OF TWO- DIMENSIONAL FLOW IN THE CARTESIAN COORDINATE SYSTEM The mass conservation equation and the dynamic equation can be used in their conservative form for describing two- dimensional flow in the Cartesian coordinate system. With the derivation of equations, the following assumptions were taken into account (Č etina, 1 988): - steady flow, - two-dimensional flow, velocities u and v are averaged along the depth, - shear stress at the bottom is taken into account by using Manning’s empirical equation, - the “rigid lid” approximation is not taken into account; thus, the surface elevations may vary significantly in comparison to the initial surface, - the constant effective viscosity model ν ef is taken into account. Mass conservation equation: 0 ) ( ) ( = + y hv x hu ∂ ∂ ∂ ∂ (1) Dinamič na enač ba: Dynamic equation: ) ( ) ( ) ( ) ( 3 4 2 2 2 2 y u h y x u h x h v u u ghn x z gh x h gh y huv x hu ef ef d ∂ ∂ υ ∂ ∂ ∂ ∂ υ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ + + + − − − = + ) ( ) ( ) ( ) ( 3 4 2 2 2 2 y v h y x v h x h v u v ghn y z gh y h gh y hv x huv ef ef d ∂ ∂ υ ∂ ∂ ∂ ∂ υ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ + + + − − − = + (2) Gerč er, S.: Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih - Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems © Acta hydrotechnica 18/28 (2000), 3-40, Ljubljana 8 2.2 ENAČ BE DVODIMENZIONALNEGA TOKA V NEPRAVOKOTNEM KRIVOČ RTNEM KOORDINATNEM SISTEMU Za izpeljavo enačb potrebujemo matematič ne osnove, ki so sorazmerno obširne in v literaturi zelo težko dosegljive. Ravno razlaga matematič ne izpeljave v tej nalogi naj bi bila temeljno izhodišč e pri prihodnjem razvoju matematič nih modelov, ki bi temeljili na krivoč rtnih koordinatnih sistemih. 2.2.1 Fizikalna interpretacija zveze krivoč rtnega in Katerzijevega koordinatnega sistema Krivoč rtni koordinatni sistem predstavlja osi ξ-η, ki v splošnem med seboj nista pravokotni. Poljuben vektor F ! lahko razstavimo na komponenti F ξ in F η v krivoč rtnem koordinatnem sistemu oziroma F x in F y v Kartezijevem koordinatnem sistemu (slika 7). 2.2 THE EQUATIONS OF TWO- DIMENSIONAL FLOW IN THE NON-ORTHOGONAL CURVILINEAR COORDINATE SYSTEM To derive the equations, a relatively extensive mathematical background is needed, and this is very difficult to find in literature. The explanation of the mathematical derivation in the thesis should be used as the fundamental starting point in the future development of the mathematical models, based on curvilinear coordinates. 2.2.1 Physical interpretation of the connection between the curvilinear and Cartesian coordinate system The curvilinear coordinate system is described by axes ξ-η, which, in general, are not orthogonal. Any optional vector F ! can be partitioned into components F ξ in F η in a curvilinear coordinate system and into components F x in F y in the Cartesian coordinate system (Figure 7). X φ η F Y α ξ F Y F F F η ξ X γ ex ey e eξ η cos( x F α ) sin( F α ) y cos( Fη γ ) γ Slika 7. Vektor F v krivoč rtnem in Katerzijevem koordinatnem sistemu. Figure 7. Vector F in a curvilinear and in the Cartesian coordinate system. F ! = F x x e ! + F y y e ! = F ξ ξ e ! + F η η e ! (3) Gerč er, S.: Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih - Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems © Acta hydrotechnica 18/28 (2000), 3-40, Ljubljana 9 Zanima nas zveza med komponentami vektorja F ! v Kartezijevem in krivoč rtnem kordinatnem sistemu. Zvezo lahko zapišemo v obliki: We would like to express the connection between the vectorial components in both coordinate systems. This connection can be written as: F x =C 1 F ξ +C 2 F η (4) F y =C 3 F ξ +C 4 F η (5) in še obratno: and in the opposite way: F ξ =C 5 F x +C 6 F y (6) F η =C 7 F x +C 8 F y (7) Č lene po krajši izpeljavi lahko zapišemo v obliki preglednice (preglednica 1): After a short derivation, all the coefficients can be written in a form of table (Table 1): Preglednica 1 . Koeficienti zveze Katerzijevih in krivoč rtnih komponent poljubnega vektorja. Table 1. Transformation coefficients between the Cartesian and the curvilinear components of an optional vector. C i C i =f(C j ) C i =f(α,Φ) C i =f(α,Φ=90°) C 1 7 6 8 5 8 C C - C C C cos(α) cos(α) C 2 7 6 8 5 6 C C - C C C - cos(α+Φ)- s i n ( α) C 3 7 6 8 5 7 C C - C C C - sin(α)s i n ( α) C 4 7 6 8 5 5 C C - C C C sin(α+Φ) cos(α) C 5 3 2 4 1 4 C C - C C C cos(α) +         Φ Φ ) ( sin ) )cos( sin(α cos(α) C 6 3 2 4 1 2 C C - C C C - sin(α) -         Φ Φ ) ( sin ) )cos( cos(α sin(α) C 7 3 2 4 1 3 C C - C C C -         Φ) sin( ) sin( - α -sin(α) C 8 3 2 4 1 1 C C - C C C         Φ) sin( ) cos(α cos(α) Gerč er, S.: Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih - Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems © Acta hydrotechnica 18/28 (2000), 3-40, Ljubljana 10 2.2.2 Uporaba matematič ne interpretacije za potrebe 2D-matematič nega modela Matematič no interpretacijo smo uporabili z namenom izpeljave matematič nih operatorjev, kot so gradient in divergenca v krivoč rtnem koordinatnem sistemu. Le te smo v nadaljevanju uporabili za transformacijo dinamič ne in kontinuitetne enač be. Gradient skalarnega polja: 2.2.2 The use of the mathematical interpretation in a 2D mathematical model The mathematical interpretation was used to derive the mathematical operators, such as gradient and divergence, in curvilinear coordinate system. These operators were further used for transformation of the mass conservation and the dynamic equation. Gradient of a scalar field: grad(u)=∇(u)= y x e y u e x u u ! ! ∂ ∂ + ∂ ∂ = Χ ∂ ∂ = η ξ α α e e ! ! 2 2 1 1 H H + = = η ξ ξ η η ξ e e 12 11 * 22 12 22 * 11 ! !         ∂ ∂ − ∂ ∂ +         ∂ ∂ − ∂ ∂ u q u q q q u q u q q q (8) Za poseben primer pravokotnega krivoč rtnega koordinatnega sistema velja: In a special case – orthogonal curvilinear coordinate system – the equation can be written as: grad(u)=∇(u)= y x e y u e x u u ! ! ∂ ∂ + ∂ ∂ = Χ ∂ ∂ = η ξ α α e e ! ! 2 2 1 1 H H + = η ξ η ξ e 1 e 1 2 1 ! !         ∂ ∂ +         ∂ ∂ u H u H (9) Definicija prvega odvoda. Zanimala nas je zveza: Definition of the first derivative. The expression ) (Q f u = Χ ∂ ∂ oziroma v razviti obliki: or, in its developed form ) , ( η ξ f x u = ∂ ∂ , ) , ( η ξ f y u = ∂ ∂ Rezultat izpeljave lahko predstavimo v obliki: can be derived into         ∂ ∂ ∂ ∂ − ∂ ∂ ∂ ∂ = ∂ ∂ η ξ ξ η u y u y J x u 1 (10) kjer je where         ∂ ∂ ∂ ∂ − ∂ ∂ ∂ ∂ = − = = ξ η η ξ y x y x q q q q J 12 22 11 * (11) Gerč er, S.: Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih - Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems © Acta hydrotechnica 18/28 (2000), 3-40, Ljubljana 11 V posebnem primeru pravokotne krivoč rtne baze se izrazi poenostavijo in enač ba dobi naslednjo obliko: The expressions are simplified in the special case of the orthogonal curvilinear base. The equation can be written in the following form:         ∂ ∂ ∂ ∂ − ∂ ∂ ∂ ∂ = ∂ ∂ η ξ ξ η u y u y H H x u 2 1 1 (12) Definicija drugega odvoda: Definition of the second derivative: ) (Χ = Χ ∂       Χ ∂ ∂ ∂ f u (13) ali še v razviti obliki: or in its developed form: ) , ( η ξ f x x u = ∂       ∂ ∂ ∂ , ) , ( η ξ f y y u = ∂         ∂ ∂ ∂ (14) Do zveze lahko pridemo preko enač b prvega odvoda The connection can be found using the equations of the first derivative: = ∂       ∂ ∂ ∂ x x u x x u ∂ ∂ ∂ 2 = +         ∂ ∂ ∂         ∂ ∂ + ∂ ∂ ∂ ∂ ∂ ∂ ∂ − ∂ ∂ ∂         ∂ ∂ η η ξ η ξ η ξ ξ ξ η u y u y y u y J 2 2 2 2 2 2 2 1 +             ∂ ∂ ∂ ∂ − ∂ ∂ ∂ ∂           ∂ ∂ ∂         ∂ ∂ + ∂ ∂ ∂ ∂ ∂ ∂ ∂ − ∂ ∂ ∂         ∂ ∂ η ξ ξ η η η ξ η ξ η ξ ξ ξ η u x u x y y y y y y y J 2 2 2 2 2 3 2 1             ∂ ∂ ∂ ∂ − ∂ ∂ ∂ ∂           ∂ ∂ ∂         ∂ ∂ + ∂ ∂ ∂ ∂ ∂ ∂ ∂ − ∂ ∂ ∂         ∂ ∂ ξ η η ξ η η ξ η ξ η ξ ξ ξ η u y u y x y x y y x y 2 2 2 2 2 2 Gerč er, S.: Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih - Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems © Acta hydrotechnica 18/28 (2000), 3-40, Ljubljana 12 2.2.3 Zveza med koeficienti fizikalne in matematič ne interpretacije Primerjavo koeficientov matematič ne in fizikalne interpretacije podajamo v preglednici 2: 2.2.3 The connection between the coefficients of the physical and the mathematical interpretation The comparison between the coefficients of the mathematical and the physical interpretation is given in Table 2: Preglednica 2. Fizikalni koeficienti, izraženi v krivoč rtnem koordinatnem sistemu. Table 2. Coefficients of the physical interpretation in a curvilinear coordinate system. C i C i =f(C j ) C i =f(α,Φ) C 1 7 6 8 5 8 C C - C C C η ∂ ∂y J H 1 C 2 7 6 8 5 6 C C - C C C - ξ ∂ ∂ − y J H 2 C 3 7 6 8 5 7 C C - C C C - η ∂ ∂ − x J H 1 C 4 7 6 8 5 5 C C - C C C ξ ∂ ∂x J H 2 C 5 3 2 4 1 4 C C - C C C ξ ∂ ∂x 1 H 1 C 6 3 2 4 1 2 C C - C C C - ξ ∂ ∂y 1 H 1 C 7 3 2 4 1 3 C C - C C C - η ∂ ∂x 2 H 1 C 8 3 2 4 1 1 C C - C C C η ∂ ∂y 2 H 1 kjer veljajo še naslednje zveze: where the following equations are valid:         ∂ ∂ ∂ ∂ − ∂ ∂ ∂ ∂ = − = = ξ η η ξ y x y x q q q q J 1 2 22 11 * 2 2 1 H         ∂ ∂ +         ∂ ∂ = ξ ξ y x 2 2 2 H         ∂ ∂ +         ∂ ∂ = η η y x Gerč er, S.: Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih - Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems © Acta hydrotechnica 18/28 (2000), 3-40, Ljubljana 13 2.2.4 Kontinuitetna enač ba v krivoč rtnem koordinatnem sistemu Kontinuitetna enačba 2D modela v Katerzijevem koordinatnem sistemu se glasi (Č etina, 1 988): 2.2.4 Mass conservation equation in the curvilinear coordinate system The mass conservation equation of the 2D model in the Cartesian coordinate system is given as (Č etina, 1 988): 0 ) v ( = ! h div ⇒ 0 ) ( ) ( = + y hv x hu ∂ ∂ ∂ ∂ (15) kjer je vektor hitrosti v ! enak: where the velocity vector is equal to η ξ ξ e v e u e v e u v y y x x ! ! ! ! ! + = + = (16) u x = C 1 u ξ + C 2 v η (17) v y = C 3 u ξ + C 4 v η (18) Da lahko zapišemo kontinuitetno enač bo v krivočrtnem koordinatnem sistemu ξ-η, moramo upoštevati enačbo transformacije prvega odvoda: To transform the mass conservation equation into the curvilinear coordinate system ξ-η, the equation of transformation of the first derivative must be accounted for: 0 ) ( ) ( 1 ) ( ) ( 1 =         ∂ ∂ ∂ ∂ + ∂ ∂ ∂ ∂ − +         ∂ ∂ ∂ ∂ − ∂ ∂ ∂ ∂ η ξ ξ η η ξ ξ η vh x vh x J uh y uh y J (19) Konč na oblika kontinuitetne enač be dobi naslednjo obliko: Finally, the mass conservation equation is written as: () ()() () () ()() () 0 C 1 1 4 3 4 3 2 1 2 1 =         + ∂ ∂ ∂ ∂ + + ∂ ∂ ∂ ∂ − +         + ∂ ∂ ∂ ∂ − + ∂ ∂ ∂ ∂ η ξ η ξ η ξ η ξ η ξ ξ η η ξ ξ η v C u h x v C u C h x J v C u C h y v C u C h y J (20) 2.2.5 Kontinuitetna enač ba v pravokonem krivoč rtnem koordinatnem sistemu Ob upoštevanju poenostavitev dobi splošna kontinuitetna enačba v pravokotnem krivoč rtnem koordinanem sistemu naslednjo obliko: 2.2.5 The mass conservation equation in an orthogonal curvilinear coordinate system Taking into account the simplifications, the general mass conservation equation in the orthogonal curvilinear coordinate system gets the following form: ()() 0 1 1 2 =       ∂ ∂ + ∂ ∂ η ξ η ξ hv H hu H J Ta enač ba je dobro poznana iz literature (Č etina, 1 983). Zato lahko sklepamo, da je bila izpeljava kontinuitetne enačbe (20) v nepravokotnem krivočrtnem koordinatnem sistemu enač ba pravilna. This equation is well known from literature (Č etina, 1 983). Therefore, the derivation of the mass conservation equation (20) in the non- orthogonal curvilinear coordinate system may be considered as correct. Gerč er, S.: Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih - Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems © Acta hydrotechnica 18/28 (2000), 3-40, Ljubljana 14 2.2.5 Dinamič na enač ba v krivoč rtnem koordinatnem sistemu Osnovna dinamič na enač ba v vektorski obliki se za primer stacionarnega stanja in nestisljive tekočine in ob upoštevanju turbulentnega modela konstantne efektivne viskoznosti ν ef poenostavi v: 2.2.5 Dynamic equation in a curvilinear coordinate system In the case of steady flow, non- compressible fluid and taking into account the constant effective viscosity turbulence model ν ef , the basic dynamic equation in vectorial form is simplified into: v ) p ( grad 1 - F v )) v ( ( ! ! ! ! ∆ + = ef grad ν ρ (21) Prvi č len na levi strani dinamič ne enač be predstavlja konvekcijski pospešek ( K ! ), prvi č len na desni strani vpliv masnih in tlač nih sil ( M ! ), zadnji č len na desni strani pa vpliv sil efektivne viskoznosti (C ! ) Za zapis dinamične enačbe v nepravokotnem krivočrtnem koordinatnem sistemu ξ-η smo vsak č len enač be posebej transformirali na podlagi pripravljenih izrazov, opisanih in izpeljanih v predhodnih poglavjih. Konvekcijski č len K ! The first term on the left side of the equation represents the advective acceleration ( K ! ); the first term on the right side represents the influence of mass and pressure force ( M ! ); and the last term expresses the influence of effective viscosity ( C ! ). To write the dynamic equation in the non- orthogonal curvilinear coordinate system ξ-η, each term of the equation was transformed separately, on the basis of the previously written equations. Advective term K ! y v hu x hu K y x x x ∂ ∂ + ∂ ∂ = ) ( ) ( 2 , y hv x v hu K y y x y ∂ ∂ + ∂ ∂ = ) ( ) ( 2 se transformira v: is transformed into: () ()() () ()       − + ∂ ∂ ∂ ∂ − + ∂ ∂ ∂ ∂ = η ξ η ξ η ξ ξ η ξ ξ η v C u C v C u C h y v C u C h y J C K 4 3 2 1 2 2 1 5 1 + () () () () ()       − ∂ ∂ ∂ ∂ + + + ∂ ∂ ∂ ∂ − 2 4 3 4 3 2 1 6 1 C η ξ η ξ η ξ η ξ ξ η v C u C h x v C u C v C u C h x J (22) () ()() () ()       − + ∂ ∂ ∂ ∂ − + ∂ ∂ ∂ ∂ = η ξ η ξ η ξ η η ξ ξ η v C u C v C u C h y v C u C h y J C K 4 3 2 1 2 2 1 7 1 + () () () () ()       − ∂ ∂ ∂ ∂ + + + ∂ ∂ ∂ ∂ − 2 4 3 4 3 2 1 8 1 C η ξ η ξ η ξ η ξ ξ η v C u C h x v C u C v C u C h x J (23) Č len masnih in tlač nih sil M ! Mass and pressure force term M ! 3 4 2 2 2 ) ( h v u u ghn z h x gh M y x x d x + − + ∂ ∂ − = , 3 4 2 2 2 ) ( h v u v ghn z h y gh M y x y d y + − + ∂ ∂ − = Gerč er, S.: Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih - Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems © Acta hydrotechnica 18/28 (2000), 3-40, Ljubljana 15 Ob upoštevanju koeficientov C i iz preglednic 1 in 2 ter izrazov za transformacijo prvega odvoda dobimo za smer ξ: Taking into account the coefficients C i from Tables 1 and 2, and the transformation expressions of the first derivative, for the ξ direction we get: M ξ =            ∂ + ∂ ∂ ∂ − ∂ + ∂ ∂ ∂ − + η ξ ξ η ) ( ) ( 1 5 b b z h y z h y J gh C + () () ()      + + + + − 3 4 2 4 3 2 2 1 2 1 2 h v C u C v C u C v C u C ghn g η ξ η ξ η ξ +            ∂ + ∂ ∂ ∂ + ∂ + ∂ ∂ ∂ − − + η ξ ξ η ) ( ) ( 1 6 d d z h x z h x J gh C + () () ()      + + + + − 3 4 2 4 3 2 2 1 4 3 2 h v C u C v C u C v C u C ghn η ξ η ξ η ξ (24) Podobno dobimo še za komponento vektorja smeri η: Similarly, the component of the vector in the η direction is: Mη =            ∂ + ∂ ∂ ∂ − ∂ + ∂ ∂ ∂ − + η ξ ξ η ) ( ) ( 1 7 d d z h y z h y J gh C + () () ()      + + + + − 3 4 2 4 3 2 2 1 2 1 2 h v C u C v C u C v C u C ghn η ξ η ξ η ξ +            ∂ + ∂ ∂ ∂ + ∂ + ∂ ∂ ∂ − − + η ξ ξ η ) ( ) ( 1 8 d d z h x z h x J gh C + () () ()      + + + + − 3 4 2 4 3 2 2 1 4 3 2 h v C u C v C u C v C u C ghn η ξ η ξ η ξ (25) Č len viskoznih sil C ! Viscous force term C !         ∂ ∂ ∂ ∂ +       ∂ ∂ ∂ ∂ = y u h y x u h x C x ef x x ν ν ef ,         ∂ ∂ ∂ ∂ +         ∂ ∂ ∂ ∂ = y v h y x v h x C y ef y y ν ν ef Gerč er, S.: Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih - Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems © Acta hydrotechnica 18/28 (2000), 3-40, Ljubljana 16 se transformira v: is transformed to:                                                                                                       ∂ + ∂ ∂ ∂ − ∂ + ∂ ∂ ∂           ∂ ∂ ∂         ∂ ∂ + ∂ ∂ ∂ ∂ ∂ ∂ ∂ − ∂ ∂ ∂         ∂ ∂ +             ∂ + ∂ ∂ ∂ − ∂ + ∂ ∂ ∂           ∂ ∂ ∂         ∂ ∂ + ∂ ∂ ∂ ∂ ∂ ∂ ∂ − ∂ ∂ ∂         ∂ ∂ +         ∂ ∂ + ∂         ∂ ∂ + ∂ ∂ + ∂ ∂ ∂ ∂ ∂ − ∂ ∂ + ∂         ∂ ∂ +         ∂ + ∂ ∂ ∂ + ∂ + ∂ ∂ ∂ − ∂ ∂ + +                                       ∂ + ∂ ∂ ∂ − ∂ + ∂ ∂ ∂           ∂ ∂ ∂         ∂ ∂ + ∂ ∂ ∂ ∂ ∂ ∂ ∂ − ∂ ∂ ∂         ∂ ∂ +             ∂ + ∂ ∂ ∂ − ∂ + ∂ ∂ ∂           ∂ ∂ ∂         ∂ ∂ + ∂ ∂ ∂ ∂ ∂ ∂ ∂ − ∂ ∂ ∂         ∂ ∂ +         ∂ ∂ + ∂         ∂ ∂ + ∂ ∂ ∂ ∂ ∂ ∂ ∂ − ∂ ∂ + ∂         ∂ ∂ +         ∂ + ∂ ∂ ∂ − ∂ + ∂ ∂ ∂ ∂ ∂ = ξ η η ξ η η ξ η ξ η ξ ξ ξ η η ξ ξ η η η ξ η ξ η ξ ξ ξ η η η ξ η ξ ξ η ξ ξ η η ξ ξ η ξ η η ξ η η ξ η ξ η ξ ξ ξ η η ξ ξ η η η ξ η ξ η ξ ξ ξ η η η ξ η ξ η ξ ξ ξ η η ξ ξ η ν η ξ η ξ η ξ η ξ η ξ η ξ η ξ η ξ η ξ η ξ η ξ η ξ η ξ η ξ η ξ η ξ η ξ ξ ) ( ) ( 2 ) ( ) ( 2 1 ) ( ) ( 2 ) ( 1 ) ( ) ( 1 ) ( ) ( 2 ) ( ) ( 2 1 ) ( 2 ) ( 1 ) ( ) ( 1 2 1 2 1 2 2 2 2 2 2 1 2 1 2 2 2 2 2 3 2 1 2 2 2 1 2 2 1 2 2 2 2 1 2 1 2 1 2 1 2 2 2 2 2 2 1 2 1 2 2 2 2 2 3 2 1 2 2 2 2 1 2 2 2 2 1 2 1 v C u C y v C u C y x x x x x x x v C u C x v C u C x y y y y y y y J v C u C x v C u C x x v C u C x J h v C u C x v C u C x J y h v C u C y v C u C y x y x y y x y v C u C x v C u C x y y y y y y y J v C u C y u y y v C u C y J h v C u C y v C u C y J x h C ef (26) in and                                                                                                       ∂ + ∂ ∂ ∂ − ∂ + ∂ ∂ ∂           ∂ ∂ ∂         ∂ ∂ + ∂ ∂ ∂ ∂ ∂ ∂ ∂ − ∂ ∂ ∂         ∂ ∂ +             ∂ + ∂ ∂ ∂ − ∂ + ∂ ∂ ∂           ∂ ∂ ∂         ∂ ∂ + ∂ ∂ ∂ ∂ ∂ ∂ ∂ − ∂ ∂ ∂         ∂ ∂ +         ∂ ∂ + ∂         ∂ ∂ + ∂ ∂ + ∂ ∂ ∂ ∂ ∂ − ∂ ∂ + ∂         ∂ ∂ +         ∂ + ∂ ∂ ∂ + ∂ + ∂ ∂ ∂ − ∂ ∂ + +                                       ∂ + ∂ ∂ ∂ − ∂ + ∂ ∂ ∂           ∂ ∂ ∂         ∂ ∂ + ∂ ∂ ∂ ∂ ∂ ∂ ∂ − ∂ ∂ ∂         ∂ ∂ +             ∂ + ∂ ∂ ∂ − ∂ + ∂ ∂ ∂           ∂ ∂ ∂         ∂ ∂ + ∂ ∂ ∂ ∂ ∂ ∂ ∂ − ∂ ∂ ∂         ∂ ∂ +         ∂ ∂ + ∂         ∂ ∂ + ∂ ∂ ∂ ∂ ∂ ∂ ∂ − ∂ ∂ + ∂         ∂ ∂ +         ∂ + ∂ ∂ ∂ − ∂ + ∂ ∂ ∂ ∂ ∂ = ξ η η ξ η η ξ η ξ η ξ ξ ξ η η ξ ξ η η η ξ η ξ η ξ ξ ξ η η η ξ η ξ ξ η ξ ξ η η ξ ξ η ξ η η ξ η η ξ η ξ η ξ ξ ξ η η ξ ξ η η η ξ η ξ η ξ ξ ξ η η η ξ η ξ η ξ ξ ξ η η ξ ξ η ν η ξ η ξ η ξ η ξ η ξ η ξ η ξ η ξ η ξ η ξ η η ξ η ξ η ξ η ξ η ξ η ξ η ξ η ) ( ) ( 2 ) ( ) ( 2 1 ) ( ) ( 2 ) ( 1 ) ( ) ( 1 ) ( ) ( 2 ) ( ) ( 2 1 ) 2 ) ( 1 ) ( ) ( 1 4 3 4 3 2 2 2 2 2 4 3 4 3 2 2 2 2 2 3 4 3 2 2 4 3 2 4 3 2 2 2 4 3 4 3 4 3 4 3 2 2 2 2 2 4 3 4 3 2 2 2 2 2 3 4 3 2 2 2 4 3 2 2 2 4 3 4 3 v C u C y v C u C y x x x x x x x v C u C x v C u C x y y y y y y y J v C u C x v C u C x x v C u C x J h v C u C x v C u C x J y h v C u C y v C u C y x y x y y x y v C u C x v C u C x y y y y y y y J v C u C y u y y v C u C y J h v C u C y v C u C y J x h C ef (27) Gerč er, S.: Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih - Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems © Acta hydrotechnica 18/28 (2000), 3-40, Ljubljana 17 Konč no obliko dimamič e enač be lahko zapišemo v obliki: Finally, the dynamic equation can be given as: 0 = − − ξ ξ ξ C M K 0 = − − η η η C M K 2.2.6 Dinamič na enač ba v pravokotnem krivoč rtnem koordinatnem sistemu Ker je izpeljava dinamič ne enač be za primer pravokotne krivočrtne koordinatne mreže iz splošne enač be precej obsežna, je bila v Gerč er (2000) predstavljena samo izpeljava njenih č lenov, ki jih lahko primerjamo z rezultati iz literature (Tan, 1998). 3. DRUGI PRISTOP 3.1 METODA KONČ NIH VOLUMNOV 3.1.1 Splošno o metodi Vsaka numerična rešitev diferencialnih enač b je v bistvu niz števil v diskretnih toč kah računskega področja, iz katerih lahko ugotovimo razporeditev odvisne spremenljivke Φ. Računsko področje diskretiziramo in izrazimo diferencialne enač be z vrednostmi odvisne spremenljivke Φ v diskretnih toč kah. Tako dobimo sistem algebrajskih enač b (diskretizirane enač be). Pri diskretizaciji lahko uporabimo pravokotni ali splošni krivoč rtni koordinatni sistem. Glavna pomanjkljivost prvega je v slabem prilagajanju nepravilnim geometrijskim robovom rač unskega območ ja. Zato je treba uporabiti zgošč evanje mreže konč nih volumnov. Posledica tega pa je velika poraba rač unalniških zmogljivosti, predvsem č asa rač unanja. Uporaba metode tudi na krivoč rtni mreži, je eden glavnih ciljev te naloge. Zmožnost prilagajanja “naravnim oblikam”, ki nastopajo v inženirski praksi, pripomore k znatnemu zmanjšanju potrebnega č asa rač unanja. Podrobnosti diskretizacijskega postopka in nač ina reševanja sistema algebrajskih enač b najdemo v (Patankar, 1980) za primer pravokotnega Katerzijevega koordinatnega sistema. 2.2.6 Dynamic equation in an orthogonal curvilinear coordinate system Derivation of the dynamic equation in the case of the orthogonal curvilinear coordinate system from the general equation is relatively extensive. Therefore, only derivation of the individual terms which can be compared to the results found in the literature (Tan, 1998) is given in Gerč er (2000). 3. THE SECOND APPROACH 3.1 FINITE VOLUME METHOD 3.1.1 General description of the method Any numerical solution of differential equations is represented as a series of numbers in discrete points of the computational area, from which the distribution of the dependent variable Φ is evident. Thus we get a system of algebraic equations (discretised equations). An orthogonal or a general curvilinear coordinate system can be used for the discretisation. The main deficiency of the first one is in the less precise fitting of the numerical grid to natural boundaries of the computational domain. Therefore, the grid of control volumes must be refined, and, as a consequence, the consumption of computational capacities (in particular the computational time) is much higher. One of the main goals of the research was also to use the method in a curvilinear grid. The possibility of the precise fitting to natural boundaries which are common in an engineering praxis, helps to decrease the computational time significantly. Details about the discretisation procedure and the methods of solving of the algebraic equations system for the case of the orthogonal Cartesian system can be found in (Patankar, 1980). Gerč er, S.: Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih - Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems © Acta hydrotechnica 18/28 (2000), 3-40, Ljubljana 18 Ker je postopek za pravokotno mrežo hkrati tudi podlaga za nepravokotno mrežo, so v nadaljevanju najprej podane podrobnosti postopka za Kartezijev, nato pa še za splošni krivoč rtni koordinatni sistem. Namen obeh izpeljav je naslednji : 1. Natančno spoznati metodo za primer pravokotne mreže. Temelji metode konč nih volumnov so sicer zelo jasno razloženi v literaturi (Č etina, 1 983; Patankar, 1 980) vendar ne dovolj natanč no, da bi nam neposredno lahko to koristilo pri izpeljavi metode za primer krivoč rtne koordinatne mreže. Za primere pravokotne mreže je bil razvit matematični model TEACH (Gosman, 1976), ki je bil kasneje še dopolnjen na KMTe FGG z naslednjimi izpopolnitvami: - mogoč a je uporaba poljubne geometrije, ki jo prekriva pravokotna numerič na mreža - vgrajen je globinsko povpreč ni model - mogoč a je simulacija nestalnega toka. Na podlagi dopolnjene verzije modela je bil na KMTe FGG razvit rač unalniški program PCFLOW2D, ki se uporablja za reševanje dvodimenzionalnih turbulentnih tokov. Vendar pa, razen v izvornih kodah rač unalniških programov TEACH oziroma PCFLOW2D, v literaturi ni mogoč e najti vseh podrobnosti postopka diskretizacije, ki jih potrebujemo za izpeljavo te metode tudi na nepravokotni krivoč rtni mreži. Zato je najprej podrobno opisan postopek za pravokotno mrežo. 2. Izvirnost izpeljave v krivoč rtnem koordinatnem sistemu. Izpeljava metode konč nih volumnov za primer krivoč rtne mreže ni prevzeta iz literature, temveč je izpeljana v okviru te naloge. Postopki so prikazani zelo podrobno, zato da bi bili lahko kasneje podlaga za morebitne spremembe in dopolnitve. The procedure for the orthogonal grid, at the same time, represents the basics for the non-orthogonal grid. Therefore, in the continuation, the details about the procedure for the Cartesian coordinate system are given first, followed by the procedure for a general curvilinear coordinate system. The main purpose of both derivations is: 1. To perceive the method for the case of the orthogonal grid as well as possible. The basics of the finite volume method are explained clearly in literature (Č etina, 1 983; Patankar, 1980). However, the explanation is not exact enough to use directly in the derivation of the method for the situation of the curvilinear coordinate grid. For different cases of the orthogonal grid, the mathematical model TEACH (Gosman, 1976) was developed, and later upgraded, at the Chair of Fluid Mechanics, with the following improvements: − any optional geometry data which can be covered by an orthogonal numerical grid may be used, − a depth averaged model is included, − simulation of unsteady flow is possible. On the basis of the upgraded version of the TEACH model a new mathematical model PCFLOW2D was developed at the Chair of Fluid Mechanics at the University of Ljubljana. The model is used for the computation of two-dimensional turbulent flows. Unfortunately, it was not possible to find, in the literature, all the necessary details of the discretisation procedure which were needed to derive the method in the non-orthogonal curvilinear grid, except for the source code of both computer programmes. Thus, the procedure in the orthogonal grid is described first. 2. Originality of the derivation in curvilinear coordinate system. The derivation of the finite volume method in a curvilinear grid was not adopted from literature; a completely new derivation has been performed within the framework of the thesis. Therefore, all procedures are given in detail, to represent a quality foundation for further changes and upgrades of the method. Gerč er, S.: Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih - Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems © Acta hydrotechnica 18/28 (2000), 3-40, Ljubljana 19 3. Kontrola izpeljave. Temeljna kontrola izpeljave na krivoč rtni koordinatni mreži bo uporaba primera, ko je krivoč rtna mreža enaka pravokotni. V tem primeru se morajo enač be poenostaviti v znano obliko enač b za pravokotne mreže. Glavni koraki postopka diskretizacije so naslednji: A. Priprava računske mreže: rač unsko področ je razdelimo na določ eno število celic t.i. konč nih volumnov, ki imajo v središč u diskretno toč ko (P). B. Integracija enač b: integriramo diferencialne enačbe znotraj konč nih volumnov. Rezultat so diskretizirane algebrajske enačbe za vsak kontrolni volumen posebej. Te predstavljajo iste fizikalne zakonitosti na območ ju kontrolnega volumna kot diferencialne enač be v kontinuumu. C. Reševanje diskretiziranih enač b: z rešitvijo diskretiziranih enačb dobimo konč ne vrednosti odvisne spremenljivke Φ. 3. Verification of the derivation. The case where a curvilinear and orthogonal grid were equal was used as a general verification of the model. In this case, the equations must be simplified into the known forms that are used with the orthogonal grid. The main steps in the discretisation procedure were the following: A. Arrangement of the computation grid: the computational domain is divided into a number of cells, the so-called finite volumes. Each control volume has a discrete point P in its centre. B. Integration of the equations: differential equations are integrated within the finite volume. As a result, we get discretised algebraic equations for each finite volume. These equations represent the same physical phenomena within the control volume, as they are represented by the differential equations for the whole continuum. C. Solving of the discretised equations: the final results of solved discretised equations are values of the dependent variable Φ. 3.1 .2 Diskretizacija dinamič ne enač be za smer X 3.1.2 Discretisation of the dynamic equation in the X direction Srednje toč ke - Midpoints Diskretne toč ke - Discrete points Y X P N W E NW SW NE S SE WW n=c nw=d s=b sw=a w n nw n s sw ww nn s ss i i+1 i+2 i-1 i-2 j+2 j+1 j j-1 j-2 Slika 8. Krivoč rtna mreža: kontrolne površine za hitrosti u - CSu. Figure 8. Curvilinear grid: control areas for velocities u - CSu. Gerč er, S.: Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih - Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems © Acta hydrotechnica 18/28 (2000), 3-40, Ljubljana 20 Želimo diskretizirati enač bo: We would like to discretise the following equation: 3 4 2 2 2 2 ) ( ) ( ) ( ) ( h v u u ghn x z gh x h gh y u h y x u h x y huv x hu b ef ef + − − − = − − + ∂ ∂ ∂ ∂ ∂ ∂ υ ∂ ∂ ∂ ∂ υ ∂ ∂ ∂ ∂ ∂ ∂ (28) Integrirajmo dinamič no enač bo po kontrolni površini Csu (slika 8) in uporabimo Greenov teorem o pretvorbi ploskovnega integrala na krivuljnega. Rezultat je algebrajska enač ba v obliki: If we integrate the dynamic equation along the control area Csu (Figure 8) and use Greene’s theorem to transform the surface integral to the linear one, we get the following algebraic equation as a result: uw s s s n n n ww W e P w w S u a u a u a u a a u + + + + = - D (29) Kjer posamezne č lene enač be izrazimo v obliki preglednice (za č lene a i upoštevamo hibridno shemo, preglednica 3): Individual terms of equation 29 are described in Table 3 for the hybrid numerical scheme: Preglednica 3. Koeficienti diskretizirane dinamič ne enač be za smer X na krivoč rtni mreži. Table 3. Coefficients of the discretised dynamic equation for the X direction in curvilinear grid. č leni / terms a konvekcijski č leni / convective terms F 2 , 2 2 P P P P F D F MAX a −         = () () () ()       − + − − + = S N w w e e S N w w e e P x x v h v h y y u h u h F 4 1 2 , 2 4 W W W W F D F MAX a +         = () () () ()       − + − − + − = nw sw w w ww ww nw sw w w ww ww W x x v h v h y y u h u h F 4 1 2 , 2 3 n n n n F D F MAX a −         = () () () ()       − − + + − − − + + = P N W NW nw nw n n P N W NW nw nw n n n x x x x v h v h y y y y u h u h F 4 1 2 , 2 1 s s s s F D F MAX a +         = () () () ()       − − + + − − − + + − = W sw P s sw sw s s W sw P s sw sw s s s x x x x v h v h y y y y u h u h F 4 1 P s n W P w S a a a a a − + + + = nw n s sw w sr sr gw w P S h v u n gh S , , , 3 4 2 2 2 + − = S uw ={} ) ( ) ( ) ( ) ( nw sw W n nw n s n P sw s s w y y h y y h y y h y y h gh − + − + − + − − {} ) ( ) ( ) ( ) ( nw sw bW n nw n b s n bP sw s s b w y y z y y z y y z y y z gh − + − + − + − − (se nadaljuje na naslednji strani) (continued on the next page) Gerč er, S.: Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih - Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems © Acta hydrotechnica 18/28 (2000), 3-40, Ljubljana 21 difuzijski č leni / diffusive terms D nw n n n n P s P sw s s s nw W sw W u D u D u D u D u D u D u D u D D 4 2 3 1 4 2 3 1 + + + + + + + = () ()() ()       − − + − − = s s S N s s S N P P P x x x x y y y y S K D 2 1 2 1 1 () ()() ()       − − + − − = s n S N s n S N P P P x x x x y y y y S K D 2 1 2 1 2 () ()() ()       − − + − − = s n S N n n S N P P P x x x x y y y y S K D 2 1 2 1 3 () ()() ()       − − + − − = n s S N n s S N P P P x x x x y y y y S K D 2 1 2 1 4 () ()() ()       − − + − − = w s s nw sw w s s nw sw W W W x x x x y y y y S K D 2 1 2 1 1 () ()() ()       − − + − − = s n nw sw s n nw sw W W W x x x x y y y y S K D 2 1 2 1 2 () ()() ()       − − + − − = n w n nw sw n w n nw sw W W W x x x x y y y y S K D 2 1 2 1 3 () () () ()       − − + − − = w n n s nw sw w n w s nw sw W W W x x x x y y y y S K D 2 1 2 1 4 () ( ) () ( )       − − − + + − − − + = SW S W SW P S SW S W SW P S s s s x x x x x x y y y y y y S K D 2 1 2 1 1 () ( ) () ( )       − − − + + − − − + = S P W SW P S S P W SW P S s s s x x x x x x y y y y y y S K D 2 1 2 1 2 () ( ) () ( )       − − − + + − − − + = P W W SW P S P W W SW P S s s s x x x x x x y y y y y y S K D 2 1 2 1 3 () () () ()       − − − + + − − − + = W SW W SW P S W SW W SW P S s s s x x x x x x y y y y y y S K D 2 1 2 1 4 () ( ) () ( )       − − − + + − − − + = W P P N W NW W P P N W NW n n n x x x x x x y y y y y y S K D 2 1 2 1 1 () ( ) () ( )       − − − + + − − − + = P N P N W NW P N P N W NW n n n x x x x x x y y y y y y S K D 2 1 2 1 2 () () () ()       − − − + + − − − + = N NW P N W NW N NW P N W NW n n n x x x x x x y y y y y y S K D 2 1 2 1 3 () () () ()       − − − + + − − − + = NW W P N W NW NW W P N W NW n n n x x x x x x y y y y y y S K D 2 1 2 1 4 Gerč er, S.: Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih - Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems © Acta hydrotechnica 18/28 (2000), 3-40, Ljubljana 22 3.1 .3 Diskretizacija dinamič ne enač be za smer Y 3.1.3 Discretisation of the dynamic equation in the Y direction N n n Y WW Srednje toč ke - Midpoints X Diskretne toč ke - Discrete points ww NW nw nw=d W sw n n=c j-1 i-1 S i-2 SW P sw=a w s s=b s s s SE i i+1 j-2 i+2 E n NE j+2 j+1 j ss ss SS SSW SSE e nn ssw sse Slika 9. Krivoč rtna mreža: kontrolna površina za hitrosti v - CSv. Figure 9. Curvilinear grid: control areas for velocities v - CSv. Podobno kot za smer x določ imo še za smer y (slika 9). Rezultat diskretizacije na kontrolni površini CSv je algebrajska enač ba: The procedure for the Y direction is very similar to that described for the X direction (Figure 9). The result of the discretisation for the control area CSv is, again, an algebraic equation: u sw s n P se s ss S s s S v a v a v a v a a v + + + + = - D (30) 3.1 .4 Diskretizacija kontinuitetne enač be 3.1.5 Discretisation of the mass conservation equation N n n Y Srednje toč ke - Midpoints Diskretne toč ke - Discrete points NW nw W n=d n j-1 i-1 S i-2 SW P sw w s=a s s s s=b SE i i+1 j-2 i+2 E n=c NE j+2 j+1 j Slika 1 0. Krivoč rtna mreža: kontrolni volumen za globine h - CVh. Figure 10. Curvilinear grid: control volume for depth h - CSh. Gerč er, S.: Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih - Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems © Acta hydrotechnica 18/28 (2000), 3-40, Ljubljana 23 Integriramo kontinuitetno enač bo: The mass conservation equation is integrated: ∫∫ + CSh dS y hv x hu ∂ ∂ ∂ ∂ ) ( ) ( Ponovimo tudi dinamič no enač bo za smer X v toč ki »w » kontrolnega volumna CVu: Let us write the dynamic equation in the X direction for the point ‘w’ of the control volume CVu again: uw s s s n n n ww W e P w w S u a u a u a u a a u + + + + = - D (31) Č e bi v kontinuitetni enač bi poznali toč ne globine h, bi jo lahko na osnovi Greenovega teorema o pretvorbi ploskovnega integrala na krivuljni integral zapisali v naslednji obliki: If we knew the exact depth h in the mass conservation equation, we would be able to write it in the following form (on the basis of Greene’s theorem about the transformation of the surface to the linear integral): () () () () {} () () () () {} 0 = + + + − + + + da w cd n bc e ab s da w cd n bc e ab s dX hu dX hu dX hu dX hu dY hu dY hu dY hu dY hu (32) Ker toč nih globin ne poznamo, najprej predpostavimo približne globine nad rač unskim območ jem (h * ). S pripadajoč imi predpostavljenimi globinami iz dinamič ne enač be izrač unamo približne hitrosti u * in v * . Toč ne vrednosti pa lahko zapišemo v obliki že znanih relacij: As the exact depth is not known, the approximate depth above the computational area (h * ) is assumed. Next, the approximate velocities u * and v * are calculated from the dynamic equation using the approximate depth values h * . Exact values can be written in the form of known relations: u= u * + u' v= v * + v' h= h * + h' kjer so: u*,v*,h* približne vrednosti u’,v’,h’ popravek do toč ne vrednosti u, v, h toč ne vrednosti. Diskretizirana oblika kontinuitetne enač be na kontrolni površini CSh po izpeljavi zapišemo kot: where: u*, v*, h* are the approximate values; u’, v’, h’ represent the corrigendum and u, v, h are the exact values. The mass conservation equation in its discretised form for the control area CSh is, after derivation, written as: Mp a h a h a h a h a h a h a h a h a h hNW NW hNE NE hSW Sw hSE SE hW W hN N hE E hS S hP P + + + + + + + + = ' ' ' ' ' ' ' ' ' (33) Gerč er, S.: Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih - Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems © Acta hydrotechnica 18/28 (2000), 3-40, Ljubljana 24 kjer veljajo še naslednje zveze : where the following relations are valid: 2 , 2 1 1 1 1 S S S hS C D C MAX a +       = 2 , 2 2 2 2 2 S S S hS C D C MAX a +       = (34) 2 , 2 1 1 1 1 E E E hE C D C MAX a +       = 2 , 2 2 2 2 2 E E E hE C D C MAX a +       = (35) 2 , 2 1 1 1 1 N N N hN C D C MAX a +       = 2 , 2 2 2 2 2 N N N hN C D C MAX a +       = (36) 2 , 2 1 1 1 1 W W W hW C D C MAX a +       = 2 , 2 2 2 2 2 W W W hW C D C MAX a +       = (37) W E S N P a a a a a + + + = (38) ()               − + − + − + − − = da w w da w w cd n n cd n n bc e e bc e e ab s s ab s s p dX v h dY u h dX v h dY u h dX v h dY u h dX v h dY u h M * * * * * * * * * * * * * * * * 1 (39) Reševanje sistema algebrajskih enač b (33) v vseh toč kah računske mreže nam da popravljene vrednosti h' v diskretnih toč kah mreže. To potem omogoč i rač un popravkov hitrosti u' in v' (enač be (40) do (47)). S popravljenimi hitrostmi ponovimo izrač un dinamič ne enač be za smeri X in Y. To ponavljamo, dokler niso izpolnjene vse enačbe, tako obe dinamični kot tudi kontinuitetna enač ba. Vrednosti popravkov hitrosti in globin so pod neko vnaprej predpisano dopustno relativno vrednostjo, ki jo predpišemo kot kriterij konvergence (npr. 0.1%). The solution of the algebraic equations system (33) in all points of numerical grid gives a series of rectified values h' in the discrete points of the grid. With these values, the velocity corrigendas u' and v' are calculated using (40) to (47). With the rectified velocities, the dynamic equation in both the X and Y directions are calculated again. The procedure is repeated until all equations, both dynamic and the mass conservation equation, are completed. At that time, the values of depth and velocity corrigenda must be less than the allowed relative error, which is given in advance as the convergence criterion (e.g. 0.1%). ' 4 ' 3 ' 2 ' 1 ' W uw n uw P uw s uw w h D h D h D h D u + + + = (40) ' 4 ' 3 ' 2 ' 1 ' W vw n vw P vw s vw w h D h D h D h D v + + + = (41) ' 4 ' 3 ' 2 ' 1 ' P ue n ue E ue s ue e h D h D h D h D u + + + = (42) ' 4 ' 3 ' 2 ' 1 ' P ve n ve E ve s ve e h D h D h D h D v + + + = (43) ' 4 ' 3 ' 2 ' 1 ' s us P us s us S us s h D h D h D h D u + + + = (44) ' 4 ' 3 ' 2 ' 1 ' s vs P vs s vs S vs s h D h D h D h D v + + + = (45) ' 4 ' 3 ' 2 ' 1 ' s un P un n un P un n h D h D h D h D u + + + = (46) ' 4 ' 3 ' 2 ' 1 ' s vn P vn n vn P vn n h D h D h D h D v + + + = (47) Gerč er, S.: Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih - Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems © Acta hydrotechnica 18/28 (2000), 3-40, Ljubljana 25 4. ZAPIS RAČ UNALNIŠKIH PROGRAMOV 4.1 PROGRAM GEO-CURVE – PROGRAM ZA KONSTRUIRANJE NEPRAVOKOTNE KRIVOČ RTNE MREŽE Program GEO-CURVE (slika 11) je CAD program, ki smo ga razvili za konstruiranje krivočrtne mreže. Deluje kot dodatek k programskemu paketu AutoCAD, ki ga danes za potrebe projektiranja uporablja veliko inženirjev, tako pri nas kot v tujini. Kljub dejstvu, da je možnosti za konstruiranje mreže precej, smo se v sklopu te naloge omejili na tisti princip, ki bi bil lahko, po našem mnenju, najbolj praktič no uporaben v hidrotehnič ni inženirski praksi. 4. THE COMPUTER PROGRAMMES 4.1 THE GEO-CURVE PROGRAMME – A PROGRAMME FOR THE CONSTRUCTION OF NON- ORTHOGONAL CURVILINEAR GRIDS The GEO-CURVE programme (Figure 11) is CAD software developed to construct curvilinear grids. It is an additional routine, working under the AutoCAD software, which is widely used in Slovenia and abroad. Although there are many possibilities for constructing a curvilinear grid, in our opinion, the principle chosen should be the most applicable for the hydrotechnical engineering praxis. Slika 11. Program GEO-CURVE. Figure 11. The GEO-CURVE programme. Glavni namen programa je konstruiranje numerič ne mreže oziroma njenih diskretnih toč k. Njihove koordinate so temeljni vhodni podatek za naš matematični model PCFLOW2D-CURVE. Tudi za najpreprostejše primere je sicer priprava geometrijskih podatkov zelo zamudno delo z možnostjo vnosa napake. Teorija izgradnje mreže temelji na naslednjem (slika 12): - program razdeli levi in desni rob na enako število odsekov (število celic v vzdolžni smeri). The main purpose of the programme is to construct a numerical grid, i.e. the discrete points of a numerical grid. The coordinates of the grid points are the basic input data for the PCFLOW2D-CURVE mathematical model. Moreover, the preparation of the input data for the model is very time consuming work with the permanent possibility of inputting incorrect values. The grid construction procedure is based on the following (Figure 12): − the left and the right border is divided on an equal number of segments (number of cells in the longitudinal direction), Gerč er, S.: Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih - Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems © Acta hydrotechnica 18/28 (2000), 3-40, Ljubljana 26 - toč ke levega in desnega roba poveže s č rto (preč ni profil). - č rto preč nega profila razdeli na enako število odsekov (število lamel). - med odsekoma sosednjih profilov poišč e geometrijsko sredino (diskretna toč ka). Kot rezultat program kreira mrežo diskretnih toč k in izriše kontrolne površine za globine CSh. − points at the left and the right side are connected by a line (cross-section), − all cross-section lines are divided into an equal number of segments (number of cells in the transverse direction), − between two adjacent profiles, a discrete point in the geometric mean of the profiles is found. As a result, a grid of discrete points and the control areas for the depth CSh are created. Diskretne toč ke mreže Discrete points of the grid Levi rob - Left border Desni rob - Right border Zač etna smer toka Initial flow direction j2 j1 j3 j4 j5 j6 j..n i1 i2 i3 i4 i5 i6 i7 i8 i9 Slika 1 2. Konstruiranje numerič ne mreže. Figure12. The construction of the numerical grid. d L d L d L d L d L D d d D D d d D d L d D Slika 1 3. Teoretič na osnova za konstruiranje mreže. Figure13. Theoretical basis for the grid construction. Gerč er, S.: Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih - Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems © Acta hydrotechnica 18/28 (2000), 3-40, Ljubljana 27 4.2 PROGRAM PCFLOW2D– MATEMATIČ NI MODEL ZA RAČ UN GLADIN PRI PRAVOKOTNI MREŽI Program temelji na teoretič nih podlagah modela TEACH (Gosman, 1976), ki je bil kasneje dopolnjen na KMTe FGG (Č etina, 1 980). Model je bil več krat verificiran kot tudi uporabljen na praktič nih primerih, zato lahko njegove rešitve upoštevamo kot ustrezne. 4.3 PROGRAM PCFLOW2D - CURVE – MATEMATIČ NI MODEL ZA RAČ UN GLADIN PRI NEPRAVOKOTNI KRIVOČ RTNI MREŽI Program PCFLOW2D-CURVE temelji na podanih teoretič nih podlagah drugega pristopa reševanja enač b v krivoč rtnem koordinatnem sistemu. Odloč ili smo se namreč za koncept uporabe netransformiranih enačb v Kartezijevih koordinatah X-Y, vpliv krivoč rtne mreže pa nato upoštevamo pri postopkih diskretizacije. 5. VERIFIKACIJA MATEMATIČ NEGA MODELA Za verifikacijo modela smo izbrali primere, ki nam lahko potrdijo, da je teoretič na izpeljava enačb za primer krivoč rtne numerič ne mreže pravilna. Podobno kot smo posamezne č lene diskretiziranih enač b pri krivoč rtni mreži kontrolirali z ustreznimi č leni pri pravokotni mreži, smo sedaj tudi za celoten model PCFLOW2D-CURVE najprej uporabili primerjavo rezultatov s poenostavljenim primerom toka v pravokotnem kanalu v obliki č rke Z. Kot bomo videli v nadaljevanju, so rezultati zelo podobni tistim, ki jih dobimo z že preverjenim modelom PCFLOW2D. Drugi primer verifikacije pa je tok v kanalu z dvojno krivino, kjer smo izrač unano nadvišanje gladin primerjali z ustreznimi poenostavljenimi analitič nimi izrazi. 4.2 THE PCFLOW2D PROGRAMME – A MATHEMATICAL MODEL FOR THE CALCULATION OF SURFACE ELEVATIONS USING AN ORTHOGONAL GRID The programme is based on the TEACH model (Gosman, 1976). It was additionally upgraded at the Chair of Fluid Mechanics at the University of Ljubljana (Č etina, 1 980). The PCFLOW2D model has been verified several times and used in many practical problems; therefore, the results of the model may be considered as the reference results. 4.3 THE PCFLOW2D-CURVE SOFTWARE – A MATHEMATICAL MODEL FOR THE CALCULATION OF SURFACE ELEVATIONS USING A NON-ORTHOGONAL CURVILINEAR GRID The PCFLOW2D-CURVE programme is based on the theory of the second approach of solving the equations in a non-orthogonal curvilinear coordinate system. The concept of using non-transformed equations in Cartesian X-Y coordinates was adopted, and the impact of the non-orthogonal grid is taken into account later in the discretisation procedure. 5. VERIFICATION OF THE MATHEMATICAL MODEL The cases which confirmed the correctness of the theoretical derivation of the equations in a non-orthogonal curvilinear coordinate system were chosen to verify the model. Similarly, as the individual terms of the equations were compared to the adequate terms of the equations for the orthogonal grid, the results of the complete PCFLOW2D- CURVE model were compared to a simplified flow case in a rectangular ‘Z’ shaped channel (Fig. 14). As can be seen, the results are very close to the results of the already verified PCFLOW2D model. The second case chosen was flow in a double curved channel, where the calculated surface elevations were compared to the results of adequate simplified analytical equations. Gerč er, S.: Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih - Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems © Acta hydrotechnica 18/28 (2000), 3-40, Ljubljana 28 5.1 TOK V PRAVOKOTNEM KANALU V OBLIKI Č RKE Z 5.1.1 Uporaba modela PCFLOW2D pri pravokotni mreži Primer predstavlja tipič en dvodimenzionalni tok, kjer nastane v spodnjem levem kotu izrazit vrtinec. Ker je bil ta primer že testiran s pravokotno mrežo in je bila izvedena tudi primerjava z rezultati modela FLOW3D, lahko z gotovostjo izhajamo iz dejstva, da so rezultati modela PCFLOW2D na pravokotni mreži pravilni. V izbranem primeru imajo stene kanala v tlorisu pravokotno obliko, kar je v praksi sicer redko. Robni pogoji so definirani tako, da je dolvodno konstantna globina H = konst, gorvodno pa je podan pretok Q - glej sliko 14. 5.1 FLOW IN A RECTANGULAR ‘Z’ SHAPED CHANNEL 5.1.1 The use of the PCFLOW2D model within an orthogonal grid The case represents a typical two- dimensional flow, where a well-defined vortex occurs in the lower left corner. As the case has already been tested using an orthogonal grid, and also a comparison with the 3D model FLOW3D results has been done, we may surely consider the results of the PCFLOW2D model correct. The channel walls represent a rectangle in the horizontal plan, which is rather rare in the technical praxis. The downward boundary condition is defined as constant depth (H = const), and at the upward boundary, the discharge (Q) is given (see Figure 14). Slika 1 4. Aksonometrič en prikaz pravokotnega kanala v obliki č rke »Z«. Figure 14. Axonometric view of the rectangular ‘Z’ shaped channel. Področje kanala diskretiziramo s pravokotno mrežo s 1 4 x 22 celicami. Zaradi lažjega računanja na robovih model PCFLOW2D zahteva še definiranje dveh vrstic oziroma stolpcev kontrolnih površin (celic) na zunanjih straneh robov kanala. Tako ima naša numerič na mreža skupno velikost 1 8 x 22 kontrolnih površin (CSh). Velikost posamič ne celice je dX = 2m (širina) in dY = 2m (dolžina). Dno je vodoravno, zato je aktivnim celicam pripisana kota dna 0, neaktivnim celicam pa 10 m The channel is discretised by an orthogonal grid with 14 x 22 cells. For the sake of simplifying the calculation, two more rows (columns) of control areas need to be defined at the outer borders of the channel. Thus, the dimension of the final numerical grid is 18 x 22 control areas (CSh). The width of each cell is dX = 2m, and the length dY = 2m. The channel has a horizontal bed; therefore, the bed elevation of active cells is equal to 0, while that of the non-active cells is set to 10 m (to avoid pouring over the Gerč er, S.: Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih - Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems © Acta hydrotechnica 18/28 (2000), 3-40, Ljubljana 29 (velika vrednost prepreč i preliv iz kanala). Drugi pomembnejši vhodni podatki so še : - Q=konst.=0.5 m 3 /s (gorvodni robni pogoj) - H = 0.1 m (predpisana gladina na dolvodnem robu) - Ng v vseh celicah = 0.01 3 / 1 sm - Predpostavljene globine (H) na zač etku rač una v celicah = 0.08m - Predpostavljene hitrosti na zač etku rač una za smer Y (v) = 0.05 ms -1 - Predpostavljene hitrosti na zač etku rač una za smer X (u) = 0.00 ms -1 - Faktorji podrelaksacije za hitrosti u, v in globine H : URFU = URFV = URFH = 1.0. Rezultat izrač una: kot rezultat izrač una dobimo porazdelitev hitrosti u in v ter globin h v vseh toč kah numerič ne mreže (sliki 1 5 in 16). channel walls). Other important input data are: − Q=const.=0.5 m 3 /s (upward boundary condition) − H = 0.1 m (downward boundary condition) − Ng in all cells = 0.01 3 / 1 sm − Initial water depth (H) in all cells = 0.08 m − Initial velocities in the Y direction (v) = 0.05 ms -1 − Initial velocities in the X direction (u) = 0.00 ms -1 − Under-relaxation factors for velocities u, v and depth H: URFU = URFV = URFH = 1.0 The result of the computation: the distribution of velocities (u and v) and depth (h) in all discrete points of the grid are the result of the computation (Figures 15 and 16). Slika 1 5. Razporeditev vektorjev hitrosti v diskretnih toč kah (model PCFLOW). Figure 15. Velocity vector distribution in discrete points (the PCFLOW model). Gerč er, S.: Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih - Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems © Acta hydrotechnica 18/28 (2000), 3-40, Ljubljana 30 Slika 1 6. Primerjava izrač unanih vektorjev hitrosti med modeloma PCFLOW2D in PCFLOW2D-CURVE pri pravokotni mreži. Figure 16. Comparison of the velocity vectors between the PCFLOW2D and PCFLOW2D-CURVE models using the orthogonal grid. 5.1.2 Uporaba modela PCFLOW2D- CURVE pri pravokotni mreži Novi model PCFLOW2D-CURVE smo najprej uporabili za enake vhodne podatke, kot smo jih upoštevali pri modelu PCFLOW2D. Pravokotna Kartezijeva mreža je namreč le poseben primer splošne krivoč rtne mreže in v primeru pravilnega delovanja modela PCFLOW2D – CURVE bi se rezultati morali ujemati s tistimi na sliki 15. Primerjava izrač unanih vektorjev hitrosti je prikazana na sliki 16. Kot je razvidno iz prikaza vektorjev hitrosti (slika 15), dobimo v kotu izrazit vrtinec oziroma recirkulirajoč e področ je. Koristen podatek za kasnejšo primerjavo 5.1.2 The use of the PCFLOW2D-CURVE model within an orthogonal grid The new PCFLOW2D-CURVE model was first used with the same input data as was used with the PCFLOW2D model. The orthogonal Cartesian grid is, finally, only a special case of the general curvilinear grid, and if the PCFLOW2D – CURVE model worked properly, the results should be in agreement with the results in Figure 15. The comparison of velocity vectors is in Figure 16. As it can be seen from Figure 15, a recirculation area (a well-defined vortex) is present in the corner. Other useful information for the later Gerč er, S.: Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih - Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems © Acta hydrotechnica 18/28 (2000), 3-40, Ljubljana 31 uč inkovitosti modelov je tudi število iteracij, ki so potrebne, da vse enač be (kontinuitetna in dinamič ni) konvergirajo h konč ni vrednosti. Za dosego rezultata na sliki 15 je bilo potrebnih 1004 iteracij pri zahtevani natanč nosti SORMAX=0.001 . Poudarimo še enkrat, da je bil ta primer računa podrobno preverjen na podlagi primerjave med modeloma PCFLOW2D in francoskim modelom FLOW3D. Rezultati med modeloma so se popolnoma ujemali, zato smo jih upoštevali kot merodajne za nadaljnjo primerjavo z rezultati modela PCFLOW2D - CURVE. optimisation of the model is the number of iterations used to get the equation convergence (the mass conservation and the dynamic equation). 1004 iterations were needed to get the results shown in Fig. 15 with the required accuracy SORMAX=0.001. To emphasise once again: this particular case was verified in detail on the basis of comparison between the PCFLOW2D results and the results of the French model FLOW3D. The results were in complete agreement; thus, they were used as a reference for further comparison with the PCFLOW2D-CURVE model. 5.1.3 Uporaba modela PCFLOW2D- CURVE pri krivoč rtni mreži Naslednja stopnja verifikacije modela je bila uporaba krivoč rtne mreže, ki smo jo kreirali s pomoč jo programa za konstruiranje krivoč rtne mreže GEO-CURVE. Za osnovo smo vzeli približno enako število sodelujoč ih celic kot pri pravokotni mreži, torej 1 8 x 22 krivoč rtnih kontrolnih površin (slika 1 7). 5.1.3 The use of the PCFLOW2D-CURVE model within a non-orthogonal grid The next step in the verification of the model was to use a curvilinear grid generated by the GEO-CURVE programme. Approximately the same number of control volumes as with the orthogonal grid was used: 18 x 22 curvilinear control areas (Figure 17). Slika 1 7. Krivoč rtna mreža na »Z kanalu«. Figure 17. Curvilinear grid in the ‘Z’ shaped channel. Gerč er, S.: Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih - Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems © Acta hydrotechnica 18/28 (2000), 3-40, Ljubljana 32 Kot smo že omenili, je ta primer za uporabo krivoč rtne mreže zelo neugoden, je pa koristen za testiranje modela. Pravokotni robovi namreč onemogočajo izvedbo »gladkih« prehodov celic, zato je konstrukcija mreže zelo zahtevna. »Gladki« prehodi so pomembni zaradi interpolacij, ki so potrebne za določ itev vrednosti u,v in h na robovih celic. As already mentioned, this particular case is very inconvenient for use with the curvilinear coordinates; however, it is useful for the purpose of testing. The orthogonally shaped borders exclude the possibility of having »smooth« passages between the cells; therefore, the construction of the grid is very demanding. The »smooth« passages are of great importance due to interpolations, which are needed to calculate the values of u, v and h at the borders of the cells. Slika 18. Primerjava vektorjev hitrosti med modeloma PCFLOW2D in PCFLOW2D-CURVE pri krivoč rtni mreži. Figure 18. A comparison of the velocity vector fields between the PCFLOW2D model and the PCFLOW2D-CURVE model using the curvilinear grid. Gerč er, S.: Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih - Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems © Acta hydrotechnica 18/28 (2000), 3-40, Ljubljana 33 Analiza rezultatov. Iz primerjave rezultatov modelov v primeru uporabe pravokotne mreže (PCFLOW2D) in krivočrtne mreže (PCFLOW2D-CURVE) lahko za slednjega ugotovimo naslednje (slika 18): A. Model PCFLOW2D-CURVE se obnaša enako kot model PCFLOW2D v primeru, da ga uporabimo za pravokotno mrežo. S tem je deloma že potrjena pravilna diskretizacija osnovnih enačb, saj je pravokotna Kartezijeva mreža le poseben primer splošne krivoč rtne mreže. B. Tudi pri uporabi krivoč rtne mreže so vektorji hitrosti izrač unani pravilno tako po smeri kot velikosti, manjša odstopanja so zaradi številnih iteracij na robovih. C. Globine in skupni pretok konvergirajo k pravilnemu konč nemu stanju. D. Krivočrtna mreža zahteva pri enakem številu celic, zaradi povečanja števila interpolacij, več rač unalniškega č asa (oz. iteracij). Vendar je prednost krivoč rtne mreže oč itna v primerih, ko lahko zaradi lažjega prilagajanja robovom število celic bistveno zmanjšamo. 5.2 TOK V DVOJNI KRIVINI Pri toku v krivini se gladina na zunanji strani krivine dvigne, na notranji pa zniža (slika 19). Model PCFLOW2D-CURVE lahko verificiramo tako, da izrač unano nadvišanje primerjamo z empirično formulo (Muškatirovič 1 979): Analysis of the results. From comparisons of the results in the orthogonal grid (PCFLOW2D model) and the curvilinear grid (PCFLOW2D-CURVE model), the following conclusions can be made (Figure 18): A. In the orthogonal coordinate system, the PCFLOW2D-CURVE model behaves equal to the PCFLOW2D model. As the Cartesian grid is only a special case of the general curvilinear grid, the correctness of the discretisation of the basic equations has already been partially confirmed. B. Moreover, using the curvilinear grid, both the length and direction of the velocity vectors are correct. There are only minimal disagreements noticeable near the model borders, mostly due to the numerous iterations. C. Both the depth and discharge measurements converge to the correct final values. D. Due to the higher number of interpolations, the curvilinear grid demands more iterations (higher computational time) by the same number of cells. However, the advantage of using the curvilinear grid is undoubtable in all cases, when the number of cells can be decreased significantly due to the better fitting of the curvilinear grid to the model borders. 5.2 FLOW IN A DOUBLE CURVED CHANNEL In the case of flow through a curve, the water surface increases at the outer side of the curve and decreases at the inner side (Figure 19). The PCFLOW2D-CURVE model can be verified using the empirical formula (Muškatirovič 1 979):         = ∆ n z R R g v h ln 2 (48) kjer je: ∆ h nadvišanje [m] v povpreč na hitrost v krivini [m/s] R z krivinski radij konkavne oblike [m] R n krivinski radij konveksne oblike [m]. where: ∆ h increase [m] v average velocity in the curve [m/s] R z radius of the inner bank [m] R n radius of the outer bank [m] Gerč er, S.: Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih - Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems © Acta hydrotechnica 18/28 (2000), 3-40, Ljubljana 34 Slika 19. Nadvišanje gladine v krivini. Figure 19. Increase of the water surface in a curve. Krivočrtno mrežo na sliki 20 smo oblikovali s pomoč jo programa GEO-CURVE. Č eprav bi v tem primeru lahko uporabili tudi pravokotno krivoč rtno mrežo, smo ostali pri mreži, kjer robovi kontrolnih površin med seboj ne tvorijo pravih kotov. Tako v rač unu sodelujejo tudi členi, ki izražajo nepravokotnost in lahko dodatno preverimo pravilnost diskretizacije enač b v krivoč rtnem sistemu. Opozoriti moramo še, da kontrolne površine zunaj osnovnega korita (rdeč e barve) pri rač unu ne sodelujejo, zato njihova oblika in lega tako rakoč ni pomembna. Kot smo že omenili, jih uporabljamo zgolj zaradi lažjega definiranja robnih pogojev na premaknjeni mreži (CSu, CSh). Kot vhodne podatke smo upoštevali naslednje vrednosti: - stalni tok, pravokotno obliko preč nega preseka kanala z vtoč no in iztoč no širino B=14m, - koto dna aktivnih celic 0 (torej primer vodoravnega dna, izključ en vpliv padca dna) ter koto dna neaktivnih celic 10m. - Q=konst.=0.5m 3 /s (gorvodni robni pogoj) - H=1 m (predpisana globina na dolvodnem robu modela) - v vseh celicah je Ng = 0.01 3 / 1 sm - predpostavljene globine (H) na zač etku rač una v celicah = 0.8m - predpostavljene hitrosti na zač etku rač una za smer Y: v = 0.05 ms -1 - predpostavljene hitrosti na zač etku rač una za smer X: u = 0.00 ms -1 - faktorji podrelaksacije za hitrosti u,v in globine h : URFU = URFV = URFH = 1.0. The curvilinear grid shown in Figure 20 was generated by the GEO-CURVE programme. Although in this case an orthogonal curvilinear grid might be used, we decided for the general (non-orthogonal) curvilinear grid. In this way, the terms, which express the non-orthogonality are also involved, and the case can be treated as an additional verification of the discretisation of equations in a curvilinear coordinate system. The control areas which are not part of the channel (in red colour) are not a part of the computation; therefore, their shape and position is not of any importance. As already mentioned, these are used only for achieving a better definition of the boundary conditions for the shifted grid (CSu and CSh). The following data were used as input: − Steady flow, rectangular channel, width B=14 m along the channel. − Horizontal bed (bed slope impact was excluded); the bed elevation of active cells is equal to 0, while of the non-active cells is set to 10 m. − Q=const.=0.5m 3 /s (upwards boundary condition) − H=1 m (downwards boundary condition) − In all cells, Manning’s coefficient is equal to Ng = 0.01 3 / 1 sm − Initial water depth (H) in all cells = 0.8m − Initial velocities in the Y direction (v) = 0.05 ms -1 − Initial velocities in the X direction (u) = 0.00 ms -1 − Under-relaxation factors for velocities u, v and depth H: URFU = URFV = URFH = 1.0 Gerč er, S.: Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih - Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems © Acta hydrotechnica 18/28 (2000), 3-40, Ljubljana 35 H(3,16) H(7,10) Rn Rz H=konst. Q=konst. Slika 20. Izrač unani vektorji hitrosti v dvojni krivini. Figure 20. Calculated velocity vectors in the double curve. Analiza rezultatov. Kot je razvidno iz slike 20, se vektorji hitrosti pravilno obrač ajo v smeri glavnega toka. Tako globine kot pretok pravilno konvergirajo h konč ni vrednosti, za predpisano natanč nostjo 1 .6 odstotka pa je bilo potrebnih 495 iteracij. Nadvišanje gladine lahko ovrednotimo na dva nač ina: iz rezultatov rač una in s pomoč jo približne analitične enačbe. Iz rezultatov modela PCFLOW2D-CURVE imamo (slika 20): dH = H(3,16) - H(7,10) = = 1.000092424 - 1.00001828 = 0.00007414 m. Analysis of the results. As seen from Figure 20, the velocity vector directions are correct, turning towards the main flow direction. Both depth and discharge converge towards the correct final value. For the required accuracy 1.6 %, 495 iterations were needed. Increase of the surface was calculated from both results of the computation and from the approximate analytical formula. From the PCFLOW2D-CURVE model we obtained (Fig. 20): dH = H(3,16) - H(7,10) = 1.000092424 - 1.00001828 = 0.00007414 m Po analitič ni enač bi (48) pa dobimo: For the analytical equation (Eq. 48) we get:         = ∆ n z R R g v h ln 2 =0.000078339 m, kjer smo upoštevali (slika 20): R z = 30.64m R n = 16.64m v = 0.03548m/s. where the following data were taken into account (Fig. 20): R z = 30.64m R n = 16.64m v = 0.03548m/s. Razlika med analitično iz izrač unano vrednostjo je 5 odstotkov, kar kaže na pravilno delovanje računalniškega programa PCFLOW2D-CURVE. The difference between the analytical and the computed value is about 5 %; therefore, the working of the PCFLOW2D-CURVE model may be treated as correct. Gerč er, S.: Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih - Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems © Acta hydrotechnica 18/28 (2000), 3-40, Ljubljana 36 6. ZAKLJUČ EK Krivoč rtna mreža ima v inženirski praksi zelo veliko uporabnost, saj ponuja možnost boljšega prilagajanja nepravilnim robovom rač unskega področ ja. Reševanje enačb je matematič no kompleksno, zato smo v tej nalogi podali in opisali dva temeljna pristopa reševanja, pri č emer smo v rač unalniški program PCFLOW2D-CURVE potem vgradili t.i. »drugi pristop«. 6.1 PRVI PRISTOP Enačbe, s katerimi opisujemo gibanje turbulentnih tokov, izrazimo v vektorski obliki, ki je neodvisna od koordinatnega sistema. Z znanimi matematič nimi izrazi za vektorske operatorje, kot so gradient, divergenca in rotor za različ ne koordinatne sisteme lahko nato osnovne enač be transformiramo v koordinatno obliko za krivoč rtni pravokotni ali splošni nepravokotni krivoč rtni sistem. Tega potem preslikamo v pravokotno mrežo, na kateri izvedemo numerično diskretizacijo enačb, nato pa konč ne rezultate preslikamo nazaj v krivoč rtni sistem. Poseben primer splošnega krivoč rtnega sistema je pravokotni krivočrtni sistem. Enač be za ta poseben primer so v literaturi dostopne, zato smo jih lahko uporabili kot temeljno kontrolo izpeljave enač b v splošnem krivoč rtnem sistemu. Kot lahko vidimo iz drugega poglavja, se razvite enač be splošnega krivočrtnega sistema ob ustreznih poenostavitvah resnič no transformirajo v tiste v pravokotnem sistemu, tako da lahko zaključ imo, da so splošne enač be pravilno izpeljane. Pri nadaljnjem razmišljanju ob pregledovanju izpeljanih enačb prvega pristopa pridemo do sklepa, da bi bila numerič na diskretizacija teh enač b izjemno kompleksna, predvsem pa zelo dolga. Posameznih korakov diskretizacije tudi ne bi mogli fizikalno preveriti, zato bi bila možnost napak več ja. Zaradi teh razlogov smo se odloč ili za uporabo drugega pristopa. 6. CONCLUSIONS The curvilinear grid is very applicable in an engineering praxis, as it better fits the natural borders of the computational domain. Solving the equations is mathematically complex; thus, in the thesis, two different basic approaches are given. The “second approach” was included in the PCFLOW2D- CURVE model. 6.1 THE FIRST APPROACH: Equations used for the description of movement of the turbulent flow are written in a vectorised form, independent of the coordinate system. With the known mathematical expressions of vectorised operators such as gradient, divergence and curl, in different coordinate systems, the basic equations are transformed into a coordinate form for the curvilinear orthogonal or general non-orthogonal system. This system is later transformed into an orthogonal grid where numerical discretisation of the equations is performed. Finally, the results are transformed back to the curvilinear system. A special case of a general curvilinear system is an orthogonal curvilinear system. Equations for this special case are available in literature; therefore, they were used as the basic verification of the derivation of the equations in the general curvilinear system. As can be seen from the second chapter, in the special case (orthogonal curvilinear system), and using the appropriate simplifications, the derived equations are really transformed into the equations used in an orthogonal system. Thus, the derivation may be considered correct. After taking into consideration the complexity and time used for the derivation of the equations of the first approach, it was concluded that the second approach offers better possibilities for the physical verification of the individual steps of the derivation and fewer possibilities for mistakes. Therefore, we decided to use the second approach. Gerč er, S.: Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih - Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems © Acta hydrotechnica 18/28 (2000), 3-40, Ljubljana 37 6.2 DRUGI PRISTOP Pri tem pristopu uporabimo osnovne enač be v običajnem Katerzijevem koordinatnem sistemu, vpliv nepravokotnih celic krivoč rtne mreže pa nato upoštevamo pri numerič ni diskretizaciji. Numerič no diskretizacijo smo izvršili po metodi konč nih volumnov oz. površin, ki se v svetu veliko uporablja za reševanje gibanja turbulentnih tokov. Tudi lastnih izkušenj z uporabo metode za primer pravokotnih mrež smo imeli dovolj, da smo lahko v okviru naloge izvedli še podrobno izpeljavo za primer nepravokotne krivoč rtne mreže. Ustrezni č leni v dobljenih diskretiziranih enač bah se za primer pravokotne mreže kot posebnega primera splošne krivoč rtne mreže (poglavje 3) pravilno poenostavijo, kar nam potrjuje, da je bila izpeljava uspešno izvedena. Poudarimo lahko, da podrobne izpeljave diskretizacije za primer splošnih krivoč rtnih koordinat in hkrati premaknjene mreže nismo zasledili v dosegljivi literaturi. Obič ajno se v takšnih primerih uporablja nepremaknjena mreža, zato naš pristop predstavlja v svetu do neke mere novost. Pri obeh pristopih smo za zdaj izpeljali in nato diskretizirali kontinuitetno in dinamič ni enačbi za primer dvodimenzionalnega globinsko povpreč enega toka s prosto gladino. Enak postopek in pridobljene izkušnje lahko uporabimo tudi pri diskretizaciji dodatnih transportnih enačb za skalarje (npr. temperaturo »T«, slanost »s«, koncentracijo »C« ipd.) ali količ ine, ki nastopajo v ustreznih modelih turbulence (npr. tubulentna kinetič na energija na enoto mase »k« in stopnjo njene disipacije »ε« pri zelo razširjenem k-ε modelu turbulence). 6.2 THE SECOND APPROACH: Here the basic equations in the Cartesian coordinate system are used, and the impact of the non-orthogonality of the cells is taken into account during the discretisation of the equations. The control volume method (control area method, respectively) was used for the numerical discretisation. This method is widely used throughout the world to solve the motion of turbulent flows. Moreover, we were experienced enough with the same method in orthogonal grids to perform a detailed derivation in the non-orthogonal curvilinear grid. Adequate terms in the derived discretised equations are (in the case of the orthogonal grid as a special case of the general non-orthogonal grid – see chapter 3) simplified correctly, which confirms the success of the derivation performed. Again, it must be emphasised that a detailed derivation of discretisation for general curvilinear coordinates and shifted grids can not be found in any available literature. Usually, a non-shifted grid is used with such cases; therefore, the approach described represents, to a certain extent, an innovation, in the field. So far, with both approaches, the mass conservation and the dynamic equation were first derived and then discretised for the two- dimensional depth averaged free surface flow. The same procedure and the acquired experience may also be used for the discretisation of additional equations, for either the scalar transport (temperature »T«, salinity »s«, concentration »C« etc.), or any quantity that is used in adequate turbulence closure schemes (the turbulent kinetic energy per mass unit »k« and the dissipation of the turbulent kinetic energy »ε« in the expanded k-ε model). Gerč er, S.: Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih - Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems © Acta hydrotechnica 18/28 (2000), 3-40, Ljubljana 38 6.3 IZDELAVA IN VERIFIKACIJA RAČ UNALNIŠKEGA PROGRAMA PO DRUGI METODI:(PCFLOW2D- CURVE) V okviru te naloge smo se odloč ili za uporabo drugega pristopa, na podlagi katerega smo pripravili matematič ni model in razvili rač unalniški program PCFLOW2D-CURVE. Program temelji na programu PCFLOW2D, ki se uporablja na Katedri za mehaniko tekoč in z laboratorijem (KMTe) za primere dvodimenzionalnih tokov pri pravokotni numerič ni mreži. Ker je bila že izpeljava postopka diskretizacije in nato izdelava rač unalniškega programa zelo obsežna in zahtevna naloga, smo za potrditev pravilnega delovanja programa izvedli le nekaj osnovnih verifikacij. Kot prvo verifikacijo smo izvedli primerjavo med že preverjenim modelom PCFLOW2D in modelom PCFLOW2D- CURVE pri uporabi pravokotne mreže za tok v pravokotnem kanalu v obliki č rke »Z«. Rezultati so pokazali tako rekoč popolno ujemanje. To je bila prva potrditev pravilnosti izpeljave diskretizacije in delovanja razvitega programa PCFLOW2D-CURVE. Pri drugi verifikaciji smo za isti primer toka v kanalu »Z« oblike izvedli primerjavo med rezultati, dobljenimi pri pravokotni mreži (program PCFLOW2D) in rezultati pri krivočrtni mreži (program PCFLOW2D- CURVE). Tudi tu se rezultati dobro ujemajo in to tudi na območ ju izrazitega vrtinca, ki nastane v spodnjem levem kotu in kaže na izrazito dvodimenzionalni tok. Do manjših razlik prihaja na robovih krivoč rtne mreže, kar je po naši oceni posledica številnih interpolacij vrednosti na robovih. Težava je povezana tudi s splošnostjo podajanja robnih pogojev, kar je posebej omenjeno tudi pri usmeritvah za nadaljnje delo. Kot tretjo verifikacijo smo izvedli primerjavo rezultatov modela z analitič no formulo nadvišanja gladine v krivini. Tudi tukaj lahko ugotavljamo, da so rezultati modela dobri. Na podlagi dosedaj opravljenih verifikacij lahko sklepamo, da je model PCFLOW2D- CURVE zasnovan pravilno in da je primerna podlaga za nadaljnji razvoj in dopolnitve. 6.3 ELABORATION AND VERIFICATION OF THE COMPUTER PROGRAMME BY THE SECOND APPROACH: (THE PCFLOW2D-CURVE PROGRAMME) Within the framework of the project, it was decided to use the second approach as the basis. The mathematical model and the computer programme PCFLOW2D-CURVE were built. The programme itself is based on the PCFLOW2D programme, which is used at the Chair of Fluid Mechanics to calculate two- dimensional turbulent flows using an orthogonal grid. As the derivation of the discretisation procedure and the creation of the programme were very extensive and difficult, only a few basic verifications were performed to confirm the accuracy of the model simulations. First, a comparison between the already verified model PCFLOW2D and the new model PCFLOW2D-CURVE was performed. An orthogonal grid in a ‘Z’ shaped channel was used. The results showed practically complete agreement. Thus, the correctness of the discretisation and the new PCFLOW2D- CURVE programme was confirmed for the first time. As the second verification, for the same flow case in the ‘Z’ shaped channel, a comparison between the results of the PCFLOW2D model (using orthogonal coordinates) and the PCFLOW2D-CURVE model (using curvilinear coordinates) was performed. Again, the agreement of the results is good, even in the lower left corner, where the well-defined vortex occurs. At the borders, there is some disagreement, which, in our opinion, is mostly due to the numerous interpolations near the borders. The problem is also connected to the generality of the definition of boundary conditions, which is also emphasised in the guidelines for further research. As the third verification, a comparison of the model results and an analytical formula for the increase of the water surface in a curve was performed. Here again, the model results were found to be very accurate. Taking into account the verifications performed, the PCFLOW2D-CURVE model can be considered as correctly conceived, and may be treated as an appropriate foundation for further research and development. Gerč er, S.: Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih - Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems © Acta hydrotechnica 18/28 (2000), 3-40, Ljubljana 39 6.4 PROGRAM ZA KONSTRUIRANJE KRIVOČ RTNE MREŽE (GEO-CURVE) Za potrebe matematičnih modelov, ki temeljijo na krivoč rtnih mrežah, je treba zagotoviti zmogljiva orodja za pripravo numeričnih mrež. Že za najpreprostejše primere je namreč roč na priprava mreže in potrebnih geometrijskih podatkov zelo zamudno opravilo s precejšnjo možnostjo, da pri vnosu pride do napake. Zato smo v okviru te naloge razvili tudi pomožni program GEO- CURVE. Kot predprocesorski program je razvit do stopnje, da ga lahko uporabimo pri več ini primerov, ki nastopajo v inženirski hidrotehnični praksi modeliranja dvodimenzionalnih tokov v odprtih vodotokih. K razvoju posebnega pomožnega programa GEO-CURVE nas je spodbudilo tudi dejstvo, da je treba pripravi podatkov (predprocesiranje) in končnemu prikazu rezultatov (postprocesiranje) posvetiti več jo pozornost. V svetu so v okolju Windows takšni prijazni uporabniški vmesniki že zelo uveljavljeni in za komercialno trženje programov že skorajda nujni. Prve korake v tej smeri smo naredili tudi na KMTe z vmesnikom na program PCFLOW3D in omenjenim programom GEO-CURVE. Ustrezna in kakovostno pripravljena krivoč rtna mreža se lahko tako veliko bolje prilagodi robovom rač unskega področ ja, zmanjša število celic ali pa z možnostjo uporabe gostejših mrež zmanjša t.im. »numerič no difuzijo«. Splošne krivočrtne mreže je mogoč e uporabiti pri številnih primerih simulacije tokov, ki nastopajo v hidrotehnič ni praksi: pri toku v strmih ukrivljenih strugah, v rekah s poplavnimi območji ter cestnimi in z železniškimi nasipi ali npr. pri tokovih v krožnih aeracijskih bazenih č istilnih naprav. 6.4 THE PROGRAMME FOR THE CONSTRUCTION OF THE CURVILINEAR GRID (GEO-CURVE) Powerful tools are needed to prepare numerical grids for the mathematical models based on curvilinear coordinates. Even for the simplest cases, manual preparation of the grid and appropriate geometric data is very time consuming; besides, there is always the considerable possibility of making a mistake. Therefore, the subsidiary programme GEO- CURVE was developed within the framework of research. As a pre-processing tool, the programme has been developed up to the phase, that it can be used with most of the cases that occur in the engineering praxis of the modelling of two-dimensional free surface flows. Development of the GEO-CURVE programme was also stimulated by the fact that more attention must be devoted to the preparation of input data (pre-processing) and the presentation of the final results (post- processing). Throughout the world, and also in the Windows environment, such user-friendly interfaces are a common praxis; moreover, they are more or less obligatory for the successful trading of software. The first step in that direction has already been done at the Chair of Fluid Mechanics by the development of the interface for the PCFLOW3D model and with the present GEO-CURVE programme. In that manner, an appropriately and qualitatively prepared curvilinear grid can fit much better to the natural borders of the computational area; it can either decrease the total number of cells (and the computational time) or it can, using denser grids, decrease the false diffusion. General curvilinear grids are applicable to numerous different flow simulations: flow in steep curved channels, rivers with inundation and road or railway dykes, or e.g. with the flow in the circular aeration basins of wastewater treatment plants. Gerč er, S.: Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih - Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems © Acta hydrotechnica 18/28 (2000), 3-40, Ljubljana 40 VIRI - REFERENCES Autodesk (1997). AutoCAD R14 – developers guide. Č etina, M. (1 983). Dvodimenzionalni rač un gladin v strmih ukrivljenih strugah (Two-dimensional computation of flow in steep curved channels). Unpublished diploma thesis, University of Ljubljana, FAGG, 103 p. (in Slovenian). Č etina, M. (1 988). Matematič no modeliranje dvodimenzionalnih turbulentnih tokov (Mathematical modelling of two-dimensional turbulent flows). Unpublished master's thesis, University of Ljubljana, FAGG, 128 p. (in Slovenian). Č etina, M. (1 992). Tridimezionalni matematič ni baroklini model za izrač un tokov v jezerih in morju (Three-dimensional mathematical baroclinic model for flow computation in lakes and sea). Unpublished doctoral thesis, University of Ljubljana, FAGG, 128 p. (in Slovenian). Gerč er, S. (2000). Matematič no modeliranje dvodimenzionalnih turbulentnih tokov v krivoč rtnih koordinatnih sistemih (Mathematical Modelling of Two-Dimensional Turbulent Flow in Curvilinear Coordinate Systems). Unpublished master's thesis, FGG, University of Ljubljana, 125 p. Gosman, A.D., Ideriah, F.J.K. (1976). TEACH-T: A general computer program for two- dimensional, turbulent, recirculating flows. Technical report, Dept. of Mechanical Engineering, Imperial College, London. Muškatirovič (1 997). Regulacija reka (River regulation), II ed., Građ evinski fakultet, Beograd, 430 p. (in Serbian). Patankar, S., (1980). Numerical heat transfer and fluid flow. McGraw-Hill Book Company, 197 p. Rajar, R. (1980). Hidravlika nestalnega toka (Unsteady flow hydraulics), University textbook, FAGG, Ljubljana (in Slovenian), 279 p. Rajar, R., Č etina M. (1 984), Numerical and experimental simulation of two-dimensional turbulent flow, Proceeding of the International Conference, Portorož, Chapter 2, 29-41 . Rajar, R. (1986). Hidromehanika (Fluid mechanics), University textbook, FAGG, Ljubljana, 236 p. (in Slovenian). Rajar, R. (1992). Hidromehanika, predavanja na podiplomskem študiju (Fluid mechanics for post- graduate students), FAGG, University of Ljubljana (in Slovenian). Rajar, R. (1993). Modeli turbulence, predavanja na podiplomskem študiju (Turbulence modelling), FAGG, University of Ljubljana (in Slovenian). Tan Welyan (1998). Shallow water hydrodynamics. Elsevier, Amsterdam, 435 p. Tannehill, J., Anderson, D., Pletcher, R. (1997). Computational Fluid Mechanics and Heat Transfer. Naslov avtorja - Author's Address mag. Slavko GERČ ER CGS Lava 7, SI - 3000 Celje