Moukalled F., Mangani L., Darwish M. The finite volume method in computational fluid dynamics. An advanced introduction with OpenFOAM and Matlab (811443), страница 80
Текст из файла (страница 80)
13.22 One-dimensional domain used for Exercise 2Compute the temperature field for three time steps using:(a) The Adams-Moulton method with uniform time steps ðDt ¼ 20 sÞ.(b) The finite difference form of the Adams-Moulton method with non-uniformtime steps (Dt1 ¼ 10 s, Dt2 ¼ 20 s, and Dt3 ¼ 30 s).(c) The finite volume form of the Adams-Moulton method with non-uniform timesteps (Dt1 ¼ 10 s, Dt2 ¼ 20 s, and Dt3 ¼ 30 s). (Fig. 13.22).Use the implicit Euler scheme for the first time step.13.7Exercises531Exercise 3The body described in Exercise 1 is again subjected to a Dirichlet boundary conditionat one end and to a convective heat transfer at the second end. The parameters involvedare Dx ¼ 0:015 m, Ti ¼ 273 K, Tb1 ¼ 260 K, TR ¼ 330 K, hR = 400 W/m2K,k = 55 W/mK, q ¼ 7000 kg/m3 , and cp ¼ 400 J=Kg K (Fig.
13.23).xTb1xT1T2Tb2hRTRFig. 13.23 One-dimensional domain used for Exercise 3Compute the temperature field for three time steps using:(a) The Crank-Nicolson method with uniform time steps ðDt ¼ 20 sÞ.(b) The finite difference form of the Crank-Nicolson method with non-uniformtime steps (Dt1 ¼ 10 s, Dt2 ¼ 20 s, and Dt3 ¼ 30 s).(c) The finite volume form of the Crank-Nicolson method with non-uniform timesteps (Dt1 ¼ 10 s, Dt2 ¼ 20 s, and Dt3 ¼ 30 s).Use the implicit Euler scheme for the first time step.Exercise 4Consider the following equation defined over the one dimensional grid shown inFig. 13.24:@/¼ r Cr/ b/@txxxyWCFig. 13.24 One dimensional domain used for Exercise 4E53213 Temporal Discretization: The Transient Term(a) Derive the algebraic equation for element C.
Use a first order Euler Explicitscheme for the transient term and linearize the source term given that b ispositive.(b) Is there a step limitation for the equation derived in (a)? If so derive itsexpression in terms of the appropriate variables.Exercise 5Use the implicit backward Euler scheme to integrate in time the linear advectionequation given by@/@/þu¼ 0u[0@t@xand the second order central difference approximation for the spatial derivative.(a) Derive the discretized equation.(b) Find the accuracy of the scheme(c) Determine the stability of the scheme.Exercise 6Use the fully implicit Euler scheme in time and the central difference scheme inspace to discretize the one dimensional convection diffusion heat equation given by@ qcp T@ ðquT Þ@@TþþS¼k@t@x@x@xover a uniform mesh of spacing Dx and write it down in the standard form.There are two issues that should be considered when choosing the time step:stability and accuracy. What are the limits for the time step of the two schemes toachieve stable and accurate solutions? Are these limits similar for both stability andaccuracy?Exercise 7 (OpenFOAM®)List from Doxygen [22] all derived classes of the ddtScheme <Type> class.Exercise 8 (OpenFOAM®)Find in OpenFOAM® the fvm implementation of the first order implicit Eulerscheme.
Compare the implemented algorithm with Eq. (13.28) and the contributionto the matrix of coefficients with Eq. (13.62).Exercise 9 (OpenFOAM®)Compare in OpenFOAM® the fvm implementation of the second orderCrank-Nicolson transient scheme with Eqs. (13.43) and (13.44). The C file is locatedin “$FOAM_SRC/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.C”. Hint: In the fvm member function, just check the ifstatement when mesh().moving() is false.References533References1.
Faires JD, Burden RL (1993) Numerical methods. PWS, Boston, pp 152–1532. Crank J, Nicolson P (1947) A practical method for numerical evaluation of solutions of partialdifferential equations of the heat-conduction type. Proc Cambr Phil Soc 43:50–673. Shyy W (1985) A study of finite difference approximations to steady state convectiondominated flows. J Comput Phys 57:415–4384. Moukalled F, Darwish M (2012) Transient schemes for capturing interfaces of free-surfaceflows. Numer Heat Transf Part B Fundam 61(3):171–2035. Ascher U, Ruuth S, Spiteri RJ (1997) Implicit-explicit runge-kutta methods fortime-dependent partial differential equations.
Appl Numer Math 25:151–1676. Ames WF (1977) Numerical methods for partial differential equations. Academic Press,Orlando7. Milne WE (1953) Numerical solution of differential equations. Wiley, New York8. Richtmyer RD (1967) Difference methods for initial value problems, 2nd edn.
Wiley, NewYork9. Birkhoff G, Rota G (1989) Ordinary differential equations. Wiley, New York10. Burden R, Faires JD (2010) Numerical analysis, 9th edn. Brooks, Cole11. Chapra S, Canale R (2014) Numerical methods for engineers. 7th ed., McGraw Hill, NewYork12. Cheney W, Kincaid D (2013) Numerical mathematics and computing, 7th edn. Brooks/Cole,Boston13. Courant R, Friedrichs K, Lewy H (1928) Über die partiellen Differenzengleichungen dermathematischen Physik. Math Ann (in German) 100:32–7414.
Patankar SV (1980) Numerical heat transfer and fluid flow, Hemisphere, New York15. Peinado J, Ibáñez J, E. Arias E, V. Hernández V (2010) Adams–Bashforth and Adams–Moulton methods for solving differential Riccati equations. Comput Math With Appl 60(11):3032–304516. Ferziger JH, Peric M (2013) Computational methods for fluid dynamics, 3rd edn. Springer,Germany17. Courant R, Isaacson E, Rees M (1952) On the solution of nonlinear hyperbolic differentialequations by finite differences. Commun Pure Appl Math 5:243–25518.
Darwish M, Moukalled F (2006) Convective schemes for capturing interfaces of free-surfaceflows on unstructured grids. Numer Heat Transf Part B Fundam 49(1):19–4219. Darwish M, Moukalled F (1994) Normalized variable and space formulation methodology forhigh-resolution schemes. Numer Heat Transf Part B Fundam 26(1):79–9620.
Leonard BP (1981) A survey of finite differences with unwinding for numerical modeling ofthe incompressible convection diffusion equation. In Taylor C, Morgan K (eds.)Computational techniques in transient and turbulent flow, Pineridge Press, Swansea, UK,2:1–3521. OpenFOAM, 2015 Version 2.3.x. http://www.openfoam.org22. OpenFOAM Doxygen, 2015 Version 2.3.x. http://www.openfoam.org/docs/cpp/Chapter 14Discretization of the Source Term,Relaxation, and Other DetailsAbstract This chapter is devoted to a number of “small” numerical details thatmay have “big” effects on the solution behavior.
First the treatment of the sourceterm in the general case when it is solution dependent (i.e., when Q/ ¼ Q/ ð/Þ) isexamined. The source is linearized in terms of the dependent variable and split intotwo parts, one treated explicitly and the second treated implicitly.
This is followedby a discussion of explicit and implicit techniques for under-relaxing the algebraicequations. Several implicit under-relaxing approaches are presented, starting withthe well known implicit under relaxation method of Patankar (Numerical heattransfer and fluid flow, 1980) [1], the E-factor method of van Doormaal andRaithby (Numerical Heat Transfer 7:147–163, 1984) [2], and the false transientapproach of Mallinson and de Vahl Davis (Journal of Computational Physics 12(4):435–461, 1973) [3]. Then the residual form of the discretized algebraic equationis introduced. The chapter ends with the presentation of convergence indicatorsused to evaluate the solution convergence status.14.1Source Term DiscretizationSource terms (sink and source) appear in the governing equations of many flow andtransport phenomena problems.
Examples include the equations of turbulencemodels, chemical reactions, radiation heat transfer, mass transfer, and multiphaseflows, to cite a few. These source terms affect not only the physics of the problem,but also the numerical stability of computations. However, if properly handled,source terms may yield improvement in robustness. A general recommendation is totreat negative values (sinks) implicitly, while positive values (sources) should beevaluated explicitly.The treatment of source terms can be clarified by considering the discretizedform of the general conservation equation for the variable / over the element ofcentroid C and volume VC with a source explicitly displayed (Fig.
14.1). Thisequation is given by© Springer International Publishing Switzerland 2016F. Moukalled et al., The Finite Volume Method in Computational Fluid Dynamics,Fluid Mechanics and Its Applications 113, DOI 10.1007/978-3-319-16874-6_1453553614Discretization of the Source Term, Relaxation, and Other DetailsFig. 14.1 An element C witha source term Q/F1F2Convectionf2Diffusionf1TransientCf6f3F3F6Source/Sinkf4f5F4aC / C þXF5aF /F ¼ Q/C VCð14:1ÞFNBðC Þwhere Q/C VC represents the source term integrated over the element C.In general the source term is a function of the dependent variable / with itsfunctional relationship expressed asQ/C ¼ Qð/C Þð14:2ÞIn this form the source can be explicitly calculated based on the available /values, which in an iterative process represent values from the previous iteration.Whereas this approach is acceptable if the value of Q/C is constant or relativelysmall, when the variation in Q/C is large in comparison with other terms in theequation the rate of convergence can be negatively affected.
In such situations, therate of convergence may be improved by linearizing Q/C using a Taylor-like seriesexpansion. Denoting values at the previous iteration with a superscript , the valueof the source term Q/C at the current iteration can be expressed as14.1Source Term Discretization537 @Q Qð/C Þ ¼ Q /C þ/C /C@/C @Q @Q /C þ Q /C /C¼@/@/C|fflfflfflfflfflfflfflfflC{zfflfflfflfflfflfflfflffl}|fflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl{zfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl}Implicit partð14:3ÞExplicit part calculated based onvalues from previous iterationIn a control volume context, the right hand side of Eq. (14.1) can be written asQ/C VCZZ¼Q/ dVVCZZ ZZ @QC@QC ¼/ dV þQC / dV@/C C@/C CVCVC @QC@QC ¼VC /C þ QC /C VC@/C@/Cð14:4Þ¼ FluxCC /C þ FluxVCSubstituting back in Eq.