diff --git a/_site.yml b/_site.yml index e6b0cf4f0..16ea362bd 100644 --- a/_site.yml +++ b/_site.yml @@ -227,7 +227,7 @@ navbar: - text: "Lab 7" href: hpc_lab07.html - - text: "MOMP" + - text: "MOMP/CFD" menu: - text: "Informacje" href: momp_rules.html @@ -243,6 +243,16 @@ navbar: href: momp_lab05.html - text: "Instrukcja VI" href: momp_lab06.html + - text: "---" + - text: "English version" + - text: "Instruction I" + - text: "Instruction II" + href: momp_lab02_EN.html + - text: "Instruction III" + href: momp_lab03_EN.html + - text: "Instruction IV" + - text: "Instruction V" + - text: "Instruction VI" exclude: [ "*.sh", "deploy", "*~", "tools", "*.zip", "*.pdf", "MathJax-master" ] output: diff --git a/momp_lab02.Rmd b/momp_lab02.Rmd index b54c72591..af0cacfa3 100644 --- a/momp_lab02.Rmd +++ b/momp_lab02.Rmd @@ -12,7 +12,7 @@ Symulacja przepływu laminarnego w kanale z uskokiem, analiza wpływu gęstości # Streszczenie W ramach ćwiczenia należy przeprowadzić symulacje przepływu **laminarnego** w kanale z uskokiem dla liczby Reynoldsa **Reh=230**. -Liczba Reynoldsa bazuje na **średniej prędkości** na wlocie do obszaru obliczeniowego i **wysokości stopnia** h = 1 cm. +Liczba Reynoldsa bazuje na **średniej prędkości** na wlocie do obszaru obliczeniowego i **wysokości stopnia** h = 1 cm. Obliczenia testowe należy wykonać na dwóch siatkach obliczeniowych (rzadkiej i gęstej), z wykorzystaniem schematów pierwszego i drugiego rzędu do dyskretyzacji członów konwekcyjnych w równaniach pędu (first and second-order upwind). Uzyskane wyniki obliczeń porównać z [danymi eksperymentalnymi](#opis-danych-eksperymentalnych). Oszacować straty ciśnienia wzdłuż kanału. Wlotowy profil prędkości (parabola) należy zdefiniować przy pomocy funkcji [Interpreted UDF](#przygotowanie-funkcji-udf). @@ -116,7 +116,7 @@ W polu **Parameters** sterujemy, w przypadku obliczeń stacjonarnych, **ilości Ustaw wstępnie 30 iteracji i uruchom obliczenia. Pojawi się okno z informacją **Calculation complete** ale to nie znaczy, że obliczenia będą poprawne. Aby dokładnośc obliczeń doprowadzić do zadowalającego poziomu nalezy obserwować **wykres zbieżności**. **Zmień liczbę iteracji** i **kontynuuj obliczenia** aż wszystkie zmienne na wykresie **osiągną zbieżność**. -Jeżeli wykresy **wszystkich** zmiennych się zbiegnią, a więc zmienne ustalą się **w pobliżu** poziomu zbieżności którą ustawiliśmy w punkcie 11, lub go przekroczą tą wartość możemy zakończyć obliczenia. +Jeżeli wykresy **wszystkich** zmiennych się zbiegnią, a więc zmienne ustalą się **w pobliżu** poziomu zbieżności którą ustawiliśmy w punkcie 15, lub go przekroczą tą wartość możemy zakończyć obliczenia. **Jeżeli osiągniemy zbieżność** którą ustawilismy, program wyświetli informację **! solution converged** w **Konsoli** u dołu okna. **Proszę zachować** wykres zbieżności do raportu @@ -188,7 +188,7 @@ Punkt przylgnięcia znajduje się w miejscu, w którym wartości naprężeń zmi 3. W nowo otwartym oknie wciskamy przycisk **Cell Registers**/**New**/**Region...** w odpowiednie okienka wpisujemy wartości granicznych współrzędnych naszej domeny (te możemy sprawdzić w zakładce **Setup**/**General**/**Scale...** lub w górnej belce zakładka **Domain** i przycisk **Scale...** w pilu **Mesh**). -3. Następnie powtarzamy obliczenia tak jak dla 1 rzędu. ( punkty 16-21 w akapicie 1 ) +4. Następnie powtarzamy obliczenia tak jak dla 1 rzędu. ( punkty 16-21 w akapicie 1 ) ## 4. Symulacje dla metody 2 rzędu na siatce gęstej. @@ -229,9 +229,9 @@ Pliki powinny być ściągnięte do folderu w którym się znajduje projekt. - W pliku [PLIK 2]( http://ccfd.github.io/courses/data/momp/2/exper-xvel-re230-xh6_woda_cm.xy ) znajdują się składowa x wektora prędkości w przekroju poprzecznym w odległości 60 mm od uskoku. -![Dane potrzebne do pliki UDF](figures/momp_inst2/addlines.svg) +![Wizualizacja przekrojów i spodziewane rozkłady w pliku 1 oraz 2](figures/momp_inst2/addlines.svg) - W pliku [PLIK 3]( http://ccfd.github.io/courses/data/momp/2/re-vs-reattachment-point_woda_cm.txt) znajdują się dane pozwalające na określenie punktu przylgnięcia warstwy ścinającej na dolnej ścianie kanału dla różnych liczb Reynoldsa. Z załączonych danych powinno się wybrać punkt przylgnięcia odpowiadający odpowiedniej liczbie Reynoldsa. -![Dane potrzebne do pliki UDF](figures/momp_inst2/reattachment.svg) +![Wizualizacja punktu przylgnięcia](figures/momp_inst2/reattachment.svg) diff --git a/momp_lab02_EN.Rmd b/momp_lab02_EN.Rmd new file mode 100644 index 000000000..3e25a35ff --- /dev/null +++ b/momp_lab02_EN.Rmd @@ -0,0 +1,234 @@ +--- +title: Two-Dimensional Simulation of Laminar Flow over a Backward-Facing Step +number: 2 +course: Computational Fluid Mechanics +material: Laboratory Instructions 2 +--- + +# Objective + +Simulate laminar flow through a channel with a backward-facing step and investigate the effects of mesh resolution and the order of approximation of the convective terms in the momentum equations on the quality of the numerical results. + +# Overview + +In this exercise, simulate **laminar** flow through a channel with a backward-facing step at a Reynolds number of **Reh=230**. +The Reynolds number is based on the **mean inlet velocity** and the **step height**, h = 1 cm. +Perform the simulations on two computational meshes (coarse and fine), using first- and second-order upwind schemes to discretise the convective terms in the momentum equations. +Compare the numerical results with the [experimental data](#experimental-data-description). +Estimate the pressure losses along the channel. Define the parabolic inlet velocity profile using an [interpreted UDF](#preparation-of-the-udf). + +**After completing the simulations, consider the following questions:** + +1. What causes the local pressure decrease immediately downstream of the step? +2. How does the discretisation scheme for the convective terms affect the numerical results? +3. How does mesh resolution affect the quality of the numerical results? +4. What could explain any discrepancies between the numerical results and the experimental data? + +_Completion of the exercise requires presenting the numerical results and their analysis to the laboratory instructor. Submit a report containing both visualisations and an analysis of the results._ + +# Fluent + +## 1. Simulations Using the First-Order Scheme + +1. Launch Fluent. + When Fluent is launched for the first time from the project system, a launcher window appears in which the initial simulation settings can be specified. + +2. Select a two-dimensional analysis (the software may detect this setting automatically). + Additional options that may be useful in subsequent exercises include: + + - **Double precision** — increases numerical precision at the expense of computational speed and stability. + - **Solver Processes** — specifies the number of processor cores used for the calculation. Increasing the allocated computational resources increases the calculation speed. + + For this exercise, retain the **default settings** for these additional options. + +3. The user interface is similar to those of the previously used applications. The *Outline View* tree is located on the left-hand side of the screen. To **configure a simulation case correctly**, work through the tree from top to bottom and specify all required settings. + +4. Once Fluent has loaded, the geometry should appear in the graphics window, provided that *Display mesh after reading* was selected, as instructed previously. + + If the geometry is not displayed, click *Display...* in the *Task Page* panel between the graphics window and the outline tree. In the *Mesh display* window, click *Display*. + +5. Click **Scale...** to verify that the computational domain has the correct dimensions (0.7 m x 0.03 m). + + If the mesh was generated using units other than those recommended previously, rescale it: select the original units under *Mesh was created in* and confirm by clicking Scale. + +6. In the **Task Page** panel, check the basic solver settings: + + a. Pressure-based — recommended for incompressible flow calculations (Density-based — for compressible flow calculations). + + b. Steady — steady-state simulation (Unsteady — transient simulation). + + c. Two-dimensional planar flow: 2D Space/Planar. + +7. In **Outline View**, expand **Models** and double-click **Viscous** to open the model selection window. Select the appropriate [model](#overview). Close the window and collapse the Models menu. + +8. Define the fluid properties under **Materials**. Expand this item and double-click **air**, or select **air** and click **Create/Edit**. + + Enter the following properties for water: + + - Density: 1000 kg/m3. + - Dynamic viscosity: 0.001 kg/(m·s). + + In the *Name* field, the material can be renamed from *air* to *woda*. Alternatively, a fluid can be added from the *Fluent Database*; in this case, remember to assign it under *Cell Zone Conditions/Edit*. + Click **Change/Create** and close the window. + +9. Expand **Cell Zone Conditions** and open the settings for the computational domain. Under Fluid, the name assigned to the surfaces should appear; in this case, **Woda**. + + Ensure that the material created in the previous step (**woda**) is selected in the **Material Name** drop-down list. + +10. Prepare the [UDF file](#preparation-of-the-udf). + +11. Load the prescribed velocity profile into Fluent through User-Defined/Functions/Interpreted in the top menu, and click Interpret. + + ![**Fig. 1.** Loading an interpreted UDF](figures/momp_inst2/interpreted.svg) + +12. Continue to **Boundary Conditions** in **Outline View**. + Define the boundary conditions here. + If the geometry entities were named appropriately, Fluent should automatically assign the corresponding boundary condition types. + Expand the individual boundary conditions and verify the assignments: + + - velocity_inlet — **Inlet** — **velocity-inlet** boundary condition. + - wall — **Wall** — **wall** boundary condition. + - pressure_outlet — **Outlet** — **pressure-outlet** boundary condition. + + Boundary conditions are also colour-coded in the graphics window: the inlet is blue, the outlet is red, and the walls are white. + + Open the inlet boundary condition and **activate** the loaded profile for the x-component of velocity at the inlet to the computational domain. + Note that the profile specifies the x-component of velocity, not the velocity magnitude. + **Select** the appropriate **Velocity Specification Method**, then select the variable defined in the UDF from the drop-down list for the X component. + Confirm the selection and close the window. + +13. This completes the **Setup** section in **Outline View**. + +14. Under **Solution**, open **Methods**: + + - Set the pressure–velocity coupling scheme to **SIMPLE**. + - Select the first-order scheme for the convective terms in the momentum equations (**Momentum**: **First Order Upwind**). + +15. Expand **Monitors** and open **Residual**. Change **Absolute Criteria** from 0.001 to 1e-5 for all residuals. + +16. Under **Initialization**, select the Standard initialisation method. + Select the inlet boundary under Compute from. The inlet values will appear under Initial Values. + Verify that the velocity corresponds to the mean value specified in the UDF. + Click Initialize to assign these values throughout the computational domain. + +17. Open **Run Calculation**. + For steady-state calculations, the **number of iterations** is specified under **Parameters**. + Initially, set 30 iterations and run the calculation. The message **Calculation complete** does not, by itself, indicate that the results are correct. + Monitor the **convergence history** to obtain a satisfactory level of numerical accuracy. + **Adjust the number of iterations** and **continue the calculation** until all plotted variables **converge**. + The calculation may be stopped once **all** plotted variables have converged, i.e. have stabilised **near** the convergence threshold specified in step 15 or have crossed that threshold. + **When the specified convergence criterion is satisfied**, Fluent displays **! solution converged** in the **Console** at the bottom of the window. + + **Save the convergence plot for inclusion in the report.** + +18. The results can now be **visualised**. + +19. Generate pressure contours, velocity contours, velocity vectors, and streamlines using **Graphics** under **Results**: + + a. **Contours** — select the required quantity under Contours of. Select **Filled** to fill the regions between contour lines. No selection is required under Surfaces. + + b. **Vectors** — adjust Scale and Skip to improve the readability of the vector plot. + + c. **Pathlines** — select the release surfaces under Release from Surfaces. For finer meshes, remember to specify a value for Path Skip. + + **Include all visualisations in the report.** + +20. Define additional sections using Surface/Iso-Surface/Surface of Constant/Mesh. + Select the X coordinate, followed by the Y coordinate. Create lines at **x = 0**, **x = 0.06**, and **y = 0** by entering the corresponding Iso-Values. + + **Note:** the coordinate values depend on the position of the geometry in the XY plane: + + - x = 0 — cross-section at the step. + - x = 0.06 — cross-section 60 mm downstream of the step. + - y = 0 — line along the lower horizontal wall of the channel. + + These numerical values assume that the lower corner of the step is located at the origin of the coordinate system. + Finally, display the mesh together with the sections to verify that they have been created correctly. + +21. Compare the profiles of the x-component of the mean velocity at x = 0 and x = 0.06 with the experimental data using Results/Plots/XY Plot. + Perform the comparison in Fluent. + The experimental data are located in the “dane_eksperyment” directory; load them using Load File. + Click Plot to display the datasets selected under File Data. + + Consider which quantities should be plotted on the X and Y axes. + To create a plot whose horizontal axis does not represent position, clear Position on x axis. + Select Position on y axis to plot position on the vertical axis. + Under X Axis Function, select the x-component of velocity, and under Surfaces, select the relevant section. + For a horizontal line, set X = 1 under Plot Direction; for a vertical line, set Y = 1. + + Use Write to File to export a dataset to a file. + +22. Determine the reattachment location by plotting the x-component of wall shear stress using Display/Plot/XYPlot/Wall Fluxes/X Wall Shear Stress. + The reattachment point is located where the shear stress changes sign from negative to positive. + + The experimental values are provided in re-vs-reattachment-point_woda_cm.txt. Open the file in Notepad, find the value for the Reynolds number closest to 230, and compare it with the numerical prediction. + +23. This stage is now complete. Close Fluent before proceeding to the next stage. + + - Save the case in Workbench. + - Click the black triangle next to the header of the project system used for this calculation (most likely labelled *A*) and select *Duplicate* from the drop-down menu. + +## 2. Simulations Using the Second-Order Scheme + +1. Rename the duplicated system Laboratory II.2. + +2. Open the Setup cell in the new system. + +3. Fluent will launch. Retain the default settings in the launcher window. + +4. Change the **discretisation scheme** to Second Order Upwind (step 14 in the preceding section). + +5. Run the calculation and compare the results by repeating steps 17–22 (**without reinitialising the solution**). + +## 3. Simulations Using the First-Order Scheme on the Fine Mesh + +1. Duplicate system A and name it *Laboratory II.3*, following the naming convention used above. + +2. To refine the mesh, open **Domain** in the top menu and select **Refine/Coarsening** under **Adapt**. + +3. In the window that opens, select **Cell Registers**/**New**/**Region...** and enter the limiting coordinates of the computational domain in the corresponding fields. These coordinates can be checked under **Setup**/**General**/**Scale...**, or under **Domain**, using **Scale...** in the **Mesh** panel. + +4. Repeat the first-order calculations (steps 16–21 in Section 1). + +## 4. Simulations Using the Second-Order Scheme on the Fine Mesh + +1. Duplicate *Laboratory II.3* and name the new system according to the established convention. + + For the fine mesh, select the second-order upwind discretisation scheme and run the calculation (steps 17–22), **without reinitialising the solution**. + +--- + +# Preparation of the UDF + +User-defined functions (UDFs) extend the functionality of Fluent. +They can be used to define custom velocity profiles, prescribe physically governed motion of components, or implement custom computational models. + +[This link](http://ccfd.github.io/courses/code/momp/UDF_I2.c) provides the source code for prescribing the velocity profile at the inlet to the computational domain. +Download the file to the ANSYS project directory. + +In DEFINE_PROFILE, specify: + +1. The coordinates y1 [m] and y2 [m] of the lower and upper walls of the inlet channel, respectively. +2. The mean x-component of velocity, vel_aver [m/s], calculated from the prescribed Reynolds number. + +![Input parameters required for the UDF](figures/momp_inst2/udfvariables.svg) + +After launching Fluent, load the file using Define/User-defined/Functions/Interpreted. + +--- + +# Experimental Data Description + +This laboratory exercise uses **experimental data**. Velocity measurements were obtained from an experiment conducted in a channel with the same parameters. + +Download the files to the project directory. + +- [FILE 1](http://ccfd.github.io/courses/data/momp/2/exper-xvel-re230-xh0_woda_cm.xy) contains the x-component of velocity at the cross-section located at the step. + +- [FILE 2](http://ccfd.github.io/courses/data/momp/2/exper-xvel-re230-xh6_woda_cm.xy) contains the x-component of velocity at the cross-section located 60 mm downstream of the step. + +![Visualisation of cross section and expected data in file 1 and 2](figures/momp_inst2/addlines.svg) + +- [FILE 3](http://ccfd.github.io/courses/data/momp/2/re-vs-reattachment-point_woda_cm.txt) provides data for determining the reattachment location of the separated shear layer on the lower channel wall at different Reynolds numbers. Select the reattachment location corresponding to the relevant Reynolds number. + +![Visualisation of reatachment point](figures/momp_inst2/reattachment.svg) diff --git a/momp_lab03.Rmd b/momp_lab03.Rmd index 65e691340..4307f56c2 100644 --- a/momp_lab03.Rmd +++ b/momp_lab03.Rmd @@ -142,17 +142,21 @@ Całość w formie sprawozdania zawierającego obrazy jak również analizę wyn 2. Zmień warunki brzegowe dla turbulencji na wlocie, **Setup/Boundary Conditions/Inlet/Velocity_inlet** w polu **Turbulence** zmień metode na **Intensity and Hydraulic diameter**. - *Relacja pomiędzy energią kinetyczną turbulencji, k, intensywnością turbulencji, Tu, i prędkością średnią, Uśr:* + *Relacja pomiędzy energią kinetyczną turbulencji, k, intensywnością turbulencji, Ti, i prędkością średnią, Uśr:* - *k=1.5(Tu Uśr)U2.* + *k=1.5(Ti Uśr)2.* *Dla w pełni rozwiniętego przepływu w rurze można przyjąć Tu=4% w osi rury.* *W przepływach wewnętrznych skala długości turbulentnej lt nie może być większa od fizycznego rozmiaru obiektu L. Dla analizowanego przepływu w rurze L=Dinlet. Przyjmuje się, że skala długości turbulentnej:* - *lt. Przy czym \(\epsilon\) = k3/2 / lt.* + *lt = 0.07 L.* - *Podaj warunki brzegowe: Tu=4% i L=Dinlet.* **Zainicjalizuj** *obliczenia i* **przelicz**. + *Przy czym \(\epsilon\) = k3/2 / lt.* + + *Podaj warunki brzegowe: Tu=4% i L=Dinlet.* + +3. **Zainicjalizuj** *obliczenia i* **przelicz**. Porównaj wyniki obliczeń dla przekroju wzdłużnego z danymi eksperymentalnymi i z poprzednio uzyskanymi wynikami. @@ -160,7 +164,7 @@ Całość w formie sprawozdania zawierającego obrazy jak również analizę wyn Przedstaw w raporcie. -3. Wyłącz program Fluent, w środowisu Workbench zapisz projekt. +4. Wyłącz program Fluent, w środowisu Workbench zapisz projekt. ## Siatka gęsta, podejście Enhanced Wall Treatment. diff --git a/momp_lab03_EN.Rmd b/momp_lab03_EN.Rmd new file mode 100644 index 000000000..597273bcb --- /dev/null +++ b/momp_lab03_EN.Rmd @@ -0,0 +1,219 @@ +--- +title: Simulation of turbulent flow through a stepped pipe +number: 3 +course: Computational Fluid Mechanics +material: Laboratory Instructions 3 +--- + +# Objective + +Simulate turbulent flow through a pipe with a change in diameter using the k-\(\epsilon\) turbulence model, and investigate the effects of inlet boundary conditions and near-wall modelling on the numerical results. + +# Overview + +Turbulent flow calculations at ReD = 200 000 using the standard k-\(\epsilon\) turbulence model will be performed on two computational meshes: a baseline coarse mesh and a fine mesh. +The Reynolds number is based on the larger pipe diameter, D = 0.1524m, and the mean velocity at the outlet of the computational domain. + +Simulations on the baseline mesh require Standard Wall Functions to calculate the mean velocity, turbulent kinetic energy, k, and turbulent kinetic energy dissipation rate, \(\epsilon\), near the wall. +Calculations on the fine mesh will use the k-\(\epsilon\) turbulence model coupled with the Wolfstein one-equation model in the near-wall region. +This approach is referred to as Enhanced Wall Treatment. + +The working fluid is water. + +A velocity-inlet boundary condition will be prescribed at the inlet to the computational domain. +The mean velocity profile has been obtained from a simulation of fully developed turbulent pipe flow. +Three approaches to prescribing the inlet profiles of turbulent kinetic energy and its dissipation rate will be considered: + +1. Profiles obtained for fully developed pipe flow (inlet_profile_keps.prof). +2. The default Fluent settings, which have no physical significance. +3. User-defined values based on estimates of the turbulence intensity, Tu [%], and the turbulent length scale, lt [m]. + +Pre-prepared *.cas files containing the coarse and fine computational meshes are provided. +Mesh generation is therefore not required. + +*Completion of the exercise requires presenting the numerical results and their analysis to the laboratory instructor. Submit a report containing both visualisations and an analysis of the results.* + +# Procedure + +## Calculations Using Wall Functions + +1. Drag **Fluent** from **Component Systems** into the project schematic. Launch Fluent by opening the *Setup* cell (**2D, Double precision, serial** (one process)). +2. Import the *.mesh file containing the baseline computational mesh using **File/Import/Mesh...**. + + [Download the mesh file](http://ccfd.github.io/courses/data/momp/3/coarse.msh) + + The pipe diameters are D = 0.1524m and Dinlet = 0.517D = 0.0788 m. + +3. The flow is axisymmetric. Fluent will probably detect this from the boundary condition naming and display a corresponding warning in the console. Check the **Solver** settings under **Setup/General**. +4. Select the appropriate turbulence model under **Setup/Models** and the appropriate **Near-Wall Treatment** option. +5. Verify the fluid properties under **Setup/Materials/Fluid**. +6. Download the [file containing the prescribed boundary condition profiles](http://ccfd.github.io/courses/data/momp/3/inlet_profile_keps.prof). +7. Load the downloaded profiles using either of the following methods: + + - In the top menu, select **Physics/Zones/Profiles..**. + - In the tree on the left, double-click **Setup/Boundary Conditions** and click **Profiles...**. + + Five fields will be loaded, three of which represent the required variables: **velocity, turbulent kinetic energy, and turbulent kinetic energy dissipation rate profiles**. + +8. Under **Solution/Methods**, select the first-order upwind discretisation scheme for the convective terms in the momentum equations and SIMPLE for pressure–velocity coupling. +9. Set the convergence criterion to 1e-5 under **Solution/Monitors/Residual**. +10. **Initialise** the solution from the inlet and run the calculation. Monitor solution convergence. + + Examine the inlet profiles of mean velocity, turbulent kinetic energy, and dissipation rate under **Results/Plots/Profile Data**. + Open the profile file in Notepad and examine how the profiles are defined. + + In the report, provide examples of cases in which such profiles can be used to prescribe boundary conditions, and cases in which a UDF is preferable, as in the previous laboratory instructions. + +11. Once a converged first-order solution has been obtained, switch to second-order discretisation and continue the calculation without reinitialising the solution. + *In some cases, convergence cannot be achieved when the calculation is started directly with second-order discretisation.* + + Include the convergence plot in the report. + +12. Generate visualisations of pressure, velocity, turbulent kinetic energy, and dissipation rate contours, as well as velocity vectors and streamlines, using the options under **Results/Graphics/Contours**. + + Include these visualisations in the report. + +13. Verify the Reynolds number using the mean velocity at the outlet of the pipe with diameter D=0.1524m. Use **Results/Report/Surface Integrals**, with Report Type set to **Area-Weighted Average**. + + Determine the mean inlet velocity and the maximum inlet velocity on the pipe axis. + Both quantities can be calculated under **Results/Report/Surface Integrals**: + + - Report Type: **Area-Weighted Average**, for the mean velocity. + - Report Type: **Vertex Maximum**, for the maximum velocity. + + Record the mean velocity, **Uśr**, and the maximum velocity, **Uxmax**. + These values are required to normalise the axial component of the mean velocity and the turbulent kinetic energy for comparison with the [experimental data](#experimental-data-description-and-graphical-interpretation). + +14. Define the normalised functions using **User-defined/Field Functions/Custom** in the top menu: + + - The axial velocity component normalised by the maximum velocity on the pipe axis at the inlet to the computational domain, **Ux / Uxmax**. + + From the **Field Functions** drop-down menu, select Velocity and Axial Velocity, then click Select. Select the division operator and enter the previously recorded maximum inlet velocity. Enter a name and click Define. + + - The turbulent kinetic energy normalised by the square of the mean inlet velocity, **k/(Uśr)2**. + + From the **Field Functions** drop-down menu, select Turbulence and Turbulent Kinetic Energy (k), then divide by the square of the corresponding constant. + +15. Check y+ on the wall, wall_d, and wall_inlet boundaries using **Results/Plots/XY Plot**: + + - Y axis function: Turbulence. + - Wall YPlus. + + Effective use of wall functions requires the dimensionless wall distance y+ at the centroids of the wall-adjacent cells to lie within the range y+=30-300. + + Include the results in the report. + +16. Compare the numerical results with the [experimental data](#experimental-data-description-and-graphical-interpretation) at the cross-section *x = -0.0381* and along the longitudinal section *r = 0.07271*. + + Use **Load File** under **Results/Plots/XY Plot** to load the experimental data. + As in the **previous laboratory instructions**, first plot the experimental data, then determine which quantities should be assigned to the X and Y axes. + Define the sections x=-0.0381 and r=0.07271. + Remember to compare the **normalised** functions available under Custom Field Functions, rather than comparing velocity and turbulent kinetic energy **directly**. + Pay particular attention to the position of the first near-wall point in the cross-section. + + *Do the numerical results adequately reproduce the variation of mean velocity with x along the longitudinal section? Note that two recirculation regions are observed in the experiment, with the smaller one located at the step.* + +17. Export the plot for the longitudinal section to a text file using **Write to File** under **Results/Plots/XY Plot**. + + Include the plot in the report. + +18. Close Fluent and save the project in Workbench. + +--- + +## Analysis of the Effects of Inlet Boundary Conditions + +### Default Fluent Settings + +1. **Duplicate** the simulation system, assign an appropriate name, and launch Fluent from the new system by opening the **Setup** cell. +2. Under **Setup/Boundary Conditions/Inlet/Velocity_inlet**, replace the profiles for turbulent kinetic energy and dissipation rate with the default Fluent conditions, const=1. +3. Initialise the solution from the inlet and run the calculation. +4. Compare the resulting velocity profiles along the longitudinal section with the experimental data and the previous simulation results. + + *Do the numerical results differ significantly from the experimental data? Export the resulting near-wall velocity profile using Display/Plot/Xyplot, Write to File.* + + Include the comparison in the report. + +5. Close Fluent and save the project in Workbench. + +--- + +### Theoretically Based Boundary Conditions + +1. **Duplicate** the simulation system, assign an appropriate name, and launch Fluent from the new system by opening the **Setup** cell. + +2. Change the inlet turbulence boundary conditions under **Setup/Boundary Conditions/Inlet/Velocity_inlet**. In the **Turbulence** section, select **Intensity and Hydraulic diameter**. + + *The relationship between turbulent kinetic energy, k, turbulence intensity, Ti, and mean velocity, Umean, is:* + + *k=1.5(Ti Umean)2.* + + *For fully developed pipe flow, Tu=4% may be assumed on the pipe axis.* + + *In internal flows, the turbulent length scale lt cannot exceed the characteristic physical dimension L. For the pipe flow considered here, L=Dinlet. The turbulent length scale is assumed to be: lt = 0.07 L.* + + *Dissipation rate* + *\(\epsilon\) = k3/2 / lt.* + + *Specify the boundary conditions Tu=4% and L=Dinlet.* + +3. **Initialise** *the solution and* **run the calculation**. + + Compare the numerical results along the longitudinal section with the experimental data and the previous simulation results. + + *Which simulation results are closest to the experimental data, and why? Is the use of the default Fluent conditions justified?* + + Include the comparison and discussion in the report. + +4. Close Fluent and save the project in Workbench. + +## Fine Mesh with Enhanced Wall Treatment + +1. **Duplicate** the simulation system from the [first section](#calculations-using-wall-functions), assign an appropriate name, and launch Fluent from the new system by opening the **Setup** cell. +2. Download the fine mesh file: + + [Download the mesh file](http://ccfd.github.io/courses/data/momp/3/fine.msh) + +3. Replace the mesh: + + In the top menu, open **Domain** and select **Replace Mesh...** in the **Zone** panel. + + *Fluent will perform a series of operations to adapt the existing settings to the new mesh. It is essential that the new mesh use exactly the same boundary names.* + +4. Initialise the solution and run the calculation. + +5. After several dozen iterations, check y+ on wall_inlet and wall_d using **Results/Plots/XY Plot**, selecting Turbulence and Wall YPlus. + + To use Enhanced Wall Treatment, y+ must be less than 1 to represent the flow dynamics in the viscous sublayer correctly. + If y+ you will be close to 10/15 change Near Wall treatment approach from Standard Wall Treatment to Enchanced Wall Treatment in k-epsilon turbulence model. + If this condition is not satisfied, refine the computational mesh. + Repeat the calculation and mesh refinement until y+ is close to 1. + + - In the top menu, open **Domain** and select **Refine/Coarsening** under **Adapt**. + - In the window that opens, select **Cell Registers**/**New**/**Boundary...**. + - Enter a name of your choice for the adaptation register. + - Select **wall_inlet** and **wall_d**. + - Under **Number of cells**, enter the number of cell layers to be adapted, counted from the wall: **2**. + - Click **Save/Display**. + - Return to **Adaptation controls** and select the newly created adaptation register from the **Refinement Criterion** drop-down menu. + - Click **Adapt**. + +6. Compare the numerical results with the experimental data at the cross-section using **Results/Plots/XY Plot**. Compare the fine-mesh results along the longitudinal section with the experimental data and the baseline-mesh results. + + *Does increasing the mesh resolution produce substantially better results near the wall? Is the computational cost of the fine-mesh simulation significantly higher than that of the baseline-mesh simulation?* + + Include the comparison and discussion in the report. + +7. Generate visualisations. + +# Experimental Data Description and Graphical Interpretation + +- **[exper-axial-vel_x-0_0381.xy](http://ccfd.github.io/courses/data/momp/3/exper-axial-vel_x-0_0381.xy)** — the axial component of the mean velocity, normalised by the maximum velocity on the pipe axis at the inlet to the computational domain, plotted against radial position at the cross-section x = - 0.0381, immediately upstream of the step. + +- **[exper-axial-vel_r0.07271.xy](http://ccfd.github.io/courses/data/momp/3/exper-axial-vel_r0.07271.xy)** — the axial component of the mean velocity, normalised by the maximum velocity on the pipe axis at the inlet to the computational domain, plotted against x at a radial distance r = 0.07271 from the pipe axis, near the wall of the larger-diameter pipe. + +![*Axial velocities at the sections x = -0.0381 and r = 0.07271*](figures/momp_inst3/axial.svg) + +- **[exper-k-over-u2_x-0_0381.xy](http://ccfd.github.io/courses/data/momp/3/exper-k-over-u2_x-0_0381.xy)** — turbulent kinetic energy, normalised by the square of the mean inlet velocity, plotted against radial position at the cross-section x = - 0.0381, immediately upstream of the step. + +![*Turbulent kinetic energy profile at the cross-section x = -0.0381*](figures/momp_inst3/k.svg)