Главная » Просмотр файлов » Moukalled F., Mangani L., Darwish M. The finite volume method in computational fluid dynamics. An advanced introduction with OpenFOAM and Matlab

Moukalled F., Mangani L., Darwish M. The finite volume method in computational fluid dynamics. An advanced introduction with OpenFOAM and Matlab (811443), страница 36

Файл №811443 Moukalled F., Mangani L., Darwish M. The finite volume method in computational fluid dynamics. An advanced introduction with OpenFOAM and Matlab (Moukalled F., Mangani L., Darwish M. The finite volume method in computational fluid dynamics. An advanced introduction with OpenFOAM and Matlab.pdf) 36 страницаMoukalled F., Mangani L., Darwish M. The finite volume method in computational fluid dynamics. An advanced introduction with OpenFOAM and Matlab2020-08-25СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 36)

The purposeof the above presentation is to introduce the reader to the philosophy and generalconcepts that are useful for a quick understanding of the OpenFOAM® framework.Despite the generality of presentation, the described syntax introduced one of themain important data defined within OpenFOAM® that are necessary for writing acomplete solver, which will be described in later chapters.7.3 Mesh Conversion ToolsThere are many tools capable of converting mesh files from a variety of format tothe OpenFOAM® format. Some of these tools are as follows [1]:• ansysToFoam: Converts an ANSYS input mesh file, exported from I-DEAS, toOpenFOAM® format.• cfx4ToFoam: Converts a CFX 4 mesh to OpenFOAM® format.• datToFoam: Reads in a datToFoam mesh file and outputs a points file. Used inconjunction with blockMesh.• fluent3DMeshToFoam: Converts a Fluent mesh to OpenFOAM® format.• fluentMeshToFoam: Converts a Fluent mesh to OpenFOAM® format includingmultiple region and region boundary handling.• foamMeshToFluent: Writes out the OpenFOAM® mesh in Fluent mesh format.• foamToStarMesh: Reads an OpenFOAM® mesh and writes a PROSTAR (v4)bnd/cel/vrt format.• foamToSurface: Reads an OpenFOAM® mesh and writes the boundaries in asurface format.• gambitToFoam: Converts a GAMBIT mesh to OpenFOAM® format.• gmshToFoam: Reads.msh file as written by Gmsh.• ideasUnvToFoam: I-Deas unv format mesh conversion.• kivaToFoam: Converts a KIVA grid to OpenFOAM® format.• mshToFoam: Converts.msh file generated by the Adventure system.• netgenNeutralToFoam: Converts neutral file format as written by Netgen v4.4.• plot3dToFoam: Plot3d mesh (ascii/formatted format) converter.• sammToFoam: Converts a STAR-CD (v3) SAMM mesh to OpenFOAM®format.• star3ToFoam: Converts a STAR-CD (v3) PROSTAR mesh into OpenFOAM®format.• star4ToFoam: Converts a STAR-CD (v4) PROSTAR mesh into OpenFOAM®format.• tetgenToFoam: Converts .ele and .node and .face files, written by tetgen.• writeMeshObj: For mesh debugging: writes mesh as three separate OBJ fileswhich can be viewed with e.g.

javaview.7.4 Closure2057.4 ClosureThe chapter overviewed the realization of the FVM in a computer code byexplaining several implementation attributes of the uFVM and OpenFOAM® CFDcodes. The two codes were presented in terms of their data structure, memorymanagement schemes, and case setup. The next chapter will detail the finite volumesecond discretization step as applied to the diffusion flux.7.5 ExercisesExercise 1For the configuration shown in Fig. 7.11(a) Write the owner and neighbor for each interior face and use it to write theowners and neighbors lists.(b) Build the connectivity array for each element by looping over each of theinterior faces using the owner-neighbor information; this is the coefficientconnectivity used in uFVM.(c) Build the coefficients ldu addressing connectivity used in OpenFOAM®.161771315231261151481836271121322435411128992119101020Fig.

