Главная » Просмотр файлов » 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), страница 34

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

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

It is worth noting that the class itself doesnot recognize boundaries or domain interfaces. Boundaries and domain interfacesare defined in the polyMesh class, which is derived from the primitiveMesh class.In addition to possessing all the attributes of the derived class, the polyMesh classintroduces the handling of boundary definition and information, as shown inListing 7.39. Again this class does not require any particular discretization scheme.7 The Finite Volume Mesh in OpenFOAM® and uFVM194const labelUList & owner () const//Internal face owner.const labelUList & neighbour () const//Internal face neighbour.const DimensionedField< scalar, volMesh > &V0 () constReturn old-time cell volumes.const DimensionedField< scalar, volMesh > &V00 () constReturn old-old-time cell volumes.tmp< surfaceVectorField >delta () constReturn face deltas as surfaceVectorFieldListing 7.39 Information that can be obtained from the polymesh classWhile primitiveMesh and polyMesh are the basic classes of the polyhedralmesh, the fvMesh class is derived from polyMesh and adds the particular data andfunctions needed for the finite-volume discretization.

Addressing information aswell as boundary information and specific mesh data are accessible for finite volume discretization.OpenFOAM® decomposes the boundary mesh into patches stored in a listdesignated by polyPatchList under the class polyBoundaryMesh. Then, similar tointerior mesh, a specialized class denoted by fvBoundaryMesh is derived frompolyBoundaryMesh that inherits its functionalities and expands on it to includespecific functions and data needed for finite-volume discretization. As for internaldiscretization, a similar hierarchy of classes composed of primitivePatch,polyPatch, and fvPatch is defined for boundary discretization.

These classes arespecific for the boundary mesh and contain the geometric information of eachboundary. But it is the fvPatch that is used to implement the boundary conditionsduring the finite volume discretization. Figure 7.9 presents a schematic of the basicmesh description used in OpenFOAM®.In a similar way the fvMesh is used to access all mesh functionalities. Thus, it ismainly with fvMesh and fvPatch that the discretization classes and functionsinteract.Patch 3boundary facesPatch 1Patch 2interior facesFig.

7.9 Schematic of the basic mesh description used in OpenFOAM® [1]7.2 OpenFOAM®195Examples of codes for reading and accessing the main properties of a meshwithin the OpenFOAM® framework are now presented.To read a mesh, the fvMesh class that handles the finite volume mesh anddiscretization is needed along with a special constructor as shown in Listing 7.40.#include "setRootCase.H"#include "createTime.H"Foam::Info<< "Create mesh for time = "<< runTime.timeName() << Foam::nl << Foam::endl;Foam::fvMesh mesh(Foam::IOobject(Foam::fvMesh::defaultRegion,runTime.timeName(),runTime,Foam::IOobject::MUST_READ));Listing 7.40 Script to read a mesh in OpenFOAM®The include statements in Listing 7.40 are required for initialization beforereading the mesh files.Once the fvMesh instantiation is constructed under the variable named mesh, themanipulation of the loaded mesh and collection of the necessary data for furtherprogramming can proceed, as shown in Listing 7.41.// read the element centroidsvolVectorField C = mesh.C();// element volumesvolScalarField V = mesh.V();// surface centroidssurfaceVectorField Cf = mesh.Cf();Listing 7.41 Extracting data after reading a mesh in OpenFOAM®To loop over the cell volumes, the dedicated class function for information onvolumes should first be called (Listing 7.42).