7.11 The rectangular domain discretized with an unstructured grid used for Exercise 1Exercise 2Using the uFVM (MATLAB®) code, read the elbow mesh (available at the bookwebsite) and then do the following:(a) Write a script to loop over all the elements of the domain and print out for eachelement its index, and the indices of its faces in the following format “element[i] → faces[k l m n…]”7 The Finite Volume Mesh in OpenFOAM® and uFVM206(b) Declare and array phi as an element field (size = 1, Number ofelements + Number of boundary faces), and initialize it using the followingformula: ϕ(x, y, z) = 10xy + 5y2.(c) Declare a new element array of type vector (size 3, Number ofelements + Number of boundary faces) and use it to compute the gradient ofphi, using the gauss theorem i.e.,P/f Sfr/ ¼fVwhich can be written as follows for the mesh data used:Pr/ ¼owner ð f Þ/f Sf Pneighbour ð f Þ/f Sf þPb¼boundaryð f Þ/b SbVExercise 3Use blockMesh to setup a uniform mesh similar to the one in Fig.

7.12 for L = 1. InOpenFOAM® and then in uFVM do the following:(a) Write a program to read the mesh and loop over all boundary patches. Thenfor each patch print the centroid and normal vector of its faces.(b) Modify the program to define a volumeScalarField T. Set the values for T atelement centroids and at the boundaries to 10x2y2, where x and y are thecoordinates of the element centroids and for the case of the boundary thecentroids of the boundary faces.(c) Write a program to compute the gradient of T and compare its value with theanalytical solution.Lpatch#2patch#4Lpatch#1L /2patch#3L /2Fig. 7.12 A two dimensional domain generated with blockMesh7.5 Exercises207Exercise 4(a) Find in OpenFOAM® using Doxygen [2], the class definition of the data typespoints, face, and cell.(b) Loop over all interior faces (using forAll) and for each face write the owner,neighbor, and centroid.(c) Loop over all elements and write for each element the value of the cubic rootof its volume and its centroid.(d) Loop over all boundary faces and write for each face the owner (parentCell)and centroid.(e) Define a surfaceScalarField and set its value to be equal to the x component forinterior faces and the y component for boundary faces.(f) Find the member function of the surfaceScalarField (GeometricField<>) thatreturns the old time values.References1.

OpenFOAM (2015) Version 2.3.x. http://www.openfoam.org2. OpenFOAM Doxygen (2015) Version 2.3.x. http://www.openfoam.org/docs/cpp/Part IIDiscretizationChapter 8Spatial Discretization: The Diffusion TermAbstract This chapter describes in detail the discretization of the diffusion termrepresented by the spatial Laplacian operator. It is investigated separately from theconvection term, because convection and diffusion represent two distinct physicalphenomena.

Thus from a numerical point of view, they have to be handled differently, requiring distinct interpolation profiles with disparate considerations. Thechapter begins with the discretization of the diffusion equation in the presence of asource term over a two-dimensional rectangular domain using a Cartesian gridsystem. The adopted interpolation profile for the variation of the dependent variablebetween grid points and the basic rules that should be satisfied by the coefficients ofthe discretized equation are discussed.

The chapter proceeds with a discussion onthe implementation of the Dirichlet, Von Neumann, mixed, and symmetryboundary conditions. The discretization over a non-Cartesian orthogonal grid isthen introduced, followed by a detailed description of the discretization onnon-orthogonal structured and unstructured grid systems. The treatment of thenon-orthogonal cross-diffusion contribution, which necessitates computation ofthe gradient, is clarified.

Then anisotropic diffusion is introduced and handledfollowing the same methodology developed for isotropic diffusion. Theunder-relaxation procedure needed for highly non-linear problems is outlined. Thechapter ends with computational pointers explaining the treatment of diffusion inboth uFVM and OpenFOAM®.8.1Two-Dimensional Diffusion in a Rectangular DomainA simple rectangular domain with a regular Cartesian grid, as shown in Fig. 8.1, isfirst considered. The aim is to discretize, on this domain, the steady-state diffusionequation given byr C/ r/ ¼ Q/© 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_8ð8:1Þ2112128Spatial Discretization: The Diffusion Termwhere ϕ denotes a scalar variable (e.g., temperature, mass fraction of a chemicalspecies, turbulence kinetic energy, etc.), Qϕ the generation of ϕ per unit volumewithin the domain, and C/ the diffusion coefficient. The equation can be writtenmore generally in term of a diffusion flux Jϕ,D asr J/;D ¼ Q/ð8:2ÞJ/;D ¼ C/ r/ð8:3Þwhere Jϕ,D is defined asFollowing the first stage discretization presented in Chap. 5, Eq.