This is accomplished viaconst DimensionedField< scalar, volMesh >&cellVolumes = mesh.V();Listing 7.42 Getting information on volumesand then a loop over the cell volumes can be performed as shown in Listing 7.43.1967 The Finite Volume Mesh in OpenFOAM® and uFVMforAll(cellVolumes, cellI){scalar cellVolume = cellVolumes[cellI];}Listing 7.43 Looping over all cell volumesIn OpenFOAM® the standard “for” loop is replaced by a more compact syntaxusing a macro definition named forAll (Listing 7.44) defined in the UList.H file as#define forAll(list, i) \for (Foam::label i=0; i<(list).size(); i++)Listing 7.44 Script used to replace the standard “for” loop by the macro forAllIn a similar way access to other mesh information can be performed as shown inListing 7.45.// internal accessforAll(cellCenters.internalField(), cellI){vector cellCenter = cellCenters[cellI];}// internal accessforAll(faceNormals.internalField(), faceI){vector faceNormal = faceNormals.internalField()[faceI];}]Listing 7.45 Script used to access mesh informationFor boundary patches the access procedure is similar except that now each patchhas its own class definition, and the full list of patches is defined in thefvBoundaryMesh class containing the fvPatches list.

Therefore to access boundary data the following is used (Listing 7.46):const fvBoundaryMesh& boundaryMesh = mesh.boundary();forAll(boundaryMesh, patchI){const fvPatch& patch = boundaryMesh[patchI];forAll(patch, faceI){vector faceNormal = patch.Sf()[faceI];scalar faceArea = patch.magSf()[faceI];vector unitFaceNormal = patch.nf()()[faceI];vector faceCenter = patch.Cf()[faceI];label owner = patch.faceCells()[faceI];}}Listing 7.46 Accessing data on boundary patches7.2 OpenFOAM®1977.2.1 Fields and MemoryWithin the OpenFOAM® generic framework, lists, arrays, and in general containersof different types and sizes can be defined. For a given mesh and computationalstructure, it would be useful to define a specific class capable of combining fields,lists, and vectors directly with the mesh.

A useful class that satisfies this requirement is the template class GeometricField<Type,…>. Each data defined using thisclass is strictly related to the mesh dimensions, both for the boundaries and interiordomain (be it the number of elements, the number of interior faces or even thenumber of interior vertices).In general the template class GeometricField<Type,…> stores the followingdata structure based on three main different characteristics of the mesh:• volField<Type> A field defined at cell centers;• surfaceField<Type> A field defined on cell faces;• pointField<Type> A field defined on cell vertices.The class also inherits the following properties:• Dimensions: OpenFOAM® provides a useful feature in handling fields underthe class GeometricField.

OpenFOAM® associates with each field a dimension(meter, kg, seconds, etc.) characterizing the physical meaning of the variable.Based on that all operations carried out with GeometricField have to be performed with fields of the same dimension (e.g., velocity can be summed up withvelocity not pressure) otherwise a runtime error transpires during execution.Moreover the dimension of any new field defined as a combination of existingfields in GeometricField, is automatically generated by OpenFOAM® throughapplying the same algebraic relation utilized to generate the new field on thedimensions of the used fields (e.g., dividing a mass field with a volume fieldresults in a field having the dimension of density).• InternalField: This is a repository of size equal to the size of the internal meshproperties (cell centers, vertices, or faces) in which internal information of adefined field is stored.• BoundaryField: contains all information pertinent to a defined variable at theboundary.

A list of patches is developed and each field is defined for the patchesof the boundary with the name GeometricBoundaryField. Operations can beperformed either on the full set of boundaries or on a specific patch usingfvPatchField.• Mesh: Being a class strictly related to the mesh, each GeometricField containsa reference to the corresponding mesh.• Time Values and Previous Values: This class is required to handle the specificfield during simulation.

It stores information of the previous two time steps forsecond order accuracy in time.1987 The Finite Volume Mesh in OpenFOAM® and uFVMIn the following, examples on the use of the specific class GeometricField toaccess the main properties of a field associated with a mesh are provided.In the first example it is required to define the two variables U and T, representing a velocity and a temperature field, respectively, at the cell center of themesh. This will be done using the templates of the specialized classGeometricField, which supports scalars, vectors, and tensors data type.

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

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

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