(8.1) can beformulated asX f nbðCÞC/ r/ f Sf ¼ Q/C VCð8:4ÞThe expanded form of the above equation can be written asC/ r/ e Se þ C/ r/ w Sw þ C/ r/ n Sn þ C/ r/ s Ss ¼ Q/C VCð8:5ÞFor the uniform Cartesian grid of Fig. 8.1, the surface vectors normal to theelement faces are given bySe ¼ þðDyÞe i ¼ kSe ki ¼ Se i Sw ¼ ðDyÞw i ¼ kSw ki ¼ Sw iSn ¼ þðDxÞn j ¼ kSn kj ¼ Sn jSs ¼ ðDxÞs j ¼ kSs kj ¼ Ss jð8:6ÞThus for the east face the diffusion flux is found to beJe/;D ¼ C/ r/ e Se@/@/iþj i¼ C/e Se@x@y e @/¼ C/e ðDyÞe@x eð8:7ÞFollowing the discrete conservation equation for one integration point discussedearlier, the discrete form of the diffusion flux can be written asJe/;D ¼ FluxTe ¼ FluxCe /C þ FluxFe /F þ FluxVeð8:8ÞTo determine the FluxCe, FluxFe, and FluxVe coefficients, a profile describingthe variation of ϕ between the centroids of the two elements sharing the face, wherethe gradient has to be computed, is required.

Assuming that ϕ varies linearly8.1 Two-Dimensional Diffusion in a Rectangular Domain213( x)Fig. 8.1 A uniform Cartesiangrid( x)wNNW( y)eNESnnSeSwW( y)CE( y)CsSsSSWSE( x)Cbetween cell centroids (Fig. 8.2), the gradient at face e along the i direction may bewritten as @// /C¼ EðdxÞe@x eð8:9ÞSubstituting into Eq. (8.8), the discretized form of the diffusion flux along facee is obtained asFluxTe ¼ C/e ðDyÞeð/ E / C ÞdxeðDyÞeð/C /E Þdxe¼ FluxCe /C þ FluxFe /E þ FluxVeð8:10Þ¼ C/eFig.

8.2 Interpolation profileat face e and slope of gradientx= slopeCESeCexeE2148Spatial Discretization: The Diffusion TermTakinggDiffe ¼ðDyÞeSekSe k¼¼dxekdCE k dCEð8:11Þwhere dCE is the distance vector between the centroids of elements C and E, thecoefficients becomeFluxCe ¼ C/e gDiffeFluxFe ¼ C/e gDiffeFluxVe ¼ 0ð8:12ÞA similar procedure applied to face w yieldsFluxTw ¼ C/ r/ w Sw@/@/iþj ðiÞ¼ C/w Sw@x@y w @/¼ C/w Sw@x wð/ /W Þ¼ C/w Sw CðdxÞwð8:13Þ¼ FluxCw /C þ FluxFw /W þ FluxVwwhere nowFluxCw ¼ C/w gDiffwFluxFw ¼ C/w gDiffwð8:14ÞFluxVw ¼ 0andgDiffw ¼ðDyÞwSwkSw k¼¼dxwkdCW k dcwSimilar expressions may be written along faces n and s and are given byFluxTn ¼ FluxCn /C þ FluxFn /N þ FluxVnFluxTs ¼ FluxCs /C þ FluxFs /S þ FluxVsð8:15Þ8.1 Two-Dimensional Diffusion in a Rectangular Domain215whereFluxCn ¼ C/n gDiffnFluxFn ¼ C/n gDiffnFluxVn ¼ 0C/s gDiffsC/s gDiffsFluxVs ¼ 0FluxCs ¼FluxFs ¼ð8:16ÞandðDxÞnSnkSn k¼¼dyndCNkdCN kðDxÞskSs kSs¼gDiffs ¼¼kdCS kdysdCSgDiffn ¼ð8:17ÞSubstituting into Eq.

Характеристики

Список файлов книги

Свежие статьи
Популярно сейчас
А знаете ли Вы, что из года в год задания практически не меняются? Математика, преподаваемая в учебных заведениях, никак не менялась минимум 30 лет. Найдите нужный учебный материал на СтудИзбе!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6455
Авторов
на СтудИзбе
305
Средний доход
с одного платного файла
Обучение Подробнее